3 ms·
Hello again, qwerty'. Thanks for stepping up on the JS issue :-) There are many good languages out there, "when used as directed". Alas, out here in the flyo
by Roboprog 10y ago
Hello again, qwerty'. Thanks for stepping up on the JS issue :-)
There are many good languages out there, "when used as directed". Alas, out here in the flyover country of Sacramento, there is really only demand for 3 kinds of jobs: Java, C#.NET (falling off), and some Javascript, ignoring the long tail of one-of-a-kind shops. Given those choices, I'll take the Javascript. Java 8 lambdas are clumsy to use to assemble much in the way of higher order functions.
I mean, cuz, who doesn't want to put this as a parameter into a function/method header:
(..., BiFunction<Map<String,Object>,Map<String,Object>,Map<String,Object>>, ...)
E.g. - for the sake of argument, say I needed a callback to merge two associative arrays. Oh, you needed a third input argument? Write your own interface type, so you can use it to declare the callback parameter.
No, I'll take the JS, thank you very much.
(as we discussed a month or two ago, Java is a [somewhat] new Business Oriented Language, and it's pretty Common)
- Roboprog 10y ago... and it's been ages since I did any TK (tcl/tk) :-)
- qwertyuiop924 10y agoI don't do much, but it's always pleasant when I do. But where I my manners? Hi Robo. :-). It's been a while. Actually, it's been so long that I only hazily remember the contents of our discussion.
- SlySherZ 10y agoI couldn't agree more with this. Just the fact that functions are a first class type in JS already makes it better than many other languages. Another thing that JS is great at is the flexibility it provides: objects are very general and you can do almost anything with them. Anyone would care to explain why does JS take so much hate?
- qwertyuiop924 10y agoI can handle that. First off, it gets a lot of (undeserved) hate from the Java-type people who think they know what OO is, but don't (because Java isn't OO, or so says Kay, and even if it is, there's a whole lot of rubbish mixed in. For that matter, I don't think JS qualifies either, by Kay's definition, but it's closer). These are the people who say things like, "How can it be OO if it doesn't have classes?" and, "where are my Refactoring tools?" or "Design Patterns!" and implement a bunch of java-esque "classes," and proceed to write IteratorStrategyFactoryManagerService (speaking of which, if you have any actual "classes" in JS with the word "Strategy" in the name, indicating they implement the GoF Strategy pattern, you should stop now. And feel bad about yourself. But that's another story). With ES6, we have "classes," so these people can stop complaining, but it's still bad, because they're actually syntactic surgar over prototypes, so you still need to understand prototypes (to say nothing of how "this" works, a genunine mess in JS, but a necessary one), but it's no longer obvious that that's what's happening, so you might think that you don't. The more significant complaints are about Javascript's famous weak typing (quick, what's []+""? What about ""+[]? And {}+[]?), ASI (which is why if you're returning an object/array, you can't put the openbrace or openbracket on the next line, and why semicolons only sometimes matter), and general quirkiness (the aforementioned this, and so on). These are actually legitimate reasons to dislike JS, but in my experience, they're not as severe issues as they're made out to be. If you really can't take it, though, TS or Flow can help you.
- Roboprog 10y agoOne of the main benefits of OOP is of course "polymorphism" (abstract base classes, interfaces), so naming any concrete class a "strategy" does seem a bit redundant. From what I have read by/about Kay, it sounds like his vision of OOP was very much about the actor (message queue) model, rather than (just?) a Simula 67 interface/protocol method table structure. As for the goofy "nonsense evaluation" in JS, it is a bit unfortunate, but I guess I must just write less nonsense than some others, as this doesn't seem to be a real problem for me :-) In fairness, the JS I write is client side, and it usually doesn't take very long to get to a state to test new code, as opposed to a long batch process.
- 10y ago
- quicknir 10y agohttp://softwareengineering.stackexchange.com/questions/221615/why-do-dynamic-languages-make-it-more-difficult-to-maintain-large-codebases http://softwareengineering.stackexchange.com/questions/22161... The answer doesn't really end up being static vs dynamic, but rather how dynamic languages often lack the other facilities that make programming in the large easier, and Eric Lippert uses js as an example. Companies with a lot of money at stake have spent a lot of money and effort on things that transpile to js. The people making these decisions are almost always quite smart and very practical. They don't care if first class functions are sexy. They just want to write high quality code quickly. If they've spent so much time wrapping it up, you know it's because they had serious issues being productive at scale with js. They, and people on their team, probably got extremely frustrated along the way. Hence the hate.
- qwertyuiop924 10y agoSooo... people don't like JS because 1) it's dynamically typed, and 2) they don't like JS? >They don't care if first class functions are sexy. It's not about being sexy (and believe me: first class functions aren't): it's about getting a very useful feature right, something many languages seem to have trouble with, despite the fact that Lisp (and ALGOL, IIRC) got it right in the 50s.
- Roboprog 10y agoAlgol (1960s) had no garbage collection (that I know of), so any "closure-like" data captured by a function/procedure reference had to still be on the call stack. Otherwise, you certainly had first class functions, just not always with any external state captured. https://en.wikipedia.org/wiki/Man_or_boy_test https://en.wikipedia.org/wiki/Man_or_boy_test I suspect TurboPascal was in the "boy" camp, in that a reference to a function (or procedure) would not have any external state bound to it.
- qwertyuiop924 10y agoAh. I don't know all that much about ALGOL. Dijkstra said it was great, but I don't trust his opinion.