News for hackers. Stuff that matters.
Re:Ask HN: What change in your programming technique has bee... by sjamaan on Thursday January 23, 2020 @02:28PM (#22130897)
I would say: Automated testing and a functional programming mindset.

Even for legacy projects, starting with adding regression tests for every bug you find is a great way to introduce testing. And when you add new features, you can write tests for that as well.

I find that a FP mindset is helpful mostly because it tends to reduce the amount of global or spread-around state. This in turn makes testing and quickly iterating in a REPL a lot easier. Also when later the time comes to debug, it's much simpler if you don't have a huge amount of state to set up first.

And even if a lot of state is required, having it be an explicit input to a procedure is helpful because it makes it much clearer what you need to set up when doing manual testing.

Re:Ask HN: What change in your programming technique has bee... by inkeddeveloper on Thursday January 23, 2020 @02:33PM (#22130949)
You had me at automated testing.
Re:Ask HN: What change in your programming technique has bee... by diarmuid on Thursday January 23, 2020 @04:32PM (#22132360)
+1