Re:How currying leads to elegant, readable code
by qu4z-2 on Thursday June 19, 2014 @08:02PM
(#7918943)
I see this assumption quite frequently -- That what is easy for a beginner is easy for an expert. I'm not sure that's the case.
FWIW, I'm in the anti-boilerplate camp.
Re:How currying leads to elegant, readable code
by skybrian on Thursday June 19, 2014 @11:09PM
(#7919377)
Well, most things are easier for an expert, or they wouldn't be an expert, right? I think it's good practice to try to write code that's readable by people with a wide variety of skill levels.
Re:How currying leads to elegant, readable code
by rnbwd on Saturday June 28, 2014 @03:39AM
(#7957708)
I began programming in September of last year. For loops were trivially easy to understand (took me about a day), 1-2 weeks to become proficient. I started with php, moved to 'jquery', and then rails. Rails pisses me off. I said fuck this class I'm learning node/javascriot. After a week of js I switched to clojure (my instructor hadn't even heard of it, this is a full day bootcamp coding course). Rich Hickey is my single greatest influence in programming habits styles. I spent a few months, off and on, learning clojure. I still can't program competently, but I learned how to replace for loops with map / filter / reduce. Once I realized what was going on there, I had my greatest 'ah ha' moment in programming thus far. Clojure blogs led me to Om, om to react, react to frp and gulp, gulp lead to streams / piping, and I haven't used a for loop in 6 months. It's boilerplate that's so trivial, you only need to code for about 3 months for the functional abstractions to become more useful to you. It took me a few weeks to learn how map, filter, reduce work. It took me a few hours to learn a 4 loop. I still consider myself am amateur programmer, but this trend of code abstraction will continue rapidly, and our CPUs and more that capable of handling the potential performance hits.
"you might even extract some or all of those three details into named one-liner functions"
No. Replacing familiar operations with unfamiliar ones (adding a level of indirection) doesn't add readability or make it "more self-documenting" than pure boilerplate code that everyone's seen many times before and will see again.
But these sort of arguments never reach a conclusion. The way to test it would be to teach beginners and see which one is easier to teach. That's a bit beyond a casual internet discussion, though. :-)