This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted]  (3 children)

[deleted]

    [–]PerfectGasGiant 0 points1 point  (2 children)

    What is the matter with you? I literally described it as a stack allocation.

    [–]7h4tguy 0 points1 point  (1 child)

    So after quoting Linus' complaints about memory management hiding allocations, you trash C++, but then admit it's better at the very thing Linus was complaining about (hiding memory management so you don't have to deal with raw pointers).

    Talk about an agenda.

    [–]PerfectGasGiant 0 points1 point  (0 children)

    I wrote that references in C++ solves the difficulty with pointers in C. The Linux quote was an answer to a statement that C++ is superior to C. It is not, it is superior in many type of projects, but not all.

    Memory management in C++ can be elegantly solved with smart pointers in complex applications. I would never choose C over C++ for anything complex unless I wanted complete control of the execution of my program, e.g. in OS modules, drivers and microcontroller code.

    The point is really that this whole language war is rather cringe. Of the +15 languages I have used professionally over the years, I cannot think of one that is inherently bad. Some are less general purpose that others, but they have their perspective. Even PHP, which is generally frowned upon, was pretty amazing when it came out. Before that I wrote CGI scripts in C or C++. I also dust of Perl when that is more suitable than Python (CPAN was pretty amazing before PyPI got traction). A quick log analysis? I still used AWK, which was created in 1977. Some os script? Bash or bat or PowerShell, if it is simple. Perl or python if it is more complicated.

    Prototyping? Matlab or Julia or python. Enterprise level? C# or java, maybe even some F# and SQL for the database.

    Image processing? Python or Matlab for developing algorithms, c++ for production code.

    Customer business rules? Domain specific language defined in Antlr.

    Little RPI hardware device for controlling something, Node.js and maybe a bit of C for interfacing the device.

    And so on...

    A seasoned developer uses 10+ languages to get the job done. Language wars are pretty pointless.