Converting data to a HTML string is not a performance bottleneck you'll be worrying about. I wasn't worrying about it much in 2000, and you really shouldn't need to in 2023.
Thanks for taking the time to read the article :) A lot of the comments here seem to implying that I claim "htmx is the one hammer to solve all website needs", even when I explicitly say SPAs have their place in the article.
A hypermedia approach is the nice happy medium between a very static website and an SPA, not sure why so many people are close-minded about this possibility.
In releases, you'll find PDFs and epubs, I'm pretty sure most epub readers will let you use a dark mode. Or you can just read the markdown files on GitHub, which also supports it.
Thanks for this, it's an important comment because it's linking to the master branch but I changed it to main a while ago so master is quite far behind.
I'm not sure how they're mutually exclusive. Also TDD is more of a _design_ technique than a testing technique. I've worked in languages with extremely expressive typesystems (like Scala) and I still practiced TDD
Just because something isn't skilled doesn't mean it's not important or doesn't bring value. The people who do these jobs deserve a decent wage and respect, not psuedo-wage-slavery
The point of "just writing enough to make the test pass" is to get you to the point where you have working software (proven by the test, even if the code is "bad")
This is the _only_ point where you can safely refactor, if your tests are failing how do you know you haven't broken something? So long as you keep things "green" you know you're ok
> The danger seems to be when you have to walk away from some code and you or whoever picks up your code doesn't know what you were up to.
Just don't do this. You're not "done" with the TDD cycle until you make it pass and have refactored.
I reflect this in my git usage too, roughly it goes
- Write a test
-> Make it pass
-> git commit -am "made it do something"
-> refactor
-> run tests (if i get in a mess, revert back to safety and try again)
-> git add .
-> git commit --amend --no-edit
> It seems "safer" to write tests that are going to stay broken until every little corner of everything works properly, even though this is less iterative.
The problem with this is how do you safely refactor when you have potentially dozens of tests failing?
A big point of this approach is it makes refactoring a continuous process and makes it easier because you have tests proving you haven't accidentally changed behaviour.
Your comment is exactly what I try to get across in the book but it's not always easy.
If you cant decide how you want something to look (as that's not always easy) just take a punt on something. Make sure it's a small decision and make something useful. Sure you might have to change it, but at least you'll be basing that on some real feedback.
A chapter zero is a great idea, just less exciting to write so the current one is what got priority ;)
I echo your sentiments, in the README.md in the root i talk about how writing tests is how I generally try and solidify knowledge.
I watched a few videos from a Coursera course called "learning how to learn" (or something like that) and it talked about how making your own analogies and examples helps you memorise stuff. To me, this style of learning works along those lines.
I wanted to keep the various "versions" to hand as i developed it. I _could_ grab them from git but i found myself making little edits and copying and pasting, referring to them et al.
I am tempted to delete them and just leave the final version, will have a think
Thanks for the kind words. The reason I linked just the "hello-world" part is because it's the only part I feel is finished enough to share. (that being said I am literally making edits to it now).
It's a WIP project, there's a few other sections on integers and arrays but I hope to cover all the other Go features like channels, goroutines etc - all TDD'd
Once that's done I plan to do more involved examples, such as TDD-ing a basic webserver.