Live data from Hacker News

I learnt C++ in 2018 and have no regrets

vishnubharathi.codes

81–90 of 259 posts

Re: I learnt C++ in 2018 and have no regrets

#81
post #69

I've learned 15+ years ago, and I stopped paying attention around ~2010, which is just before significant changes were made. Even though I read up on some features and concepts from C++11 and C++14, I feel so disconnected from what's going on as if what I learned was a completely different language. Can anyone recommend any source for someone with lots of pre-C++11 experience to get up to speed with current capabilit…

https://en.cppreference.com/ If you already know the language flow control you don't need to read paragraphs of a book to relearn to how "think" in the language. You just need the "whats new" parts.

I'm not confident how deep the impact of the new features is on thinking in the language. I can learn the new features, but I fear I'll still be essentially writing C++03 with C++17 bells & whistles. Did the semantics and idioms change much?

(I hear the compile times are the same though -.-)

Re: I learnt C++ in 2018 and have no regrets

#82

I've learned 15+ years ago, and I stopped paying attention around ~2010, which is just before significant changes were made. Even though I read up on some features and concepts from C++11 and C++14, I feel so disconnected from what's going on as if what I learned was a completely different language. Can anyone recommend any source for someone with lots of pre-C++11 experience to get up to speed with current capabilit…

Just read this and you will be just fine: https://github.com/AnthonyCalandra/modern-cpp-features

Re: I learnt C++ in 2018 and have no regrets

#83
post #22

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.

Things 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] ..

You 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 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.

Re: I learnt C++ in 2018 and have no regrets

#85
post #66
post #52

Earlier quoted context omitted.

Most projects use CMake now so it seems the community is starting to coalesce around CMake as the "not official" build system.

Thats besides the growing number using Meson instead.

I haven't tried Meson, any good articles about it?

Re: I learnt C++ in 2018 and have no regrets

#86

Earlier quoted context omitted.

C++ is not very canonical OOP. And by that I don’t just mean it’s multi paradigm nature, but it’s realization of OOP features. Using C++ teaches you mostly about using C++ and doesn’t really transfer across the paradigm.

I think that statement would have to be classified as inaccurate. using C++ teaches you mostly about general purpose programming and it's pretty easy to go from C++ to python to Java to bash, etc.

Nonsense. C++'s template system behaves unlike any other language (things like SFINAE and the techniques that use it do not transfer), C++-style RAII is relatively unusual, I don't think any other language requires the programmer to think about virtual versus non-virtual inheritance, the C-derived sequence point rules are obscure and much looser than most languages' evaluation rules, the exception-safety rules are unique to C++, most languages don't make you track the minutiae of a dozen different integer types with inconsistent promotion rules, textual macros are abominable, C++ has more obscure control flow constructs than most languages... meanwhile the language has no standard support for true sum types, garbage collection, unit testing, poor library tooling, a limited type system... which means you don't learn the general-purpose techniques that rely on these things.

If all you know is C++ you will be able to produce a limited amount of working code in a handful of C++-like languages, sure - but even in Python or Java or Bash you'll produce very unidiomatic code if you write in C++ style. If you tried to work in e.g. Smalltalk or Erlang or even OCaml you'd really struggle. It is not a good way to learn general-purpose programming, because the language is hugely complicated and most of the complications are C++-specific.

Re: I learnt C++ in 2018 and have no regrets

#87

I've learned 15+ years ago, and I stopped paying attention around ~2010, which is just before significant changes were made. Even though I read up on some features and concepts from C++11 and C++14, I feel so disconnected from what's going on as if what I learned was a completely different language. Can anyone recommend any source for someone with lots of pre-C++11 experience to get up to speed with current capabilit…

I've been in the same boat--relearning C++ after using C++98(!) for a long time. My first go-to book was _A Tour of C++_ , 2e by Stroustrup. Also _Effective Modern C++_ by Scott Meyers (of _Effective C++_ fame). Other books I've been reading: _C++ 17 The Complete Guide_ by Josuttis _C++ 17 in Detail_ by Filipek Lots of good blogs out there. Also the CPP Podcast. http://cppcast.com/ There are also a lot of great blogs…

I'll second A Tour of C++ 2e. It's a great way to get up to speed on the most important aspects of C++. It's very readable if you're already familiar with C syntax style languages.

Re: I learnt C++ in 2018 and have no regrets

#88
post #43
post #29

Earlier quoted context omitted.

C++ is commonly used for large complex projects. The problem with opinions is eventually you come across something that the opinion will not allow. For a small project an opinionated build system makes things easier and you essentially never run across something that can't work. For very large projects that is not true and so you end up fighting opinions in some place.

Having opinions != removing choices One can have an opinionated, canonical build system and still allow unorthodox things.

The strong the opinion the harder the unorthodox things are. The weaker the opinion the harder it is for newbies to get going. There is a trade off here.

Re: I learnt C++ in 2018 and have no regrets

#89
post #19

> My quest for relearning C++ started in November 2018. That’s great! I’ve been using it since 2013 and still haven’t learned it!

What language can one say that they fully master? I've been using Python since 2008-ish on and off for various scripting tasks and small tools, I can't say that I've "learned" it. They keep adding new stuff, some things I forgot, others I never needed. I've been using C++ professionally since ~2006 and for similar reasons I won't say that I master it either. Metaprogramming is a clear weak point for me, but OTOH I fi…

Mastery comes when you know most of the 1st order stuff and can even anticipate the stuff you don't know because you also know the 2nd order stuff. In Java this is easy because after you get proficiency you can really dig in and read the JVM Spec and the JLS(1), and you have lots of great, powerful tools available to examine the running JVM, bytecode, etc. In other languages, this is a lot harder. JavaScript (ES6) kinda sorta has a specification(2) but it didn't start out that way and the jsvm doesn't have one (AFAIK). The implementation and the tooling for JS is widely varying, and typically includes lots of non-JS stuff like the DOM and networking - which is (really!) great but lacks focus. Somehow lots of popular languages exist without specifications, like Python, Ruby, PHP, Markdown. This is, IMHO, a very serious drawback because to become a master of these languages requires that you become a master of the concrete interpreter implementation, which is easily an order-of-magnitude harder and less direct than reading a specification.

(1) https://docs.oracle.com/javase/specs/

(2) http://www.ecma-international.org/ecma-262/6.0/

Re: I learnt C++ in 2018 and have no regrets

#90
I'm in the exact same boat as you. I've been mostly writing JavaScript for the past 2-3 (with some Go, and more recently Flutter).

I've started to learn some C++ a few days ago, mostly go get into lower level code and into game development (Unreal), and I've found it to be pretty great!

I've been going through A Tour Of C++ and it's a great primer on the whole language. I also read the Learn X In Y Minutes on C++ to get a feel of it before diving in.

What are some high quality, small C++ projects I could play around with and read the source code? I'd like to explore it in more practical use next.

Post reply on HN