Jump to content

Actually my question is more about the language than the coding itself


G+_Christophe Vandingelen
 Share

Recommended Posts

Actually my question is more about the language than the coding itself.

 

What makes c better than, for example, c#? I mean, with the pointers it's better for that you can control the memory of your program, but isn't that what you trust to let c# handle correct for you?

 

And more general would even be, witch one is better? C or c#?

 

Everyone can answer of course, but I especially like to know what you think about this, Louis Maresca?

Link to comment
Share on other sites

C is over 40 years old, mature and well understood, available everywhere from many different vendors (and free sources), and is especially suited for low-level system pogramming. The Linux kernel is written in C. Python and many other languages are written in C. I use C to write code for chips that have only 1k of memory. But it requires you to do manually things that higher level languages do for you, like memory management, hash tables, OO design, and such.

 

So there are several languages based on C but with higher level features: C++, Objective C, D, C#, Go. They all have strengths and weaknesses like all languages. C#'s greatest weakness is that it is closely tied to Microsoft Windows technologies. Objective C isn't as closely tied to MacOS, but that's where it has become standard.

 

I'm personally a big fan of Go. Created by many of the same folks instrumental in C and Unix, it has modern features and quality libraries implemented simply without the cruft of C++. It's also new, so there not as much experience with it as with others.

Link to comment
Share on other sites

Which language to use, between C and C#, is dependent upon what it is that you are trying to do.  If it is purely a Windows program employing the graphical interface with the end user, then C# via Visual Studio would be the better choice. If it is project for an Arduino, then C is it.  

 

The best tool is dependent upon the task at hand. Personally I am really comfortable with C having learned it in the late 80's. I have done a lot of programming on both UNIX and MS-DOS systems with it.

 

If you are just learning programming, you cannot go wrong by learning C as it is available on almost every platform, from Arduinos to Macs.

Link to comment
Share on other sites

As someone who's been using C for 35 years; C was designed to run "close to the metal". The language features of traditional C closely match the design and features of a traditional microprocessor. That is both it's strength and it's weakness - a strength because it lets you write fast, powerful code, and a weakness because it positively, absolutely, does not protect you from making mistakes.

 

Languages like C# are valuable because they make it easier to translate your ideas into code and they help protect you from many kinds of coding mistakes.

Link to comment
Share on other sites

C compiles to a native executable so its speed is second only to assembly. C# compiles to intermediate code that requires a large run-time library to run the program. Under Windows, you deal directly with the Windows API with C but C# insulates you from this with its .NET classes so the code is more portable. They key is to pick the right tool for the job.

Link to comment
Share on other sites

 Share

×
×
  • Create New...