Has C# replaced C++?

Started by
70 comments, last by Prototype 4 years, 7 months ago
3 hours ago, Prototype said:

What do you mean exactly with 'before DLL's'? Dynamic libraries are almost as old as programming itself.

Hardly.  DSOs (dynamic shared objects -- DLLs, .so files, .dylibs) are relative newcomers.  I remember when AIX on the RS/6000 didn't support them at all. and certainly RSX on the PDP/11 didn;t support them -- how could it, it didn't even support virtual memory, although it supported shared pages through the FORTRAN /COMMON/ construct.

Nope, DSOs are maybe a few decades old at best.  Programming has been around for centuries.

@Gnollrunner is completely correct when he distinguishes between native binaries and those that need a native interpreter.  They are different solutions to the problem of portability, with different trade-offs.  They all, however, require non-trivial runtimes.

Stephen M. Webb
Professional Free Software Developer

Advertisement

My argument was against the original idea that C++ does not depend on external software. Perhaps I've taken that too far. Obviously I agree that language implementations are completely different.

 

22 hours ago, Bregma said:

I remember when AIX on the RS/6000 didn't support them at all. and certainly RSX on the PDP/11 didn;t support them

 

I wouldn't be so quick to dismiss it. They haven't been around since "as old as programming itself", but they've certainly been around for multiple generations of programmers.

I thought the PDP/11 had them, although it may have been in a different form. I only had limited exposure to the system at school.

I don't know where the cutoff is, but the timeline is understandable for thinking of dynamic libraries as that old.  With overlays you had a library of code that was dynamically loaded but unique to your own program. The current incarnation of DLLs comes from the late 1980s, but the model is even older.

If you're looking at history, there was a time when program overlays transitioned from being unique to one program to being shared as libraries. I learned about unique, non-shared overlays being in mainframes very nearly since the first business monstrosities in the 1950s. A chunk of the executable was loaded into memory because there wasn't room in memory to hold the whole thing. It wasn't virtual memory, but they were certainly dynamically loaded and unloaded to account for available memory. 

Shared overlay libraries were absolutely a thing back on the Commodore, I remember using them way back when I was cutting my teeth on the system, and that system dates to 1977.  It was how PET BASIC worked. So 42 yeas at least on consumer hardware.  Overlay managers were the hot new thing (and source of headaches) in the mid 1980s.  I remember when I first learned about them it was coupled with leveraging segment:offset notation coupled with the dynamically loaded module; you could record the segment that contained the overlay, then a simple jump table could be used for the offset. It needed a test to ensure the module was loaded, but overlay managers usually handled that task.

But trying to stay on topic, new tools are often reinterpretations of old tools.  The old systems often have different purposes than the new systems, as everything evolves over time.

Imo with C++11, C++14, C++17 and soon C++20 is making C++ insanely powerful. it's incredible.

I'm so grateful for these upgrades. I hope they keep it up but it's already so great. C#, Java only got so popular because pre-C++11 the language was just too trash to work with.

Imo it's more likely C# has a problem if the standard keeps pushing out these C++ upgrades well into the future.

2 hours ago, AxV said:

Imo with C++11, C++14, C++17 and soon C++20 is making C++ insanely powerful. it's incredible.

I'm so grateful for these upgrades. I hope they keep it up but it's already so great. C#, Java only got so popular because pre-C++11 the language was just too trash to work with.

Imo it's more likely C# has a problem if the standard keeps pushing out these C++ upgrades well into the future.

Each time C# comes out with a new version with new syntax sugar, I get excited about it all over again.  Same with C++'s new stuff.  Sometimes the improvements that one language makes inspires other languages to improve as well.

As long as the various languages continue evolving to make programming nicer, everyone wins. :)

(edit) ...except for the compiler programmers...

10 hours ago, Nypyren said:

Each time C# comes out with a new version with new syntax sugar, I get excited about it all over again.  Same with C++'s new stuff.  Sometimes the improvements that one language makes inspires other languages to improve as well.

As long as the various languages continue evolving to make programming nicer, everyone wins. :)

(edit) ...except for the compiler programmers...

Well, as long as lanuages continue to evolve compiler programmers will still have a job tomorrow:)

Developer journal: Multiplayer RPG dev diary

No and perhaps they can't. Actually, their names are almost similar but both have their own pros and cons.

Wow. I haven't seen a 7-page-deep language debate since... at least a site redesign ago :)

Potentially controversial opinion: C# chiefly competes with Java and Objective-C, not C++. While you can certainly use it to replace many uses of C++, it's been more heavily marketed into the Enterprise and mobile app spaces (and in both spaces, it's pretty successful). Unity has caused a big uptick in the use of (a somewhat weird flavour of) C# for gamedev, but I don't see it gaining a lot of other traction outside of tools development in the games space.

If you are looking for languages capable of unseating C++ from the niches where it's currently pretty dominant (gamedev, some embedded programming, a lot of high-performance networking and compute), I'd say about the only game in town right now is Rust. But it's too early to tell if it's going to make a big dent outside of mission-critical software.

Tristam MacDonald. Ex-BigTech Software Engineer. Future farmer. [https://trist.am]

In my view, 6 years ago I worked at a company that did games in C++. After that I've started working in a computer graphics company, again in C++. After work I write my own game engine in C++.

During that time I've followed what people use to make games. And judging by the vocal people, C# indeed gained a ton of popularity because of XNA/MonoGame and of course Unity.
It feel like Unity took the place of Flash for rapid prototyping, took the place for C++ rapid prototypes (aka guys that use frameworks and other engines that are C++ based like Ogre or Irrllicht). And the youth these days is interested in the flexibility of Unity and not the level of control that C++ provides. We've got to agree that picking up unity is way easier than making Ogre run, and then if we start talking about building a scene, or loading a 3D model, Unity just works(tm).

So from my view C# is indeed big. C++ is stiil the go-to language for more bigger projects (and there are people like me that do their own engines). However the flexibility and prototyping power of Unity doesn't have a competition in the C++ (which If I have time I hope that my engine would be able to provide at least for the hobby guys).

PS.
Modern C++ isn't good in my opinion, it compiles slower, gives you less control(over the new features), and most importantly it is hard to debug. I use C++03 with some minor new features and STDLIB classes (like member initialization in decl, std::unique_ptr, override, template varargs, decltype, alignof, modern for loops stuff like that).
And yes I've used it professionally I know the features, I just have really hard time getting things done if they are involved.

On 8/29/2019 at 9:51 PM, AxV said:

Imo with C++11, C++14, C++17 and soon C++20 is making C++ insanely powerful. it's incredible.

I'm so grateful for these upgrades. I hope they keep it up but it's already so great. C#, Java only got so popular because pre-C++11 the language was just too trash to work with.

Imo it's more likely C# has a problem if the standard keeps pushing out these C++ upgrades well into the future.

Eh, I don't see it the same way.

C++ seems to be turning into something that nobody ever asked for. The focus seems to be on adding features that aren't relevant with how the language is actually used today.

For sure things like std::thread existing as part of the standard library is a good thing and so are smart pointers (for a language without a GC) and a few syntactic niceties like lambdas/closures.

On the whole I think all anybody ever really wants from C++ is C-with-classes with a few extra bits of syntactic sugar, plus maybe generics (not even full-blown templates). Within C++ is a much smaller language trying to get out.

 

1 hour ago, swiftcoder said:

Potentially controversial opinion <snip>

Yup I agree.

It's kind of amazing to me that nobody has yet replaced C++ with a C# or Java like language that is compiled and compatible with C and/or C++ ABIs or perhaps transpiled to a C++ subset -- something to free people from actually writing C++ without giving up the decades of libraries and compiler optimizations.

This topic is closed to new replies.

Advertisement