8 ms·
Unless your job demanded it I can't think of a compelling reason for a Node guy to learn C++ as their go to choice of OO language. Why not Java? Even Python is
by CodeSheikh 8y ago
Unless your job demanded it I can't think of a compelling reason for a Node guy to learn C++ as their go to choice of OO language. Why not Java? Even Python is a good gateway to OO for folks coming straight form Node background.
- bitwize 8y agoI can think of one: C++ is Node's extension language (being the language V8 is implemented in). If you want Node to do things not already built into it or talk to a library that doesn't have a package available for it already, you have to use C++.
- bluGill 8y agoc++ is not an OO language. C++ is a tool to get things done in the real world using whatever paradigm makes sense for your problem. Sometimes that is OO, sometimes not. C++ is very messy, but for the most part you can ignore the messy things.
- mempko 8y agoFor the most part, the world is messy ;-)
- crimsonalucard 8y agoEverything in the world is made out of a single unit: Atoms. Complexity and messiness arise from different compositions of Atoms. I feel we should build our programs the same way. Bottom up from a small set of simple primitives. Not top down like C++.
- Koshkin 8y agoThere are three sets of primitives I can recommend for you to get some experience with: the Turing machine; the Lambda Calculus; the Lisp primitives (CONS, CAR, CDR).
- russley 8y agoC++ is the gateway to writing native add-ons for V8, allowing you to write performant modules to utilize in your node applications.
- tashoecraft 8y agoThink rust is going to attract more of the node guys than c++ will.
- nindalf 8y agoWhile I agree, OP also wants to dive into the internals of libuv etc.
- shereadsthenews 8y agoIn the real world “your job demands c++” is very widespread.
- ajross 8y agoI think your "for a Node guy" is doing more work than "Why not Java?". I mean, it's true that if you don't work in the world of low level performance thought that C++ doesn't bring much to the table. But to be clear: Node and Java (and anything with a managed heap) doesn't have a paradigm for things like RAII or inlined parametrazation or copy-by-value or move semantics because it doesn't have a way to express them. But those are useful tools and important in some regimes.
- mmjaa 8y agoThings I'd rather be doing: * C++ * Lua .. .. [a thousand other things] .. .. * Node * Javascript __ bottom of the pile.. The Node/JS ecosystem is such a steaming pile of garbage, I can honestly see with great clarity why people should be running from it back into the arms of C++[11,17] ..
- vedantroy 8y agoYou shouldn't make broad statements like that. In my personal experience, I have found Javascript much easier than C++. If I want to install a package, I can just do "npm install <package_name". Also, 0-configuration bundlers like Parcel make building complex projects very easy. Now, I'm sure some people have an easier time with Makefiles, but I've found it even easier to get up and running in Javascript. Most of the tools in Javascript (create-react-app, Webpack, etc.) are very user friendly, making setup trivial. It is best not to speak with such authority/certainty that C++ is easier to use than Javascript.
- ontouchstart 8y agoDon't mistake easy with simple. https://www.infoq.com/presentations/Simple-Made-Easy https://www.infoq.com/presentations/Simple-Made-Easy JavaScript is a simple language that can be made extremely complicated via "simple" tooling. You can open the node_modules folder and see how sausages are made. :-) C++ is dealing with essential complexities, there is no silver bullet: https://en.m.wikipedia.org/wiki/No_Silver_Bullet https://en.m.wikipedia.org/wiki/No_Silver_Bullet
- ontouchstart 8y agoIf you have a powerful desktop computer, please open this notebook on nbviewer, scroll down all the way to the bottom and see what I mean: https://nbviewer.jupyter.org/gist/ontouchstart/1af198f8535eb7df4674bae59619a47c https://nbviewer.jupyter.org/gist/ontouchstart/1af198f8535eb...
- wanted2 8y agoI'm reading this because I'm about to move back to systems programming after a 6 year journey into Javascript Nodejs full-stack developement. Don't underestimate the pile of garbage JS indeed is! Yes, you can install a package with ease, you'll have to do that with about 100 packages that keep changing all the time with all kinds of breaking changes (not talking about their 1000's of dependencies). I'm also sick and tired of the hipster JS community where every piece of shit can become a hype. With JS you'll be forced to work with things you hate. Almost all codebases I have to work with are horrendous piles of rubbish that often need to be completely rewritten from scratch. Almost everything you write doesn't last. You've spent a year learning Backbone? Just throw it away, now it's Angular you can start all over again. One year later? Stop doing Angular, it's React now, just start all over again! Hey, now we have some hipsters promoting Vue, they say it's the holy grail, just start all over again, it's fun! Flux stores? Fluxxor, Alt, Redux, Redux with Saga's, or just go with Thunk? It doesn't matter that much, it only lasts for 1 or 2 years! I'm completely sick and tired of it, including the fact that I'm only working on stupid e-commerce websites.. Talking about make files, a magnitude easier than trying to setup babel and webpack for a medium sized SSR SPA. I recently had to upgrade from babel 6 to 7, what a fuckin pain that was, so many changes, the deployment server refused to boot etc, etc.. Mind your step going into JS!
- CyberDildonics 8y agoSomeone has to actually do all the native programming that powers scripting languages and VMs.
- chooseaname 8y agoI think some people forget that it's not Javascript all the way down. Wish I could click the up arrow twice.
- maxxxxx 8y agoVery true. A lot of people don't seem to know how their favorite tools are being built.
- jswizzy 8y agoIf you want to do systems programming then you need to learn c,c++,rust, maybe go. I mainly write Java/Kotlin and learning C++ and Rust have really helped me learn things about computers that Java hides.
- TeMPOraL 8y agoThen again, why would you want to choose a language based on whether it's "OO" or not? OOP is just a way of structuring code that fits well in some domains, and fails spectacularly in others[0], and that happens to invite a lot of philosophers (the same way FP invites a lot of mathematicians). It's better to think about the capabilities the tool gives you - what kind of software you can write, what kind of software that language's community writes, and how much it helps manage complexity. -- [0] - Everything I worked on, from games through embedded to web development, was a poor fit for C++/Java-style OO, but I suspect there are some domains where OO modeling is the best way of looking at things.
- crimsonalucard 8y agoWouldn't the main definition of OOP be defined as merging data and functions into a single unit? When using libraries, I find this concept unavoidable for UI and games. I agree though, that having the entire program be a graph of objects is actually usually the worst pattern.
- nickik 8y agoNot really. In fact in Lisp OO is the opposite, the functions are explicitly keeped away from the data. For Alan Kay it was all about messanging but I dont think most people think about that. Structs with some kind of dynamic dispatch based on the type would be the most general discription I think.
- TeMPOraL 8y ago> Not really. In fact in Lisp OO is the opposite, the functions are explicitly keeped away from the data. Common Lisp really opened my eyes here. Initially it felt weird to have methods[0] living completely independently from classes, but over time I realized that where classes and objects implement nouns, generic functions and methods represent verbs, and in a language the verbs are an independent domain from nouns, representing their own generalized concepts that's unrelated to the taxonomy of nouns. -- [0] - A "method" in CLOS is an individual implementation of a "generic function". So e.g. you could have a generic function `(defgeneric draw (device figure))`, and then specific implementations dispatching on any combination of arguments; e.g. `(defmethod draw ((device printer) figure)` to draw any kind of figure on a specific device, or `(defmethod draw (device plotter) (figure circle))` to draw a specific thing on a specific device, etc.