5 ms·
The nice thing about Go is that you can learn "all of it" in a reasonable amount of time: gotchas, concurrency stuff, everything. There is something very comfor
by roncesvalles 1y ago
The nice thing about Go is that you can learn "all of it" in a reasonable amount of time: gotchas, concurrency stuff, everything. There is something very comforting about knowing the entire spec of a language.
I'm convinced no more than a handful of humans understand all of C# or C++, and inevitably you'll come across some obscure thing and have to context switch out of reading code to learn whatever the fuck a "partial method" or "generic delegate" means, and then keep reading that codebase if you still have momentum left.
- morshu9001 1y agoThis is also what I like about JS, except it's even easier than Go. Meanwhile Python has a surprising number of random features.
- jchw 1y agoJust so we're on the same page, this is the current JS spec: https://262.ecma-international.org/16.0/index.html https://262.ecma-international.org/16.0/index.html I don't agree. (And frankly don't like using JS without at least TypeScript.)
- goranmoomin 11mo agoWhile I might not think that JS is a good language (for some definition of a good language), to me the provided spec does feel pretty small, considering that it's a language that has to be specified to the dot and that the spec contains the standard library as well. It has some strange or weirdly specified features (ASI? HTML-like Comments?) and unusual features (prototype-based inheritance? a dynamically-bounded this?), but IMO it's a small language.
- jchw 11mo agoShrugging it off as just being large because it contains the "standard library" ignores that many JS language features necessarily use native objects like symbols or promises, which can't be entirely implemented in just JavaScript alone, so they are intrinsic rather than being standard library components, akin to Go builtins rather than the standard library. In fact, in actual environments, the browser and/or Node.JS provide the actual standard library, including things like fetch, sockets, compression codecs, etc. Even ignoring almost all of those bits though, the spec is absolutely enormous, because JavaScript has: - Regular expressions - not just in the "standard library" but in the syntax. - An entire module system with granular imports and exports - Three different ways to declare variables, two of which create temporal dead zones - Classes with inheritance, including private properties - Dynamic properties (getters and setters) - Exception handling - Two different types of closures/first class functions, with different binding rules - Async/await - Variable length "bigint" integers - Template strings - Tagged template literals - Sparse arrays - for in/for of/iterators - for await/async iterators - The with statement - Runtime reflection - Labeled statements - A lot of operators, including bitwise operators and two sets of equality operators with different semantics - Runtime code evaluation with eval/Function constructor And honestly it's only scratching the surface, especially of modern ECMAScript. A language spec is necessarily long. The JS language spec, though, is so catastrophically long that it is a bit hard to load on a low end machine or a mobile web browser. It's on another planet.
- morshu9001 11mo agoYeah, a lot of the quirks come from it being small
- alexjplant 1y agoECMAScript is an order of magnitude more complicated than Go by virtually every measure - length of language spec, ease of parsing, number of context-sensitive keywords and operators, etc.
- ttoinou 1y agoYeah I’m pretty sure people who say JS is easy don’t know about its Prototype based OOP
- morshu9001 11mo agoYou don't have to know about it, but if you do, it's actually simpler than how other languages do OOP.
- gf000 11mo agoNot convinced. Especially with property flags.
- liveoneggs 11mo agostrict mode makes it okay
- woodruffw 1y agoI think JS is notoriously complicated: the phrase “the good parts” has broad recognition among programmers.
- ajross 1y agoThe Javascript world hides its complexity outside the core language, though. JS itself isn't so weird (though as always see the "Wat?" video), but the incantations required to type and read the actual code are pretty wild. By the time you understand all of typescript, your templating environment of choice, and especially the increasingly arcane build complexity of the npm world, you've put in hours comparable to what you'd have spent learning C# or Java for sure (probably more). Still easier than C++ or Rust though.
- xigoi 1y ago…do you know you can just write JavaScript and run it in the browser? You don’t need TypeScript, NPM or build tools.
- throwaway894345 11mo agoYou do if you want more than one file, or if you want to use features that a user’s target browser may not support.
- xigoi 11mo ago> You do if you want more than one file Modules were added in, like, 2016.
- deleted 11mo ago[deleted]
- morshu9001 11mo agonodejs and npm are easy for beginners, especially compared to the Python packaging situation
- legends2k 1y agoSorry, hard disagree. Try to understand what `this` means in JS in its entirety and you'll agree it's by no stretch of the imagination a simple language. It's more mind-bending and hence _The Good Parts_.
- cratermoon 1y agohttps://jsdate.wtf/ https://jsdate.wtf/
- llmexperience 1y ago[flagged]
- kermatt 1y ago> I'm convinced no more than a handful of humans understand all of C# or C++ How would the proportion of humans that understand all of Rust compare?
- metaltyphoon 1y agoRust isn’t that complicated if you have some background in non GC languages.
- j16sdiz 1y agoParent say _all_ of it, not a subset for everyday use.
- estebank 11mo agoThere's a different question too, that I think is more important (for any language): how much of the language do you need to know in order to use it effectively. As another poster mentioned, the issue with C++ might not be the breath of features, but rather how they interact in non-obvious ways.
- Measter 1y agoFor Rust vs C++, I'd say it'll be much easier to have a complete understanding of Rust. C++ is an immensely complex language, with a lot of feature interactions. C# is actually fairly complex. I'm not sure if it's quite at the same level as Rust, but I wouldn't say it's that far behind in difficulty for complete understanding.
- Santosh83 1y agoFor Rust I'd expect the implementation to be the real beast, versus the language itself. But not sure how it compares to C++ implementation complexity.
- pclmulqdq 11mo agoI'm pretty convinced that nobody has a full picture of Rust in their head. There isn't even a spec to read.
- egl2020 1y agoI've been writing go professionally for about ten years, and with go I regularly find myself saying "this is pretty boring", followed by "but that's a good thing" because I'm pretty sure that I won't do anything in a go program that would cause the other team members much trouble if I were to get run over by a bus or die of boredom. In contrast writing C++ feels like solving an endless series of puzzles, and there is a constant temptation to do Something Really Clever.
- stackghost 1y agoGo is okay. I don't hate it but I certainly don't love it. The packaging story is better than c++ or python but that's not saying much, the way it handles private repos is a colossal pain, and the fact that originally you had to have everything under one particular blessed directory and modules were an afterthought sure speaks volumes about the critical thinking (or lack thereof) that went into the design. Also I miss being able to use exceptions.
- throwaway894345 1y agoWhen Go was new, having better package management than Python and C++ was saying a lot. I’m sure Go wasn’t the first, but there weren’t many mainstream languages that didn’t make you learn some imperative DSL just to add dependencies.
- stackghost 1y agoSure, but all those languages didn't have the psychotic design that mandated all your code lives under $GOPATH for the first several versions. I'm not saying it's awful, it's just a pretty mid language, is all.
- gp 1y agoThe language has changed a lot since then. Give it a fresh look sometime.
- asa400 1y ago> The nice thing about Go is that you can learn "all of it" in a reasonable amount of time This always feels like one of those “taste” things that some programmers tend to like on a personal level but has almost no evidence that it leads to more real-world success vs any other language. Like, people get real work done every day at scale with C# and C++. And Java, and Ruby, and Rust, and JavaScript. And every other language that programmers castigate as being huge and bloated. I’m not saying it’s wrong to have a preference for smaller languages, I just haven’t seen anything in my career to indicate that smaller languages outperform when it comes to faster delivery or less bugs. As an aside, I’d even go so far as to say that the main problem with C++ is not that it has so many features in number, but that its features interact with each other in unpredictable ways. Said another way, it’s not the number of nodes in the graph, but the number of edges and the manner of those edges.
- synthetic-echo 1y agoJust an anecdote and not necessarily generalizable, but I can at least give one example: I'm in academia doing ML research where, for all intents and purposes, we work exclusively in Python. We had a massive CSV dataset which required sorting, filtering, and other data transformations. Without getting into details, we had to rerun the entire process when new data came in roughly every week. Even using every trick to speed up the Python code, it took around 3 days. I got so annoyed by it that I decided to rewrite it in a compiled language. Since it had been a few years since I've written any C/C++, which was only for a single class in undergrad and I remember very little of, I decided to give Go a try. I was able to learn enough of the language and write up a simple program to do the data processing in less than a few hours, which reduced the time it took from 3+ days to less than 2 hours. I unfortunately haven't had a chance or a need to write any more Go since then. I'm sure other compiled, GC languages (e.g., Nim) would've been just as productive or performant, but I know that C/C++ would've taken me much longer to figure out and would've been much harder to read/understand for the others that work with me who pretty much only know Python. I'm fairly certain that if any of them needed to add to the program, they'd be able to do so without wasting more than a day to do so.
- 1y ago
- throwaway894345 11mo agoI’ve been using Python since 2008, and I don’t feel like I understand very much of it at all, but after just a couple of years of using Go in a hobby capacity I felt I knew it very well.
- treis 11mo agoThe tradeoff with that language simplicity is that there's a whole lot of gotchas that come with Go. It makes things look simpler than they actually are.
- zero_shift 11mo agoI learned Go this year, and this assertion just... isn't true? There are a bunch of subtleties and footguns, especially with concurrency. C++ is a basket case, it's not really a fair comparison.
- nasretdinov 11mo agoAs they (I) say, writing a concurrent Go program is easy, writing a correct one is a different story :)