News for hackers. Stuff that matters.
Re:Ask HN: How to transition from academic programming to so... by ttalviste on Sunday September 09, 2018 @05:41PM (#17947916)
First of all, SW engineering is a practice with a lot of responsibility. The main responsibility lays in writing code, that is easy to understand. For example, if you think you write well written code, then try reading code that you have written a couple of months ago. Usually, a very painful experience :D

So try to write code for an audience. This has been the trigger for me. Also I encourage code reviews and TDD.

The main learning resources for me have been, Clean Coder videos by Robert C Martin aka Uncle Bob. They are pure gold. They can feel awkward, but after a while they make sense.

Also DDD domain driven design is a key topic to tackle.

Books: - Clean code - DDD by Vaughn Vernon

Videos: - Clean coder E1-E52

With these two books and videos you are on a good track! These worked for me.

Re:Ask HN: How to transition from academic programming to so... by Lyren on Sunday September 09, 2018 @09:18PM (#17948741)
I can vouch for Clean Coder. We watched them in our company. It's a small dev team so we took the time together. Afterwards we implemented a 4-line rule amongst other things.

We don't always hold ourselves to it, sometimes 5-6 line functions make sense, but we strive toward 4. Sometimes it's as easy as breaking code out into a new function, but sometimes you just simply have to create a class for it. That way a lot of complicated code suddenly becomes very easy without much effort.

Re:Ask HN: How to transition from academic programming to so... by blub on Monday September 10, 2018 @08:58AM (#17951450)
And this is why I don't like the clean code series and usually recommend against reading it.

Limiting function length to < 10 lines is like limiting your walking stride to 30cm. You'll spend most of your time chasing useless functions when trying to understand the system.

Re:Ask HN: How to transition from academic programming to so... by JanisL on Wednesday September 12, 2018 @12:19AM (#17965522)
This honestly sounds extremely limiting. I do get why you'd want to make functions short in general but I think there's a tipping point where making the functions shorter actually increases overall complexity and 4 lines seems to be past that tipping point in my experience.
Re:Ask HN: How to transition from academic programming to so... by Lyren on Thursday September 13, 2018 @12:58AM (#17976179)
It's honestly not as limiting as you might think. Readability has definitely improved a ton since switching.

Of course we don't count every bracket or blank lines. Only the rows with any logic or assignment.

And yes, I agree, there are occasions where the complexity goes up. If there is a good argument for that, then we of course go with it.

But so far, almost everything anyone in our team has made, has been improved by rewriting it to something that works well in 4 lines, be it using polymorphism, object oriented, or functional.