4 ms·
Javascript is becoming the next c++, what a mess. I can now write a function in about 10 different ways.. In all their efforts to fix it, it only becomes worse.
by messit 8y ago
Javascript is becoming the next c++, what a mess. I can now write a function in about 10 different ways.. In all their efforts to fix it, it only becomes worse. Loads of fancy new features (mostly copied from Coffeescript), but the basic type system is still not fixed!
I miss the simplicity, readability and power of Coffeescript. -> function without context binding, => function with binding. That's it! does?.this?.prop?.exist, nope still not possible in JS. Ah well, the community hates CS and loves all the amazing new features of ES+. Until you look at a random codebase out there of some outstanding JS dev's utilising all the latest features. One big mess of conflicting strategies, unreadable code, poorly documented, bloated, etc.. etc.. But hey, we're using promises, reducers and spread operators everywhere, we're super smart!
When will the JS community start improving on the quality of the code instead of adding new language features, tooling, frameworks and so on? Try to think of better names for your identifiers to start with, using an intuitive naming system throughout a large codebase so it becomes actually readable. No, will not happen, too boring I guess.
I'm writing Typescript now to pay the bills. Adding even more complexity, it scales so well, mainly because you can use the 'any' type. Said enough?
- andrewmcwatters 8y agoHonestly, I think the only thing that sticks out to me is that JavaScript treats addition and catenation as the same thing, and, humbly, I don't think they are. Maybe some folks here more intimately familiar with good type handling can give their two cents. But, I've enjoyed dynamic typing in languages where values had types and variables didn't, and because there wasn't any consolidation of addition and catenation, everything was fine. Also type coercion seems to be a pain point in JavaScript for some, whereas explicit type conversion through function calls in other languages seems to remove these issues, in my experience. And TypeScript seems to bring a lot of powerful concepts to developers who enjoy the benefits of strict typing, which is great. But, languages that continually expand their grammar complexity and usage conventions feel harder to master to me. Now and again I come back to Lua's reference manual and learn something new that I don't see other developers in that space recognize, and that's the simplest practical scripting language I know. It's complex syntax in Backus-Naur form is one section of the reference manual. ECMAScript literally has multiple chapters to explain its grammar. I just don't understand how you can truly master that. At least, you certainly would not know all of the edge cases with the language.
- combatentropy 8y ago> type coercion seems to be a pain point Yeah: Boolean("0"); // true I believe type coercian should pass through the types from simplest to most complex. false; // boolean, the simplest data type Number(false); // 0, number String(Number(false)); // "0", string, so Boolean("0") should have been false