News for hackers. Stuff that matters.
Re:Anti-If: The missing patterns (2016) by d--b on Wednesday June 27, 2018 @06:09AM (#17407010)
Fair enough.

It’s annoying though (and kind of strange, really) that these articles (which discuss very basic concepts) make it to the front page, and may influence a bunch of rookie developers the wrong way.

Re:Anti-If: The missing patterns (2016) by wool_gather on Wednesday June 27, 2018 @08:43AM (#17407655)
Eh, there's no shortcut to experience. Beginners are going to get ideas from _somewhere_, without being able to thoroughly judge them. And they'll try some, and eventually they'll figure out what works and what doesn't. I thought this article was reasonably clear that it did not offer a silver bullet, just some structures to watch out for, consider, and maybe improve.
Re:Anti-If: The missing patterns (2016) by tigershark on Wednesday June 27, 2018 @07:59AM (#17407445)
I would rather have new developers think in a more object oriented or functional way instead of procedural. If statements imho promote procedural thinking, while pattern matching, polymorphism, or to a somehow lesser extent, if expressions promote a more OO or functional way of thinking.
Re:Anti-If: The missing patterns (2016) by Bartweiss on Wednesday June 27, 2018 @11:16AM (#17408802)
I agree that this stuff is mostly counterproductive.

As design theory? Fine.

As HN frontpage stuff? I mostly see it get discussed in the form of new devs or students asking things like "wait, how should I remove all the 'ifs' in my Java code?" (Yes, that's a real example.)

Spreading the good news about case statements, function passing, and so on is great. But this stuff is so often written up as absolutes, when simple conditionals really are a part of most practical cases.