10 ms·
What kind of coding did you do for 6 years if after that time you couldn't identify a for-loop?
by Nevermindmyview 7y ago
What kind of coding did you do for 6 years if after that time you couldn't identify a for-loop?
- whatshisface 7y agoThe parent said they didn't know what for-in was, which implies they were using a language like C for their side projects which only has for (i=0;i<n;i++) loops.
- k_ 7y agoThat or they only used `while` (and friends if available in the language) loops.
- bluedino 7y agoYou can google that in 2 seconds. A CS degree isn't going to help you there if you have not covered a language that uses iterators.
- saagarjha 7y agoAny self-respecting computer science degree education should cover at least one language that has iterators or enhanced enumeration.
- cabaalis 7y agoMy CS degree (2002-2006) did not explicitly cover "for x in y" iterators. But it did cover an understanding of algorithms and data structures well enough that I could implement one. Which is better? YMMV.
- 0xDEFC0DE 7y agoThat was probably before they were really in style e.g. C# didn't add foreach / iterators until ~2005 with v2.0 and your curriculum probably lags a bit behind the industry state-of-the-art unless it was Ivy league
- jki275 7y agoIt has not been very long since CS degrees were taught entirely in C89 or C++98, and there are a lot of us who won't touch Python or Java unless forced to.
- grahamel 7y agoexactly - I had a similar learning curve (and no CS degree) where I could never remember what certain methods did but I knew exactly what to google for the answer
- Nevermindmyview 7y agoSounds like you didn't read the parent post carefully? He wrote: > I didn't know how to write a for loop If
- arethuza 7y agoA Haskell developer?
- joshmn 7y agoOuch.
- Nevermindmyview 7y agoI'll bet a choklate bar that 100% of all developers who spent 6 year using Haskell knows what a for-loop is.
- jerf 7y ago"for" is not that complicated, it's just mapM with its arguments pre-flipped: http://hackage.haskell.org/package/base-4.12.0.0/docs/Control-Monad.html#v:forM http://hackage.haskell.org/package/base-4.12.0.0/docs/Contro... I don't know why you want to call that a "loop", but, sure, you do you, you crazy imperative programmers.
- hutzlibu 7y agoBecause it is a loop in any sane language ... you overheaded functional programmers .. edit: Sigh. I was jockingly mocking.
- s_dev 7y agoHaskell just enforces iteration through recursion. How did he solve the iteration problem? A for loop is just syntactic sugar for a while loop.
- hutzlibu 7y agoI doubt there are many Haskell developers (or one at all) without a academic background ..
- alephu5 7y agoI'm a self-taught developer with haskell in my arsenal, although that being said I have an MSc in theoretical physics which probably helps me appreciate the power of its paradigm.
- sct202 7y agoMaybe they're was using Coffeescript with jQuery, and jQuery has some built in looping functions like .each that don't exactly look like a for loop.
- pmarreck 7y agoAny functional language, pretty much. They use enumeration (list/array traversal) to process a list/array of inputs. And it entirely makes impossible the off-by-one error. I am happy if I never have to see a for-loop again. (Even in JS, I use iteration/enumeration constructs as much as possible.)
- xmprt 7y agoI find it hard to believe a beginner with no theoretical CS background would pick up a functional language first. So the question still stands.
- zshrdlu 7y agoHow strange. Why would you find it hard to believe? It is one of several programming paradigms, after all. Am I missing something?
- pmarreck 7y agoThe "advanced intro CS" class at Cornell (CS 212, at least at the time) used Scheme. Maybe I should become a high school CS teacher, because I would not curse anyone with a procedural language.