• 0

is c# better then c++?


Question

Recommended Posts

  • 0

C# is arguably an easier language to get into that C++. A lot of the management is done for you, memory, and so on. However, there is an underlying feeling that C++ is more powerful overall if you want to jump down to the depths (I can't argue either way on this, I make apps that don't require me to go THAT deep).

As for Linux, yes - there is MONO, but it's a port, it's not pure C#.

  • Like 1
  • 0

To decide which is better we need to know what you want to use it for. It's a bit like asking which is better, a Ferrari or a Mini van? Each has their uses and pros/cons, and if you make the wrong choice you will find things very difficult.

C++ is ultimately more powerful, and allows you much finer grained control. It is essentially the language that most of the big OSs are written in. But for most of us normal programmers their is no need for that level of control, especially when you consider that if you get it wrong things will go disastrously wrong very quickly. C# will be easier to learn, and if nothing else will give you a basic grounding that you can use to move up to C++.

  • Like 2
  • 0

C# is arguably an easier language to get into that C++. A lot of the management is done for you, memory, and so on. However, there is an underlying feeling that C++ is more powerful overall if you want to jump down to the depths (I can't argue either way on this, I make apps that don't require me to go THAT deep).

As for Linux, yes - there is MONO, but it's a port, it's not pure C#.

c# is an open standard, mono is an implementation of that standard as it the .net framework. afaik

  • 0

Yes, C# is better than C++. It's much more elegant and doesn't have much of the legacy stuff that comes with C++. Whether or not you want to use it as a learning language is more a personal preference thing. I tend to recommend C++ over C# for learning, since it gives you experience with lower level concepts such as pointers, whilst still offering object-oriented goodness, but C# allows you to dive straight in more easily and handles all the lower level stuff for you.

C# is supported (as others have said) on Linux through the Mono project, so it's perfectly usable on Linux. You may come into ideology conflicts with Linux users if you create software using it though :)

  • 0

Short answer: C# is far easier to learn if you're just starting out.

Long Answer: C# is far easier to learn, but you never really have to learn about memory management with C# which is an important part of software development. Though, it's arguably less relevant in C# because it's a managed language. You can always use C# to learn the ropes of object-oriented development, and then go back to focus on memory management in an unmanaged language like C++.

C# also has better tools, which can make it significantly less frustrating to develop. You can use Visual Studio for both languages, but C# has syntax highlighting, type-ahead, intellisense, and all other modern features of IDEs built into the language (it's a .NET language after all). C++ has some intellisense, but no highlighting or anything else. For beginners, this might be a huge obstacle.

For 99% of anything software developers will ever have to do, C# a good choice. For the other 1%, videogame development, C++ is arguably the better choice. And by "arguably" I mean C++ is only better if you're planning on writing the next Unreal Engine. C# is actually very capable for making small 2D and 3D games.

  • 0

IMHO C++ is better; one of the first and foremost reasons is RAII which lets you manage resource (notice the difference here: GCs only manage memory!, but memory is the least dangerous garbage you may produce in a [modern] system?) in arguably the cleanest way possible - as you don't have to do anything yourself?

Another big advantage is that the whole library is developed under strict control in terms of runtime complexity - a feature you'll never be able to find under C? (or Java for that matter)?

  • 0

What's with all the soft wording :\

C++ is a much more powerful and faster executing language. Depending on the compilers you are using, you can even insert compiler code directly into the app for those processes you want to scream along. C++ runs as native code. It's compiled to be as efficient as possible on which ever platform you run it on. It's far "lower level" and lacks a lot of niceties that higher languages possess (such a Just-in-Time debugging).

C# is far FAR faster to deploy in. It is also far more forgiving of mistakes. In the process is being so, it is also far slower. Where as C++ runs code that is compiled directly for the CPU, C# runs as a managed language. You don't have to worry about assigning memory as the CLI handles that for you. You can make small mistakes in your code and have it continue to run. You can't do as much (but it's fairly negligible a difference for the average coder).

Personally, given the work I do, I much prefer C#. I enjoy the niceties of the .net framework (this should be what ultimately makes the decision for you). That said, I personally believe that if you want to be a serious coder, you should learn on C++ so you know exactly what C# is handling for you in the background. That way you will realise exactly how much CLI handles and why it's so much slower than C++ for HPC uses.

tl;dr - C++ first then C# if you plan to be a serious coder. C# first and no C++ if you don't care.

  • Like 3
  • 0

My vote goes to C#. It's still a C Based language so it feels very close to C++ albeit cleaner. The .NET Framework provides most everything you need, anything else can be made using the framework and piecing parts together. I spend 90% of my work day in C# and it is a great experience.

  • 0
What is easier to learn?
C# and by far.
does it work on linux?
C++ has gcc and clang for compilers, as well as a few different IDEs, while C# has mono and the monodevelop IDE. Contrarily to some resilient myths, mono is not "unpolished" or "dangerous" or such. It's every bit as polished and alive as any C++ compiler on Linux, and a quality solution used by professionals.
there is MONO, but it's a port, it's not pure C#.
Mono is an implementation of open standards just like gcc or clang. I don't know what you mean by "pure C#", as Microsoft's .NET itself is written in C++.
In the process is being so, it is also far slower. Where as C++ runs code that is compiled directly for the CPU, C# runs as a managed language
C# is also compiled to machine code, it just does so usually "Just-in-time" rather than always ahead of time like C++. While C# does make compromises on performance where C++ makes none, it still offers comparable level of performance in most cases, and saying it's "far slower" is an exaggeration. I'd even say that it's easier to write fast code in C# than C++, leading to faster programs given the same time constraints.

Of course if what you're writing is scientific high-performance computing code, then C# isn't what you should be using, but I'm talking about the general case.

Another big advantage is that the whole library is developed under strict control in terms of runtime complexity - a feature you'll never be able to find under C?
I've heard that from Herb Sutter and it's quite amusing. Yes, most of C++'s library has its complexities documented, but maybe because there isn't much more than containers and algorithms in the C++SL... Containers and algorithms in .NET also have their algorithmic complexities documented, but there is no point documenting the algorithmic complexity of a Printer or Socket class.
But if you want to learn about pointers, you have to go with C++.
There are pointers in C#. And reference vs value types is basically the same idea as pointers vs values in C/C++.
  • Like 2
  • 0

It's not like C++ is "hard" like assembly.

IMO if someone finds c++ hard to learn then maybe a job in computer tech is not for him/her. Or maybe it explains why so many apps are slow as hell these days.

This said c++ is kinda "dead". Last time i saw a job requiring c++ knowledge was a long time ago. Most jobs theses days require .net, java, php, mobile frameworks, etc or old languages like cobol or sas for jobs in banking and inssurance (anyway where i live might be different for california ;).

c++ is mostly used for video game engines and by scientist for simulation and such (or in old programs made with it). Basically it's used for things that can stress a computer. And for such jobs usually c++ may be not enough as you need to understand assembly too and need to have a very good knowledge in algorithmic and mathematic (anyway last time i checked there was still some assembly used).

If your goal is to learn and become a computer eng then you should start with c++. I would even go as far as to say you should start with assembly. In fact you should start with mathematic as it's the basis of being a computer eng. It's more important to learn the concepts first. Starting with the language is not a good idea. You can learn mathematic and algorithmic and oop concepts without even using a computer.

If you goal is to write a simple linux app and you don't care about being a good dev then c# if mono is good (can't say never used mono). It's definately easier.

  • 0

C# is far FAR faster to deploy in. It is also far more forgiving of mistakes. In the process is being so, it is also far slower. Where as C++ runs code that is compiled directly for the CPU, C# runs as a managed language. You don't have to worry about assigning memory as the CLI handles that for you. You can make small mistakes in your code and have it continue to run. You can't do as much (but it's fairly negligible a difference for the average coder).

Even C# is compiled to native code. But that is done by the JIT compiler on first run. This is a common myth.

  • 0

What is easier to learn

It depends how you look at it. If you already know how to use the OS facilities and third party libraries, then I'd say C++ is generally quicker to learn. By generally, I mean the common stuff, basic OO, commonly used STL classes, etc. And if you already know C, learning C++ is made that much easier.

With C# you'll need to learn both the language and the dotnet library. In terms of difficulty, it's probably on about the same level as Java. After all C# was Microsoft's answer to growing Java use.

and does it work on linux?

I wouldn't recommend using C# or dotnet outside of Windows. Its support is sketchy at best, and most Linux distributions are blacklisting it (Mono) due to precarious licensing issues. Furthermore, the proprietary Windows Forms also won't be available outside of Windows, so if you intend on writing a GUI application, you will have to use something else.

If you want to run your code on GNU/Linux or support multiple platforms, C++ is the better option. It's well supported across every major platform, and there are free open source tools aplenty to aid in development. You can even write a Windows C++ application inside of Linux with GCC cross-compilation and Wine for testing.

  • 0

c# is an open standard, mono is an implementation of that standard as it the .net framework. afaik

Actually it's not an open standard because Microsoft controls it and nobody else has input on it. It's a registered standard with EMCA, but that's as far as it goes. It's also patent encumbered, so there's a risk in the future that other implementations could get shutdown. It's best to avoid those headaches. At least C++ is a true open standard.

  • 0

I'm surprised nobody has said Java yet. Eclipse is a great free Java IDE, Java and C# are almost the same language, and Java is perfectly cross-platform, including GUI's.

I'm studying Applied IT and have been writing Java since september now. I've always used Eclipse with it, but I feel right at home in Visual Studio using C#. No reason to limit yourself to Microsoft with C# right from the beginning.

(in fact, C# is strongly 'inspired' on Java. But Java sort of forces you to write cleaner code (in my opinion), which will help you later on)

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Posts

    • But the reality is it will work for people's needs, and they don't care about the technology that makes it. Clearly not everyone's needs, but that low end space where personal laptops were only used to type emails, watch content and browse websites, but they didn't want to do that on a small screen device. Heck, writing that out I can now see the connection and reason it'll do so well. Apple is about experience. If the experience is bad, they don't release it. Low end Windows laptop manufacturers up until this point have not taken that into consideration ever before, so slow laggy usage with brittle slimey plastic shells were common. I hope that the low end space at least creates better physical products that last a bit longer, and if Microsoft get their act together, they could also have a solid OS on such low end hardware that would actually make the experience work for what the hardware was intended for. The fact that the CPU is a "cellphone", sorry mobile phone processor is irrelevant. It's about the experience, and so far, that sounds quite solid.
    • Hello, Bonjour is Apple's implementation of a multicast-DNS service, which allows devices running Apple's software and/or hardware to find each other on your local network.  I believe the Windows version was last updated around 2010. If you do not need it, you can stop and disable the Bonjour service in the Services Control Manager (filename: SERVICES.MSC).  Once you have done that, the operating system will no longer attempt to load the service. Regards, Aryeh Goretsky  
    • This AMD RX 9070 16GB GPU that performs close to Nvidia 5070 is under $600 by Sayan Sen With the memory shortage that's prevalent nowadays, discounts are super-hard to get. As such we post good deals whenever they pop up. Recently, we covered a few great discounts on SSDs wherein you can get a 4TB TeamGroup NVMe PCIe Gen4 drive for just $400 thanks to a special coupon. If you want a faster product but don't need all that capacity, you can also opt for Samsung's 990 PRO 2TB that is on sale for its lowest price in over three months. Let's say though that you are on the hunt for a 1440p gaming card. In that case AMD's RX 9070 non-XT can help, and with its 16GB VRAM, you can also run AI models locally without worrying about bottlenecking (check out our recent 9070 GRE reviews for gaming and productivity to get an idea). The PowerColor Reaper variant of the RX 9070 is currently on sale for just $580 which is a very good price in the current state of affairs (purchase link under the specs table down below). The Reaper cooler on this 9070 uses a triple‑fan design with ring‑blade fans, paired with premium dual ball bearings to extend lifespan and reduce friction. "Intelligent" fan control allows the fans to remain idle at lower temperatures, only spinning up when the GPU is under load. A nickel‑plated copper base makes direct contact with both the GPU and memory modules, helping to spread heat evenly. PowerColor also applies Honeywell PTM7950 phase‑change thermal interface material (TIM), which fills microscopic gaps between the die and heatsink for more efficient thermal transfer. The fan shroud is shorter in height as the firm has made it such that it can be used in certain SFF (small form factor) cases. The technical specifications of the Reaper RX 9070 are given in the table below: Specification Value Stream Processors 3584 Units Video Memory 16GB GDDR6 Memory Speed 20.0 Gbps Memory Interface 256-bit Engine Clock Game Clock: up to 2070 MHz Boost Clock: up to 2520 MHz Bus Standard PCI Express 5.0 x16 Display Connectors 1 x HDMI 2.1b, 3 x DisplayPort 2.1a Maximum Resolution DisplayPort: 7680 × 4320 HDMI: 7680 × 4320 Board Dimensions 289mm × 111mm × 41mm 304mm × 127mm × 42mm (with bracket) Slot 2 Minimum System Power Requirement 600W Power Connectors Two 8-pin PCI Express Get the PowerColor Reaper RX 9070 at the links below (you get only a 90-day warranty on Woot): PowerColor Reaper Radeon RX 9070 16GB Graphics Card (RX9070 16G-A): $579.99 (Sold and Shipped by Amazon US) (Was: $700) PowerColor Reaper Radeon RX 9070 16GB Graphics Card (RX9070 16G-A): $559.99 (Sold and Shipped by Woot US) Good to know This Amazon deal is U.S. specific, and not available in other regions unless specified. We only use first-party seller links (at the time of article publishing); ensure that you purchase from a first-party seller link only. Check out Today's Deals on Amazon | or our recent tech deals. Become a Prime member (for Students or SNAP) via Neowin Get Prime Access - Prime for half price (for qualifying Medicaid, EBT, SNAP) Subscribe to Prime Video, Audible Plus, Music Unlimited or Kindle Unlimited via Neowin As an Amazon Associate, we earn from qualifying purchases.
    • Are they marketed as an entry into astronomy or astrophotography? I do astrophotography. With big rigs, lots of computers, cables and headaches. I love it. And by learning this ridiculously complex hobby, I’ve learned about the objects I’m shooting. Astronomy followed from photography.
    • Microsoft confirms Recycle Bin bug across all versions of Windows by Usama Jawad A couple of days ago, we reported that the latest Patch Tuesday update has seemingly resulted in a lot of issues for many users, including OneDrive and Dropbox access problems, BitLocker recovery lockouts, and BSODs. Although Microsoft is yet to acknowledge these bugs, it has confirmed another, relatively smaller issue across all supported versions of Windows. In an update on its Windows Release Health Dashboard, Microsoft has confirmed that after installing June's Patch Tuesday update (KB5094126), you'll experience unexpected behavior when leveraging Recycle Bin. Basically, when you attempt to delete an item from the Recycle Bin, the confirm dialog will show you the internal file name of that content rather than the actual name. For example, the file may be named abc.png, but the confirm dialog will ask if you're sure that you want to permanently delete $Rxxxxx.png from the Recycle Bin. This is pretty much it for the scope of the bug itself; it just displays the wrong name in the confirm dialog. The correct name will be shown in the list view of the Recycle Bin and if you restore the file, it will return with the correct name as well. This issue affects pretty much all supported versions of Windows client and server, including: Client: Windows 11, version 26H1; Windows 11, version 25H2; Windows 11, version 24H2; Windows 11, version 23H2; Windows 10, version 22H2; Windows 10 Enterprise LTSC 2021; Windows 10 Enterprise LTSC 2019; Windows 10 Enterprise LTSB 2016 Server: Windows Server 2025; Windows Server 2022; Windows Server 2019; Windows Server 2016; Windows Server 2012 R2; Windows Server 2012 As things currently stand, Microsoft is working on a concrete solution that will be released in a "future" Windows update. It remains to be seen if the firm will wait till the next Patch Tuesday or roll out an out-of-band (OOB) fix. The good news is that commercial customers can deploy a workaround right now, but they will have to reach out to Microsoft Support for Business for additional details.
  • Recent Achievements

    • Week One Done
      Jordan Smith earned a badge
      Week One Done
    • Reacting Well
      BizSAR earned a badge
      Reacting Well
    • First Post
      AndreaB earned a badge
      First Post
    • Week One Done
      Huge Trailer earned a badge
      Week One Done
    • Week One Done
      Classifyskilleducation earned a badge
      Week One Done
  • Popular Contributors

    1. 1
      +primortal
      578
    2. 2
      +Edouard
      184
    3. 3
      PsYcHoKiLLa
      75
    4. 4
      Michael Scrip
      72
    5. 5
      neufuse
      64
  • Tell a friend

    Love Neowin? Tell a friend!