5 ms·
this is the reason I pick a language OTHER than js for the backend. Why oh why did the whole world decide nodejs sever side js was a good direction? For the fro
by andrewfromx 3y ago
this is the reason I pick a language OTHER than js for the backend. Why oh why did the whole world decide nodejs sever side js was a good direction? For the frontend I get it. Unless you are going to mess with WASM files you need js.
- rr808 3y agoI personally do not know much about JS other than some light projects, but I have worked on an application that was C# both front and backend and the productivity was higher than anything else I've worked on. Using the same language, same tools, same developers, same job interviews was great. I'm thinking of doing back end JS for this reason.
- foooorsyth 3y agoI think Microsoft’s web stack is underrated, and was perhaps a factor there as well. I’ve seen unusually fast products written in the “dreaded” ASP.NET. Visual Studio is a much more powerful IDE than vim/VS Code, and imo C# is a much more scalable language that vanilla JS. Typescript bridges the gap pretty well.
- moffkalast 3y agoThe fact that JS can be this stupidly wacky yet still be so enjoyable to work with that nodejs is as popular as it is says more about other languages than about JS, I think.
- thfuran 3y agoAre you sure people are using it because they enjoy using it?
- moffkalast 3y agoYes, I'm pretty sure. In my and my friends' experience at least. As long as the codebase is of manageable size it's one of the most laid back languages out there, letting you get shit done without having to write pages of boilerplate or being lectured by a compiler. The level of abstraction is just right for the current hardware too. I'll probably get flamed for saying this, but having all objects be hash maps that can be extended or edited at any point and be simultaneously dumpable and loadable into JSON with one line was an unfathomably big brained move. Being able to just use the data you get from various sources instead of having to create an ad-hoc struct/object that perfectly matches all types and values (and ofc crashes immediately if a change is made on the other end) is so underrated. That's not even mentioning the native async support.
- mohbk 3y agothe website is 90% problems of very stupid implicit type conversion, and 10% valid floating number behavior that exists in other languages too (0.1+0.2, NaN a number) I agree using plain JS anywhere is not a good idea, but Typescript (or js with ts annotations) is often ignored when it does a very good job of catching most of these issues, while offering a very flexible type system in a more mainstream paradigm
- paulddraper 3y agoNode.js is popular is precisely because browsers are popular and JavaScript is the language of web browsers. Reusing code, tooling, training is meaningful. --- Every language (Java, Ruby, Go, Bash, whatever) has quirks. JS may have more than others, but it's not alone.
- devbent 3y agoLike typescript, which is an amazingly good language with an absurdly powerful type system that is easier to learn that competing absurdly powerful type systems!
- deergomoo 3y agoCause people wanted to write their front-ends and back-ends in the same language, for various reasons (code sharing, economics of hiring developers, etc). My issue with JS (particularly but not exclusively server-side) is less that it has some weird aspects and more that its built-in functionality/standard library is incredibly barebones in many respects. IMO that’s the main reason why it’s considered normal in the JS world for a project to pull in hundreds/thousands of largely un-vettable dependencies.
- jakelazaroff 3y agoThis is the reason you don’t pick JS for the backend? I’ve been using JavaScript professionally for over a decade now and I’ve literally never needed to write +!![] or “” - - “” or even a single one of these esoteric edge cases. (Except the floating point weirdness, which is an issue in basically every language.)
- andrewfromx 3y agono i mean the fact that JS was invented in 1995 and isn't well designed because we didn't know what we know now. I'm a professional golang developer and it just feels obvious to me when writing go; wow, this language was well thought out and fixed a lot of mistakes from 1995. (In a way that TypeScript doesn't even come close)
- jakelazaroff 3y agoI really like Go, and I tend to prefer it to JS for server-side stuff, but when I use it there are a lot of things I miss about JS: - Error handling is onerous; I write a lot of functions where most of the lines are just checking for and returning `err` - No anonymous structs, and it’s really awkward to define structs inline - Dealing with collections is really verbose; I guess since generics dropped I could handle this in userland, but it’s not idiomatic etc etc. No language is perfect!
- andrewfromx 3y agoI think u might like my "go on rails" framework: https://many.pw/sd/ https://many.pw/sd/ I make heavy use of map[string]any vs structs. I also find the right balance of checking err vs just making it _
- WorldMaker 3y agoJS was better designed than people give it credit for or it wouldn't have lasted anywhere near as many decades without being replaced by something else. JS has also had a lot of its "mistakes" fixed since 1995. It does so in a backwards compatible way and it isn't always obvious how much progress has been made, but it has never been a static unchanging, "unfixed" language. (Personally, I'd much rather work with JS on the backend than golang. Golang looks to me like a throwback to the 1970s that misses good language design ideas from the 1990s. I understand some of why it has become popular, but there's so much bad design in that language that upsets my nausea.)
- danShumway 3y ago> Why oh why did the whole world decide nodejs sever side js was a good direction? Knowledge transfer, context switching, the stuff you already know. But there's also an interesting non-JS reason that's gotten forgotten because the serverside landscape has changed so much since the early 2010s. Node very heavily popularized single-threaded asynchronous request handling (ie, not starting up a thread for every request that came into the server). Of course there is nothing about Javascript that means it specifically as a language is essential for that pattern, but I remember hearing talks from Netflix employees and industry advocates about how much Node had improved their performance; I remember industry people coming to my college and talking about single-threaded serverside code and saying "you all need to check Node out." And there are downsides to asynchronous code (callback hell was the obvious downside that got brought up a lot before `async` or even promises had arrived in the language) -- but I remember among especially younger serverside developers this trend of people saying, "Node is just faster. That's why you use it, because it's just straight-up more performant than what you're currently doing." And I understand serverside devs from other languages can at this point jump in and say that it's not, that the single-threaded model is possible in other languages, that there are downsides to the single-threaded model, that Node doesn't do it well, whatever. I'm not arguing the point, I'm just describing the cultural shift I saw. All of the conversations about sharing code happened too, but I remember having conversations where people talked to me about jumping to Node specifically because Express was single-threaded and because it could handle more concurrent requests than other popular server architectures that they were familiar with. And I suspect that it gave the ecosystem a lot of momentum. Node's original purpose was in part an experiment to see if single-threaded async request handling would be able to handle large numbers of simultaneous requests. My somewhat-limited memory of the conversations that were taking place back then is that running the same language clientside and serverside was just the icing on the cake. The big reason people were excited was because Node was single-threaded.
- jiggawatts 3y ago> single-threaded serverside code and saying "you all need to check Node out." When Node started to become a thing, Java and C# has already been doing multi-threaded web servers for about a decade. Oh, and C# already had support for async programming too! Node become popular in part because Silicon Valley just doesn't seem to be aware of anything that exists outside it.
- esafak 3y agoDo they still call it "isomorphic"?
- joshmanders 3y ago> this is the reason I pick a language OTHER than js for the backend. You choose against a language because of code that any sane person, which I hope includes yourself, would never write intentionally? Weird flex, but ok.
- andrewfromx 3y agohttps://news.ycombinator.com/item?id=37111497 https://news.ycombinator.com/item?id=37111497