Hacker News new | past | comments | ask | show | jobs | submit login

> We're all writing let instead of var now, and a book that continues to write var is starting to look a bit out of touch

Serious question: Does this also refer to client side web developers? According to caniuse.com, only around 83% of web browsers support the let statement, which in most cases wouldn't cut it when releasing a web site or web app to accommodate the largest audience.




Yes, you can transpile ES6+ to ES5 for client-side applications using Babel.


True, but admittedly, I'm so fond of the ability to have no "middlemen" between the code I write and what gets run by the browser that my dislike for any logistics/bureaucracy overhead is stronger than my attraction to ES6+ (or CoffeesScript for that matter). I know it might sound a bit irrational (I'd much rather code in C++ than code in assembly), but I think one of the perks of writing in JavaScript was that I got to have a high level language directly run by a system and now I don't want to give it up. I prefer to wait until the percentage of browsers that support ES6+ goes up.


In that case, use var. There is no production ready polyfill for let. I'd recommend editing your original question and putting your requirement of not using any buildtools or transpillation in, because it's the salient factor here and for most questions you'd ask regarding JS.

>but I think one of the perks of writing in JavaScript was that I got to have a high level language directly run by a system and now I don't want to give it up.

Out of curiosity, what do you see you're giving up? Is it the theoretical knowledge that the code exactly as written is being interpreted? I find that the compiled code is very human readable nowadays, and with sourcemaps it's not an issue at all as browser dev tools will directly link to the source files instead of the compiled files. I used to think I was giving up something until I worked with such a setup.


sorry, missed your reply (so perhaps you won't see this for the same reasons) but anyway:

Mainly the feeling of giving up simplicity. Adding things (such as sourcemaps and any relevant configuration changes) usually detracts from the sense of "no middleman", although I know "no middleman" is always an illusion, it's less obvious when you don't have to do anything to create it.


Not only can you, everyone who uses it does :)




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: