Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

This 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.)


no 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)


I 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!


I think u might like my "go on rails" framework:

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 _


JS 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.)




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

Search: