3 ms·
If you are lucky, the thing you will eventually learn about JavaScript is to use either TypeScript, Flow, Elm, Reason, or PureScript. If you are unlucky, you m
by jasim 8y ago
If you are lucky, the thing you will eventually learn about JavaScript is to use either TypeScript, Flow, Elm, Reason, or PureScript.
If you are unlucky, you might get attached too much to design decisions made by Brendan Eich because he didn't have enough time to design the language, and nobody knew how big the web was going to get. Also because statically typed functional programming was so far marred by lack of good learning material and bad tooling. That has changed. Now is the time to get back to start using scripting languages for scripting, and more sophisticated languages for building more sophisticated things, which rich front-end applications definitely are.
Many writings about programming that get popular are predicated on dynamic languages, and thus about coping with them rather than stretching the limits of what you can make the computer do. "Name your variables", "write comments", "use framework X over Y". These things stop being a worry once you let the compiler become your pair-programmer and tell it through types what you're trying to do, and it'll become your safety harness, and the types your tools of thought. Amazing stuff.
- luord 8y agoI don't understand your point, or maybe it's just the tone. You seem to be treating "static typing is better" as a fact of life that people working with dynamic languages eventually learn if they're "lucky". This is completely at odds with, well, reality: static vs dynamic has been going on for over sixty years, essentially since the first days of computer science. You fall in one camp, all the power to you, but it isn't better and doesn't make you "more lucky". They have their pros and cons and many a paper and book has been written comparing them.
- jasim 8y agoI should've been better with the tone. My view still holds. I know programmers who've written large swaths of Haskell and OCaml, who however reach for the eminently dynamic Racket for its metaprogramming. They know the relative strengths of each paradigm better than most of us and have fine judgement. However junior programmers (<10 years) who haven't spent the effort required to learn other paradigms and are religious about whatever language they chose to learn as an accident of history are missing out tremendously. Most of the static vs dynamic type research has always been about C++ based static types (which combines Simula-67's object system with Pascal's types - more history here: https://twitter.com/jasim_ab/status/991948718508130304 https://twitter.com/jasim_ab/status/991948718508130304) contrasted first against LISP and later with languages like Python, Ruby, and Javascript. Statically typed FP is totally different, and there are papers on either side of the bias to point to. I will recommend the Elm Language as a good starting point for anyone interested in seeing what Typed FP truly can be.
- seanmcdirmid 8y agoMost of the research in static types occurs in the FP community. Even most of the research about OO static types is not about C++, heck, you won’t find much research on C++’s type system at all. Java would dominate from the late 90s, before that it’s a box, but I’m sure there is much more research on even BETA (a language most people have never heard of) than C++. C++ has and always will be a pariah in the research community.
- jasim 8y agoHey Sean, thanks for chiming in. Do you think C++ isn't liked in academia because of any bias against languages that are more practical than formal, or anything in the language's nature itself?
- seanmcdirmid 8y agoC++ is just super hard in its design: it can’t be parsed easily, so for a long time custom compilers were impossible. It’s support for generics was based on was basically macro expansion, it’s multiple inheritance scheme was poorly thought out. It was just painful to do anything with it as a user of the language or an implementer. OOP people were never much of a formal crowd, and they had plenty of niche languages to base their research around (smalltalk, CLOS, Eiffel, BETA, ...). And when Java came along, acedemics breathed a sigh of relief: finally they could work on a “practical” language that wasn’t totally insane. And everyone else who really didn’t need to be using C++ in the first place has similar ideas.
- jasim 8y agoGot it, thanks!