Re:Learn more programming languages, even if you won't use them
by platz on Saturday April 13, 2019 @08:42AM
(#19652681)
And none of those OO langs can be relied on to have tail recursion so now you a new problem
[ Parent
| on HN ]
Re:Learn more programming languages, even if you won't use them
by yomly on Saturday April 13, 2019 @08:48AM
(#19652712)
Most non-functional languages will implement map/filter/reduce as loops under the hood, but realizing that there is an abstraction for general sequence processing frees you up to focus more on the core business logic at hand and reduces the surface area of your code for bugs.
Sure, handrolling a loop is a trivial activity that novice programmers can figure out, so you should _never_ get it wrong because you _never_ ever program tired or hurriedly under deadlines or make typos or input off by ones...
Re:Learn more programming languages, even if you won't use them
by AnimalMuppet on Saturday April 13, 2019 @03:50PM
(#19655339)
I don't recall exactly how many handrolled loops I've messed up in the last 10 years, but the number is either 1 or 2. Could I mess up one or two map/filter/reduces in 10 years? Is it impossible to mess them up? What about the cases they don't cover, so you use your own recursion?
Re:Learn more programming languages, even if you won't use them
by jodrellblank on Saturday April 13, 2019 @10:45PM
(#19657264)
OK you can write a handrolled loop almost perfectly. /Why/ are you writing ten years worth of loops - something a computer can do for you?
Re:Learn more programming languages, even if you won't use them
by AnimalMuppet on Sunday April 14, 2019 @02:42PM
(#19660924)
Can it? I'm working on embedded systems, in C++, with C++11-or-earlier compilers. Sometimes I need control of the exact order things happen in. Sometimes I need an action to occur either zero or one times, on the first available entry. Always I need to write code that my coworkers can read.
How much of that can a C++11 compiler do for me?