Hacker News new | ask | show | jobs
by jcelerier 3122 days ago
> so learning how to compile a C++ library or program is _part_ of C++.

I entirely disagree. This is only for historical reasons, the language itself does not care at all about the compilation model. This mindset is what is keeping C++ back, both for the industry AND in students' minds.

> I feel like it hindered my ability to eventually understand what a real C++ program was.

The moment you have a .o file it's not a C++ program anymore, but a platform-specific object file. You aren't learning C++ but windows / mac / linux's native binary production toolchain.

2 comments

> The moment you have a .o file it's not a C++ program anymore, but a platform-specific object file. You aren't learning C++ but windows / mac / linux's native binary production toolchain.

Then that is at least part of the learning curve of seriously using C++ so I think as of today it's (potentially) dangerous to start with only interpreted code and wait to be introduced to compiling, build tools, etc. They should be taught together. I also think it's not the greatest environment - and I hope it changes, perhaps projects like this will help!

Indeed, the language does not care which means you should. Object file is not even a compilation unit at times.

You get to build the object file, shared objects, dlls what have you. Then use the linker to link it to turn it into an executable.

Some modern languages specify the runtime very deep. For example Python or Java - so much that it is hard to separate language from runtime or standard library.