15 ms·
The JavaScript ecosystem is delightfully weird
- ElfinTrousers 4y agoThat would be a polite way to put it yes.
- breckenedge 4y agoSo JS is delightful because we are still not actually writing JS, but stuff that looks like JS? Huh.
- krapp 4y agoIt's weird how JS is the only ecosystem entirely designed around the premise of avoiding direct contact with the language you're developing in at all costs. Like, even C programmers are willing to actually write C.
- spicebox 4y agoRust has a far more powerful and widely used macro system then JS but I don’t think that means rust devs are trying to avoid writing rust at all costs
- WorldMaker 4y agoThe C macro language is technically a different language (though today they are specified together, they originated once as different compiler tools) than C and lot of DSLs get written in it because C programmers are trying to avoid actually writing C. There's also a lot of C programmers that prefer to use C++ compilers in C++ mode for their C code to avoid direct contact with C specification bugs or some C standard libraries. (Plus, early C itself was designed to avoid direct contact with Assembly languages which was designed to avoid direct contact with Machine languages some of which were designed to avoid direct contact with Microcode languages most of which were designed to avoid direct contact with TTL logic and TTL logic was designed to avoid direct contact with the useful properties of transistors for computation and so forth. Programming is turtles all the way down.) (Also there are quibbles to be made about "at all costs". JSX is still a superset of JS syntax with a little bit extra added in. Typescript is built to be a superset of JS syntax. You can't write either without a lot of direct contact with JS. Neither seems like "at all costs" avoidance to me.)
- zaphar 4y agoThat is not what the author said. They said the JS Ecosystem was delightful. He then goes on to describe that Ecosystem. For some people that ecosystem is indeed delightful. They love the sheer complexity it takes to deploy a JS application these days. There is certainly a lot of choice and power out there for it. I personally am the kind of person who tries to ship my stuff as a single statically linked binary that I can just drop in place so I look as WebAssembly as a way to participate in the browser ecosystem while avoiding the whole NPM/JS Tower of development tooling complexity. I don't begrudge others from wanting to play there though.
- VyseofArcadia 4y agoI wonder how much of this can be blamed on JS being a relatively gentle and forgiving codegen target.
- ElfinTrousers 4y agoI suspect that if some accidents of history hadn't left JS as the only language you can use to script a Web browser, it would have died off long ago.
- VyseofArcadia 4y agoI've been wondering about that lately. What is the rationale for making it necessary to run WASM binaries through JavaScript? Seems like a missed opportunity to not be able to just point a script element at a WASM blob, but I'm sure I'm overlooking something.
- dunham 4y agoWhen I last looked, it seemed like WASM blobs just take arrays of numbers and return arrays of numbers. No objects, strings, or DOM elements, so I think it'd be tough to do web dev in wasm as it stands. And you need javascript glue if you want anything in the way of side effects. There is, however, quite a bit you can do in it. TeX has been compiled to wasm[1], it's about 600kb uncompressed 90k compressed (the memory image with latex loaded is about 6MB compressed though - latex is a beast). I think anything computationally intensive would be a good candidate for wasm (it has int64). 1: https://github.com/kisonecat/web2js https://github.com/kisonecat/web2js
- VyseofArcadia 4y agoRight, yes, that's how WASM is now, but what I'm asking is why didn't we give WASM access to the DOM? We could have, and we just didn't.
- dunham 4y ago
- weeksie 4y agoJavascript is this generation's C++. It's a massive language and the only way to stay sane on a project is to agree to use a well demarcated subset of it. Nothing wrong with being C++. The reason JS is so massive and weird is because it's the language that everybody uses, or has to use at some point. Upsides and downsides.
- miohtama 4y agoJavaScript, The Good Parts by Douglas Crockford symbolises this well today https://www.reddit.com/r/ProgrammerHumor/comments/621qrt/javascript_the_good_parts/ https://www.reddit.com/r/ProgrammerHumor/comments/621qrt/jav...
- pcthrowaway 4y agoJavascript, The Good Parts, is not really relevant to today's Javascript, unless it's been refreshed. I remember working through it 10+ years ago: * `var` is no longer a thing. * Even `let` is less common now. * Using closures and prototypes to enable functions to be used like classes and have private variables and static variables, have been replaced with proper classes Nowadays if you want to use the good parts of Javascript, just install eslint with insane defaults and let it tell you if you're trying to use the non-good parts
- andirk 4y agoIt's mostly outdated now, thank goodness, but anyone born after 1990 should read it cover to cover to appreciate the current state of JS and why we got here. hasOwnProperty?? Lol Looking at the book now, I still like some sections like "Curry" and "Memoization".
- tdba 4y ago>just install eslint with insane defaults where do I find these insane defaults?
- pcthrowaway 4y ago
- junon 4y agoCoffeescript was well before "tree shaking" (the JS ecosystem's way of spelling "dead code removal") and code splitting, both being relatively new things in the bundler world ("tree shaking" being introduced with rollup if memory serves). Then came Acorn, which gave way to a whole slew of JS transformation bits. It also didn't help that Node was fixed at 0.12 for years and years, and we had the IO.js fork until Node was released by Joyent for OSS community members to take over. That caused more issues to boot. Also the whole bundling fiasco started with Babel, which wasn't a bundler at all and instead started as a means to provide polyfills for supporting "old browsers" (really, IE). From that whole thing came the concept of "evergreen browsers" which is a term that has largely fallen out of the common vocabulary with the rise of Edge. Now we have "anything is a valid feature request" TC-39, and "it's really just Google at this point" browsers dictating how the web works. It's a nightmare. As a maintainer of several large JS packages, and being so dreadfully burnt out on JS, there are other words I'd use to describe the whole thing than "delightful".
- chrismorgan 4y ago> "tree shaking" (the JS ecosystem's way of spelling "dead code removal") I’m not altogether against giving it a different name. It’s very limited compared to what proper ahead-of-time compilers manage. I’d really like to see some actual effort put into partial evaluation and symbolic-execution-guided code simplification and dead code removal. Google tried something a little like it in Closure Compiler’s advanced optimisations mode, many years ago, but hasn’t really kept it up; and Facebook tried some five years ago with Prepack, but quickly gave up on it for unclear reasons.
- rektide 4y agoQwik is interesting here, very just-in-time with running JS on the client side. https://qwik.builder.io/docs/concepts/resumable/ https://qwik.builder.io/docs/concepts/resumable/
- ricardobeat 4y agoQwik is basically more granular code splitting combined with a smart loader. We were already doing this ten years ago, just manually without a compiler.
- simultsop 4y agoI find this like saying you are actually writing binary code, what you code is not any language at all.
- theknocker 4y ago[dead]
- chrismorgan 4y ago> deliberately misuses the JavaScript label syntax Eh, deliberately repurposes. I don’t think “misuses” is the right word at all. > abuse of the bundler This also feels too strong a wording—though the fact that these are at least .js files (unlike .svelte files in the other case) makes the term “abuse” less unreasonable.
- ghusto 4y ago> Nobody Writes JavaScript Any More This is how "delightful" it is, and is the reason I'm waiting for it to die. Every couple of years we decide on the 'no no, definitely this time we have it all figured out, trust us, just use X' "solution" to the problem of JavaScript. We have the definative 'this is how you do it', until the next one.
- mathgladiator 4y ago> I'm waiting for it to die I'm there with ya, but I wouldn't hold your breath. I'm trying to minimize my JavaScript exposure by using streaming, and it's going well enough with a minimal JavaScript "runtime". However, I still find myself with thorny edge cases like "I need a better date/time picker", "color picker", or a drag and drop calendar planner. I find myself frustrated with the ecosystem, and I'm debating how large the set of exceptions are to my ideology.
- superchroma 4y agoThis. It fucking sucks. I just waded back into it and I hate everything about it. VSCode barely copes, Visual Studio doesn't even try and Rider was the only thing that worked which hasn't helped my mood.
- danielvaughn 4y agoI don't know enough about WASM to know why it can't be exposed directly to the DOM, since in theory the DOM should be a language-agnostic interface. If that were to happen, I think the floodgates would really open on WASM and we'd finally start to see JS die.
- rafark 4y agoExactly what I thought a few months ago. The DOM and the HTTP api (or pretty much all browser APIs for that matter) should be interfaces that can be implemented in WASM code. I have no idea why this hasn’t been proposed let alone implemented. I mean, why give us the ability to use other languages if we can’t implement the (browser) APIs?
- deleted 4y ago[deleted]
- dgreensp 4y agoI stopped reading after the typo “JavasScript” and then the juvenile tone of “Less that 10 years ago, JavaScript sucked bad.” I have a positive impression of fly.io overall, I mean they admitted they are still figuring out how to build tech at the level of their ambition and have it be reliable enough, but I might like to be a customer one day.
- recursive 4y ago> the typo “JavasScript” You may be interested to know TC39 makes the same "typo" at https://tc39.es/ https://tc39.es/ right in the biggest header on the page. > Specifying JavaScript. Hm, maybe it's not a typo?
- toastal 4y agoThe JS ecosystem also relies on npm, which is owned by Microsoft. Having a corporation control package management is pretty weird.
- wetpaws 4y agoSomething something pnpm, yarn, jfrog
- earthboundkid 4y agoWell, now that Microsoft has embraced and extended open source, I think it's time for us all to let our guards down, because it's not like they have some kind of "third step" to their business plans.
- davely 4y agoI am a product of a coding bootcamp from awhile back, so JavaScript is really the only thing I’ve ever known in my career (outside of writing some apps in Visual Basic around 2001). Maybe it’s because it’s the only thing I’ve ever known, but… I like it? I guess if I hack around on a side project and want to use vanilla JS, it’s the Wild West and there’s no rhyme or reason for anything (and everything looks gross). But working inside various frameworks have been pretty enjoyable for me. Side note: there’s also this hilarious video about the… delightful nature of JavaScript from 2012: https://www.destroyallsoftware.com/talks/wat https://www.destroyallsoftware.com/talks/wat
- qbasic_forever 4y agoJS itself is perfectly fine and quite a nice language when you stick to all its modern idioms that you learned and use today. I think what rankles a lot of people is going through the history of JS when it was terrible and confusing, then basically just jQuery, then the explosion and confusion of server side/node and drama with the company behind it, and finally confusion and drama with moving to modern ES modules. For the longest time doing the most simple thing in any programming language, putting code in a separate file and loading it to execute, was nearly impossible in JS and required learning and picking sides in an opinionated loader battle. It was confusing and pretty bad for newcomers. Nowadays all that drama is settled and the core of modern JS is quite nice. I like it more than python to be honest.
- treis 4y agoThe problem with JS these days is not that what's there is bad. It's that there's not much there. Anything beyond the basics requires you to roll your own or go hunt for a library.
- qbasic_forever 4y agoVery true, it's why I really like deno for server side since it's trying to plug that gap with a nice out of the box standard library. Client side it does feel like something like lodash is the new jQuery and just mandatory to use everywhere.
- rglover 4y ago> The mind bending parts of this presentation are where he first utilizes use server to implement a client side form action, and then later launches a client side alert from the server using use client. And he closes by saying that this requires new generation routers and new generation bundlers. No, it just requires a basic websockets implementation and a normal HTTP server. If anyone else like me loves JavaScript but thinks the above line of thinking is bananas, join me on the lifeboat [1]. [1] https://github.com/cheatcode/joystick https://github.com/cheatcode/joystick
- vmfunction 4y agoHmm, it's a shame that Little Javascripter is not mentioned: https://www.crockford.com/little.html https://www.crockford.com/little.html That is really the only positive reason to use JS.
- deleted 4y ago[deleted]
- jsdeveloper 4y agoSo what was weird exactly? react is not JS. nextjs is not js..... same way spring boot is not java. JS is the way it is. Most of it complainants has issues as they usually come from synchronose language and when JS (its true power) uses its async nature, they can't comprehend it and think its weird, why would it do so. If your rational is that its slow, you should probably use assembly to write the most optimal code. If you want a high level language then JS brings most paradigm than competing languages. If you argue to want all features high level, low level and speed go for C++.
- techaqua 4y ago> nextjs is not js..... same way spring boot is not java does spring boot bring it's own dsl and compiler?
- ElectricalUnion 4y agoKinda, as usual within Javaland, there's a lot of reflection involved into making annotated interfaces (a kinda of standard Java reasonably limited dsl capabilities) pop up as singletrons connecting to your database/OLAP/LDAP/REST-endpoints/websocket-clients/whatever. Same thing for serialization things, you define interfaces, the actual classes often just pop into existence by generated bytecode. It's also not unknown to bring JSP/EL (literally requires a Java Compiler embedded in your server to compile servlet objects for you on the fly) or some other, on purpose less fully featured template things with their own DSLs like Thymeleaf to do the same job.
- pier25 4y agoI must be the only person left not writing TS at this point. Once EcmaScript adopts optional static types or some kind of standardized type annotations [1] I will probably use those. At least in Node, where I have more control of the runtime version. [1] https://github.com/tc39/proposal-type-annotations https://github.com/tc39/proposal-type-annotations
- Wazako 4y agotyping saves so much time. Especially since the flexibility of its optionality does not restrict, and allows for really nice autocompletions. Especially with esbuild which has made this simple and fast, one could even say it has saved javascript.
- pier25 4y agoI have ample experience with typed languages like C++, C#, Java, Kotlin, Go, AS3, Swift, etc. Maybe I just have exceptional memory but I rarely encounter a problem that would have been solved by using TS.
- Scarbutt 4y agoIt's about big codebases and team use, not about you.
- yamtaddle 4y agoYep, they're a communication and documentation tool that happens to have pretty-good machine readability and correctness-checkability. Sometimes the person you're communicating with is your future self, is all. Sometimes it's just yourself five minutes from now, even.
- toastercat 4y agoThey didn't mention big codebases or working on a team, though. Also, you can just use JSDoc.
- 4y ago
- artyom 4y agoI moved away from JavaScript because of the same reason I moved away from PHP. An originally decent idea gone terribly wrong.
- reidjs 4y agoHow do you build web applications?
- artyom 4y agoI don't. I build backend services now. But to be fair, I still maintain a relatively popular Chrome extension in old-school JS and that's still a pleasure to work with.
- sodapopcan 4y agoThere are plenty of ways these days to build rich web applications without writing much JS. LiveView, Hotwire, Reactor, LiveWire, Blazor...
- artyom 4y agoNot really against JS as a language, everything against the current state of its ecosystem
- sodapopcan 4y agoNot sure I fully follow where your response is aiming but if I understand correctly, I don't hate JS but I don't like using it for business logic. I feel these frameworks (I use LiveView) let me use JS what it's good for: a DSL for complex DOM manipulation. Everything else, including simple DOM mutations, is handled by LiveView and I can write business logic in a nicer language.
- isanjay 4y agoIMHO JavaScript is neither a good OOP language not a good Functional language.
- qazxcvbnm 4y agoMany other comments have touched upon other unusual aspects of the Javascript ecosystem, but there's another major aspect in the ecosystem at quite a precarious position, yet of which, I see very little discussion on, namely, the debugger. Chrome DevTools is the de facto debugger of Javascript, which becomes apparent once I have to take advantage of Javascript's capability of moving beyond the browser, on alternate runtimes. To debug node.js for the server and Hermes for my apps, in both cases I need to use the Chrome DevTools debugger which uses the Chrome Debugger Protocol. In the case of Hermes, the Chrome DevTools that comes with React Native doesn't even come from your local copy of Devtools, but is dynamically loaded from https://chrome-devtools-frontend.appspot.com/ https://chrome-devtools-frontend.appspot.com/. As far as being a protocol goes, I have yet to see another viable implementation of a Javascript debugger. To profile my performance or check my memory usage, I need to use Chrome. Even worse, both node.js and Hermes have strange issues pop up with the debugger connected. In the case of Hermes, it is acknowledged that the Javascript runtime is not fully compatible with Chrome DevTools Protocol, whereas node.js occasionally exhibits segmentation faults with the debugger connected, or falls into non-terminating computation when connected to certain complicated programs (such as npm...) It worries me greatly that to debug my code, not only must I have Chrome installed, but I must be connected to Internet and trust that some particular domain, controlled by presumably Google, maintains it. I struggle to understand why no alternative debugger for arguably the world's most popular language exists, or at least a local, independent copy of the debugger that is untethered to the whims and desires of an entity as trustworthy as Google. I guess I'll be having to whip up at least the latter option (which seems feasible enough, if a little tedious; with ungoogled versions of Chromium available by some kind souls as a starting point) when have a bit more spare time, to keep my sanity checked.
- ntonozzi 4y agoWebStorm and VSCode both have OK debuggers, but in my experience they are even more finicky than the Chrome one, which as you noted does have issues. Firefox and Safari are likewise fine, but not as good as Chrome. More importantly though, if you are that distrustful of Chrome, you probably should not be using Node because it is based on v8, the Chrome Javascript runtime.
- fulafel 4y agoGood article. There's of course editorial decisions about what to mention but still the in the Nobody part the JS-as-compile-target coverage seems a bit selective. There's of course ClojureScript, Elm, Scala.js, ReScript and TypeScript (the latter is mentioned in passing).
- harha_ 4y agoI can't help but cringe when looking at the dependency count when using some javascript framework to write client-side code. I think the frameworks and the ecosystem is overly complex and the same could be accomplished by embracing minimalism. I do like things such as babel and webpack though, but those are dev-dependencies which is unrelated to the contents of the final bundle and I can live with few dev dependencies. For my last project I wrote just plain old javascript without any frameworks, but I did use dev dependencies such as the ones I mentioned above. It was a breeze to implement things, but I do understand that the benefits of frameworks like React become clear in larger more complex projects. So all in all I don't really know what should I think about the current state of the ecosystem, nor am I really on the edge of the wave of progress, but the kind of feelings I often get is in the lines of 'is this dependency x really needed here? what does it do? oh it does this small little thing, why is it here??'...
- ipaddr 4y agoWish we had something simple like jQuery
- Etheryte 4y agoI mean you can still use jQuery, no one's stopping you. They're still releasing new versions with updates, the last one came out two months ago if I'm not mistaken.
- ilrwbwrkhv 4y agoJust use mithril
- potta_coffee 4y agoVanilla Javascript is comfortable. I think I've pretty much given up on the JS ecosystem. I've been going back to web frameworks like Django / Rails / Laravel. Obviously not the solution for all things but most projects really don't need to be SPAs.
- ilyt 4y agoI wouldn't call it delightful, I'd call it diaherra
- psnehanshu 4y agoSounds like you haven't worked on a production javascript project yet.
- AlchemistCamp 4y ago> Less that 10 years ago, JavaScript sucked bad. It had no imports, no classes, no async, no arrow functions No classes in JS was much better than with. As someone who used and contributed to CoffeeScript, I was initially excited by them but in retrospect, they've been a huge negative IMO. Douglas Crockford saw it immediately: https://www.youtube.com/watch?v=PSGEjv3Tqo0&t=300s https://www.youtube.com/watch?v=PSGEjv3Tqo0&t=300s
- moron4hire 4y agoI'm so sick of these paradigm religious wars. There's nothing wrong with object oriented programming. There's nothing wrong with functional, either. You use them for different purposes. These people like Crockford who talk about "Java programmers are stuck in this inferior way" are the ones who are stuck and not all that educated on programming.
- AlchemistCamp 4y agoThere's also a lot to be said for having fewer footguns. One reason I liked CoffeeScript is that it actually removed JS footguns such as "with", ==, etc. I'd rather either Clojure or Java to using Scala and having all the possible complexity and interactions between paradigms it makes possible. Sometimes less is more.
- suzzer99 4y agoWait until you have to maintain someone else's overly crufty, inheritance-based JS framework.
- moron4hire 4y agoThere's nothing wrong with inheritance, even in JavaScript.
- lobstrosity420 4y agoThey weren’t criticizing OOP per se. Before the class keyword, JavaScript had much more powerful OOP semantics using metaobjects.
- schnable 4y agoWell, that's one way to put it.
- toastercat 4y agoI started writing a small static site generator for myself using JavaScript and QuickJS by Fabrice Bellard[1]. QuickJS is not quite complete, and there are some cross-platform inconsistencies, but overall I found it pleasant to use and its libc wrappers to be powerful enough. I also found that JavaScript is actually pleasant to use when I'm not using classes, or dealing with metaprogramming/Babel, or implicit globals. Dependencies are just pure .js files I keep in a /lib directory and import. I still think JS is a nice language although I tend to side with Crockford (before he started promoting the "next" language) in that JS has some good parts, and you can write clean and powerful software with it if you ignore most of its warts (even if you're using Node). My best advice is be very careful with what dependencies you choose; and also, don't feel pressured to be at the bleeding edge all the time. The Node/React world is a constant hype machine that flip-flops on best practices every 6 months. Be very skeptical of them, and don't let them spoil JS for you. [1] https://bellard.org/quickjs/ https://bellard.org/quickjs/
- synergy20 4y agowhat's the use case for quickjs? can it be used for a light-weight runtime for JS on resource restricted embedded devices? by the way, comparing to angular and vue2-vue3, react is actually the one without python2-python3-alike breakages over the years to me, I would say it's the best out of the 3 options(angular,vue,react) so far, which could explain by market share that it remains to be dominant.
- schemescape 4y agoNot OP, but I experimented with QuickJS for my SSG and, on my super slow laptop, it started up about 200ms faster than Deno, but ran about 5 times slower overall (and the binary was much, much smaller). My original motivations were: Deno doesn’t support Raspberry Pi and I was running lots of short-lived processes to support incremental rebuilds using a Makefile. In the end, my requirements changed, so I’m not using QuickJS, but it was very easy to pick up and use. So: portability, startup time, and small code size seem to be the advantages of QuickJS.
- toastercat 4y ago
- naikrovek 4y agonot sure I'd call it "delightful" in any way, but it certainly is weird.
- FpUser 4y ago>"Nobody Writes JavaScript Any More" I code single page apps that talk to business backends using JSON based RPC. All in plain JavaScript with some domain specific libs when needed. No problems so far.
- mattgreenrocks 4y agoI've avoided JS/TS almost entirely, and shown contempt toward it a bunch in the past. I'm now at a place where TS seems like a reasonable language for prototyping backend stuff: JS has a GC, big package ecosystem, sum types, static typing, good tooling support. Only thing that ticks most of those boxes (IMO) is Kotlin. Anyone been down this road before (skeptic->using in prod)?
- hot_gril 4y agoI used to avoid JS then tried it for backend stuff, finding it actually the easiest way to do web backends. Most off-putting thing was the "callback/promise hell" erroneously recommended in tutorials until I realized you're actually supposed to use async-await. Then React Native instantly converted me from the horrible native iPhone dev, then got me into React (web). So I'll do new app projects fully in JS. I also gave TS a serious try and found it pointless. Complicated the toolchain, made default stuff like the Node profiler not work anymore, and wasted tons of time on defining types that didn't actually catch any mistakes. Went back to JS. Turns out part of its strength comes from not caring. Before that had used Java, Scala, C, C++, Erlang, Python, Swift, ObjC, Rust, PHP, and a little Golang.
- yamtaddle 4y ago> Most off-putting thing was the "callback/promise hell" erroneously recommended in tutorials until I realized you're actually supposed to use async-await Async/await's pretty new, is probably why you're seeing so many tutorials that don't use it.
- philsnow 4y agoI appreciate the summary of the changes in the javascript ecosystem over the last decade+; all of that happened after I had kids and I didn't have the motivation to keep up with it, so it's a complete blur in my mind. I've tried at various times to get caught up, but it seems that every time I find articles / blogs that talk about How Things Are Done at the time they're written, with only the briefest nod to how it's better than The Old Busted Way (probably because the authors, being steeped in and surrounded by javascript for years, think that their readers will also be similarly up to speed). Meanwhile, I feel like a historian in the year 5000, reading recipes from 2023 and wondering whether people used dog milk or cat milk (because those were the two kinds of mammals that most households had available). Does anybody know of other resources that go into more depth on the evolution (and specifically the Whys) of the javascript ecosystem?
- yCombLinks 4y ago"Modern Javascript for the Impatient" does a good job for the language itself. It doesn't try building on non-existent prior knowledge. It assumes you program, but in other languages.
- crooked-v 4y agoWeird? Absolutely. Delightful? Try managing a monorepo with internal dependencies and multiple target platforms and you will immediately and firmly say 'no'.
- karaterobot 4y agoI like javascript, but I always think about the time when I was working as a front end developer, and a guy across the room suddenly stood up, walked over to the white board, and wrote "F*CK JAVASCRIPT" in massive letters. I believe his concern was around the lack of type safety (this was before we used Typescript). And this was someone not prone to dramatic gestures. At the time I laughed. Guy must be having a bad day. Javascript rules, look at this widget I made. Cut to a few years later. I am fed up with React, and the entire javascript ecosystem in general. The trend-based, article-driven development, the new framework/pattern you have to learn/unlearn every six months, the SPAS that made a simple web app spool up the user's laptop fan with all the javascript it was processing just to do basic stuff we could do much more simply in the 90s. I ultimately quit being a developer in 2019, switched to doing design full time. I still write javascript for personal projects, because it's the thing I'm most familiar with. But, only vanilla javascript. Javascript rules, but also: f*ck javascript.
- leptons 4y ago> a guy across the room suddenly stood up, walked over to the white board, and wrote "F*CK JAVASCRIPT" in massive letters >Guy must be having a bad day. He was having a bad day because he was doing stupid things with the code he wrote that led to problems. I've never had a problem with Javascript's type system, or having the wrong type show up where it shouldn't. I accepted the dynamic nature of JS long ago when it first came out in Netscape, and I adjusted my coding style accordingly. And Javascript types are not a mystery, type coercion is fairly simple and doesn't produce unexpected results if you actually understand the language. If you don't understand the language (or any programming language), then writing things like "F*CK JAVASCRIPT" in massive letters on a whiteboard is something that might happen.
- tstrimple 4y ago> I've never had a problem with Javascript's type system, or having the wrong type show up where it shouldn't. I accepted the dynamic nature of JS long ago when it first came out in Netscape, and I adjusted my coding style accordingly Different languages have their own strengths and weaknesses as well as generally accepted coding practices and sometimes different paradigms. I find the folks who struggle the most are trying to write JS as if they are still a C# or Java developer so they constantly run into square peg round hole issues and blame it on the tool. I love JavaScript. I also love C#. But you've got to approach how you solve problems with them differently. How you write long term maintainable code in both is different.
- boucher 4y agoI think there's a small but growing group of people in the JS ecosystem that are beginning to explore a more "platform native" approach to front-end development, which removes the need for bundlers and transpilers and embraces the fairly capable feature set of most modern browsers. As the OP points out, a lot of what happens now is an artifact of the history of how these things have developed, and about which things were prioritized over the years. Many of these choices made sense at the time but may no longer be necessary, and some things were definitely lost in the process. When we were developing Cappuccino, which includes its own transpiled to JS language (possibly the first such general purpose language), one of our important goals was making sure the compiler could run in the browser itself so no external build tools were needed; everything worked just dragging index.html in the browser and writing code in <script> tags if you wanted. Security changes in how browsers handle file: URLs made this harder to do, but anything that simplifies the process of actually running code is very welcome.
- koito17 4y ago> When a bundler/transpiler encounters an import statement, they don't necessarily presume that the file being imported is JavaScript or even any of the variants mentioned above. If configured properly and you want to import a CSS or PNG file, it will happily do so for you. This is what I like to nickname "WebpackJS". Code that is simply invalid JavaScript and requires a carefully configured composition of webpack plugins in order to be used. I occasionally run into npm packages wanting to "import" a CSS file when I use them from ClojureScript, and it's always a pain. The good news is that these ar rare encounters, but it's still behavior enabled by people assuming you're using the exact same framework as them with the exact same Webpack configuration made by said framework.
- iLemming 4y agoOh I hate that shit. It feels so broken. Someone creates "a library" in CRA or webpack, and then you can't just import it in your project easily.
- apatheticonion 4y agoControversial opinion rant below: I think the weirdness is a cycle kicked off and perpetuated by how accessible web development it. It's a good thing that it doesn't take a comp sci degree to build a completely functional, professional looking and/or profitable JavaScript powered application. In addition to the exclusivity of JS in the browser - the ease of becoming productive has been a large driving force of its widespread adoption. The cost effective nature (cross platform, ease-of-development, abundance of skill) has played a large part in its ubiquity. This large number of developers has resulted in a large market for tool makers. Tools are difficult to profit from, so toolmakers adjust their business models and marketing to suit. As a result, a lot of developers write self promotional blog posts sharing "best practices" and plenty of impressionable decision makers dive head first into well marketed trendy tools/technologies that _may_ offer a benefit but often not proportional to their cost (vendor buy-in, additional complexity/reduction in project maintainability). For example, front end projects tend to prematurely optimise with huge foundational features like SSR - without considering their use case, the performance trade offs (caching, amongst others) and other more ergonomic/cheaper/more effective, optimisations. Despite not requiring it, developers tend to highly _highly_ couple their presentation logic to their application logic to the point where throwing away and rewriting an application is not an unreasonable sounding endeavour. People don't write an application that uses React, Vue, Angular - they write a React/Vue/Angular application. The current meta has moved away from boring obvious procedural circuits to dense, clever, fancy functional circuits which I (controversially) find difficult to grok, modify, and debug. I certainly use functional code (like functional components are nice for simple use cases and .filter/.find are nice shortcuts), my feeling is that deep functional chains are perhaps overemphasised now and difficult to mentally simulate when reading (which you must do inside-out, holding each step in your head). Testing is also a huge pain point. Developers tend to make extensive use of features like module mocking (`jest.mock('./filename')`) and avoid any form of dependency injection (not talking about DI frameworks, just simple property injection). If there is a hell, module mocks were sent to us from there. So many times I have made changes to a file where module mocks prevented tests that would otherwise have failed from failing. They are hard to track down, fail at runtime and... cries Today, when I consider joining a new company and hear a project uses React, NGRX, Redux, Next.js, SSR, and a few others - I can almost immediately assume it's going to be a contribution and maintenance nightmare. I still love front end even though it is an endless source of headache-inducing eye rolls watching people shoot themselves in the feet while confidently claiming it's the best way to run faster.
- PointyFluff 4y ago[dead]
- deleted 4y ago[deleted]
- deterministic 4y agoI think it is a big plus that the JavaScript community embrace code generators. I mostly write C++ for a living, and I use code generators all the time. Generating C++/Java/Typescript/SQL/… from high level declarations. Code generators are great tools for automating away the necessary but no-thinking-required parts of a typical app. I am typically able to code generate more than 90% of the application code needed to implement a new client/server business system. So why not use it?