5 ms·
I fully remember picking up coffeescript because Dropbox had used it. I only ever used it on one project. I try and remember that every time I have the urge to
by CapriciousCptl 6y ago
I fully remember picking up coffeescript because Dropbox had used it. I only ever used it on one project. I try and remember that every time I have the urge to go with Reason, Elm or even wasm compiling things. Long live JS.
- melling 6y agoDoes any alternative have any traction? ReasonML is used by Facebook. Elm used to get more attention on HN.
- wbc 6y agoReason looks pretty cool but I'm weary given the outcome of flow
- rashkov 6y agoReasonml claims, as an explicit goal, to output very readable and modern JavaScript, so it shouldn’t be such a risk. That task is a work in progress, but even looking at the latest recent release you can see that it’s coming along nicely.
- city41 6y agoSince wasm has native browser support it doesn’t really feels like it fits into this group. I have a feeling in a few years wasm will be pretty common.
- julianeon 6y agoYeah, wasm is offering something those others aren't. You could say that Coffeescript to Typescript is a lateral move. Try as you might, you can't do the things wasm is best for - say, graphics - in Coffeescript.
- Roboprog 6y agoIf you are trying to build for a business, or something you yourself will have to maintain for years to come, vanilla JS seems like the way to go. Perhaps Typescript isn’t a fad to be abandoned, unlike say GWT, CoffeeScript, et al, but why risk it? Javascript doesn’t feel painful to me like Java does. I don’t have a lot of problems with it that need solving with an alternate front end. Long live JS!
- Roboprog 6y agoOnce you stop making hundreds of classes with globally visible names and members, and start using function scope, functional programming, and mostly short lived value objects, much of the OOP induced pain of programming simply goes away. Alas, this requires training of the road not taken.
- karatestomp 6y agoAFAIK TS is pretty committed (at the expense of possibly-useful functionality) to being very, very simple to strip out, leaving vanilla JS in its wake. Unless you're minifying, the compiler output typically looks almost exactly like the well-formatted, sane, and readable JS you'd have written instead. That escape hatch is part of why I've not worried a bit about taking it up. Turning a TS project into a JS project, should you ever need to, is functionality that's essentially built-in, and you do it every time you run "tsc".
- dgoldstein0 6y agoYep, you can turn it into modern JS with something like `tsc --module ESNext --target ESNext`. Part of our pain migrating off Coffeescript was that the compiler converted to ES3, not ES6. Which was fine for the browser, but not great for codebase quality.
- Roboprog 6y agoBut I don’t write “classes”, and don’t want to be lead down that path. Allegedly TS has a solution for doing partial function application or currying, such as in the Ramda.js library, but the example that was provided to me a few weeks ago looked every bit as clumsy as the angle bracket stew in Java 8. I don’t remember the details, other than “I hope I never have to read that.” PFA is like dependency injection for functions, without needing all the “executioner” class trapping nonsense, and with higher order function composition replacing much of the need for subclasses. I guess deep down in my heart, I know that Typescript is coming to crush any joy out of working with JS. The industry of enterprise design patterns will demand it. Some of you will understand this, but most will probably just hate on the unenlightened developer who must simply be resisting The Future. A “future” inspired by Simula67, with beans replacing copy books, and IoC provided singletons replacing individual .COB programs. Meh. P.S. nothing personal. I’m simply terrified of the perception that TS is an unequivocal boon to programming-kind. It’s not, for all of us.
- fyp 6y agoI don't know the details but I heard the original codebase was javascript but they used an automated script to convert it to coffeescript as an hack week project! That's some serious long term damage they did in that one week. Edit: Found the 2012 post, pretty useful for doing a postmortem https://dropbox.tech/application/dropbox-dives-into-coffeescript https://dropbox.tech/application/dropbox-dives-into-coffeesc...
- city41 6y agoI wonder if Dropbox devs would say CoffeeSctipt was a net negative. The authors mentioned how it made supporting IE11 easier for example.
- arkanciscan 6y agoThe devs that did it probably quit immediately after and started a consulting company where they advised all their clients on how to convert to coffeescript too
- dgoldstein0 6y agoI don't view it so black and white. While certainly parts of how we ended up using coffeescript weren't great and ended up causing lots of problems, in 2012 it looked like a net win - we got a bunch of new language features several years before they were actually standardized in any form. It wasn't until 2015 that es6 came around, and we saw how things could be better; and typescript didn't have much momentum until 2015 either. Without a crystal ball, it'd have been very hard to predict this shift.