7 ms·
I took a (mandatory for cs) class in college that introduced these concepts. For a long time I thought that was a normal part of cs curriculums, but it seems no
by greydius 10y ago
I took a (mandatory for cs) class in college that introduced these concepts. For a long time I thought that was a normal part of cs curriculums, but it seems not.
Also, its very strange to see these concepts illustrated with Javascript. I imagine thats something like trying to learn Chinese using the roman alphabet. Not that it can't be done, but a lot of important details are necessarily missing.
- bjz_ 10y ago> For a long time I thought that was a normal part of cs curriculums, but it seems not. Alas, not all CS programs are created equal. Many skip entirely over FP because it isn't 'what the industry does'.
- GFK_of_xmaspast 10y agoPinyin is a thing that exists tho?
- whorleater 10y agoPinyin's existence is as a stepping stone, and misses out on a lot of interplay between words. Pinyin negates how you can separate Chinese characters into different symbols, such as the Chinese character '鮮' ('xiān' in pinyin), is the combination of '魚' ('yú') and '羊' ('yáng'). It's certainly not impossible to learn Chinese through pinyin, but it would be an odd choice.
- 208Gi 10y agoPinyin doesn't negate Chinese characters. It's just tackling another issue - sounds and tones.
- DeadReckoning 10y agoIt's not an odd choice. I've never heard of anyone learning Chinese as a second language who doesn't use pinyin at least for the first few years.
- GFK_of_xmaspast 10y agoI'm not convinced that there are enough hanzi that decompose nicely like that to make up for all the other issues.
- wereHamster 10y ago> Also, its very strange to see these concepts illustrated with Javascript. Indeed. And I don't like it at all. It seems as if everybody is afraid that web developers won't understand the concepts if they are expressed with mathematical symbols instead of JavaScript functions.
- Waterluvian 10y agoHonestly I want both. The mathematical expressions, and an implementation in any language. I never took math in university and am woefully deficient. But the past few years proved to me that I'm 100% capable of learning the concepts. I just really sorely need examples in a syntax I understand.
- wereHamster 10y agoSyntax is easy to learn if you know the mathematical concepts. The other way around... not so much.
- k__ 10y agoall those symbols in haskell aren't really helping, even if the syntax is easy to learn...
- eru 10y agoMost of the funky symbols in Haskell are library defined operators. You can define your own in a single line of code. They behave just like functions, just with an infix syntax by default, instead of prefix. You can use Hoogle (eg https://www.stackage.org/lts-6.9/hoogle?q=%3E%3E%3D https://www.stackage.org/lts-6.9/hoogle?q=%3E%3E%3D) to look them up. It's a bit daunting at first. But most code actually only uses operators from at most a few libraries. Once you understand Monoid, Applicatives and Monads and their operators, you'll be doing OK. There are alphabetic names for their operators. But they are not used much---working programmers prefer the symbols. Alas, learning wouldn't be much easier with them either, because most of the work is in understanding the concepts. People would complain just as much about the cryptic names as about the cryptic symbols. (The only mainstream library that really goes crazy with the symbols is 'lens'.)
- Waterluvian 10y agoJavaScript lends itself really well to functional programming, no?
- wereHamster 10y agoNot really, no. Example: partial function application does not feel nearly as natural as in in Haskell.
- altcognito 10y agoThe reason they use JavaScript is because it's known by many and the examples can be tried without downloading/having an additional compiler. There are at least two dozen concepts on the list there - the value of illustrating new concepts for some with a known quantity far outweighs the downsides of having to start with a fresh environment. I will say though for the exact cases you mention, they probably should be clear why this isn't exactly the concept as described.
- gaius 10y agoHere you go: http://tryhaskell.org http://tryhaskell.org
- Waterluvian 10y agoIt's definitely no Haskell. But if you wanted to do FP in JavaScript, it wouldn't be a painful ordeal, no? Well, ES6 and newer at least.
- catnaroek 10y agoFunctional programming puts the static structure of a program at the forefront: types, invariants, equations relating inputs and outputs of processes, etc. JavaScript doesn't do this very well. In fact, even C++ does it better than JavaScript. Nobody would in their reasonable mind call C++ a functional language, right?
- segmondy 10y agoYour mistake is in thinking that most developers have gone through CS, I do like to wager that we have more developers today without a CS background than those with a CS background. Therefore, things like these are new to them. I actually think that Javascript is a great way to teach these concepts because those developers without CS backgrounds are less likely to be writing lisp or haskell code, and more likely to know Javascript.
- adamkittelson 10y agoI think that touches on one of the problems with hiring in tech. People tend to think things they learned earlier chronologically are simpler or more fundamental and necessary building blocks in order to be competent at the things they learned later. So we have programmers with CS backgrounds rejecting programmers without who would be perfectly capable of doing a particular programming job because they get tripped up on some algorithm or data-structure quiz that has no relation to what they'd actually be doing on the job (and could be quickly learned if and when it did).
- chriswarbo 10y ago> People tend to think things they learned earlier chronologically are simpler or more fundamental and necessary building blocks in order to be competent at the things they learned later. That would explain why C is still so prevalent, as opposed to being 'yet another language from the 70s' ;)
- pjmlp 10y agoI guess it depends on the country. On my own, if you don't come from CS or EE background you hardly will get through HR.
- rankam 10y agoCurious, could I ask the country? I've lived in both the US & UK and would say that the vast majority of companies I've been involved with (via employment or simply interviewing) haven't cared about my degrees, but instead care about what I've worked on in the past and what they perceive I could learn/add to the company. NB I don't have a CS or EE background.
- seishun 10y ago>I imagine thats something like trying to learn Chinese using the roman alphabet. So basically, completely normal and reasonable? (see http://languagelog.ldc.upenn.edu/nll/?p=10554 http://languagelog.ldc.upenn.edu/nll/?p=10554)
- DeadReckoning 10y agoI also found that comment incredibly ironic :P
- vacri 10y ago> I imagine thats something like trying to learn Chinese using the roman alphabet. Chinese kids learn chinese characters by learning the roman alphabet first. Primary-school kids in China learn pinyin, which then helps them to learn chinese characters.
- Dr_tldr 10y ago> Also, its very strange to see these concepts illustrated with Javascript. I imagine thats something like trying to learn Chinese using the roman alphabet. Not that it can't be done, but a lot of important details are necessarily missing. I think you're being sincere in expressing a common attitude within the Lisp/FP community, but it's an unfortunately limiting attitude. It would appear strange to an ancient Sumerian to see the Epic of Gilgamesh translated into English, but the translation is far more accessible and thus far more influential than the original. I'm a front-end dev and I got into Clojure and Elm because of some books/libraries for functional programming in Javascript. It's doubtful I would've ever had enough interest to learn if no one in those communities made an effort to translate some of their concepts into a language that I already use.
- nchelluri 10y ago> It would appear strange to an ancient Sumerian to see the Epic of Gilgamesh translated into English, but the translation is far more accessible and thus far more influential than the original. well said! (i'd have found es5 more accessible still.)
- wruza 10y ago>I'm a front-end dev and I got into Clojure and Elm because of some books/libraries for functional programming in Javascript. It's doubtful I would've ever had enough interest to learn if no one in those communities made an effort to translate some of their concepts into a language that I already use. That's the way most front-end devs learn new things. People talk about FP attitude here, but it is no-www attitude actually.
- deleted 10y ago[deleted]