Jump to content

What should I learn? C or C++?

Blueprint

Most companies now days are looking for .Net developers so that everything can be mobile and easily shared...

 

With that said, any programming language is a good starting point, in the end they are all equivalent and the difference in performance is usually irrelevant.

 

As mentioned a few other times, I would start with Python as it is relatively high level and allows you to implement things quickly and debug easily.

 

If performance is your goal or you want more low level control than C is the best choice.

 

I'm not sure how .NET developers create products that are "easily shared" or particularly "mobile." .NET is Windows specific (yes, Mono exists, but isn't in widespread use). .NET is really only wanted in companies that employ Microsoft software. If you want to lock yourself to one ecosystem, .NET is a good choice. But if you want to be able to work anywhere, it's better to write your business logic in a shared code base and just attach a native GUI to that interface to make things "easily shared."

 

Writing inline asm is not a bad idea. Also I did not misinterperet you. You miss-typed. If you meant that C++ is slow to write, then you are still wrong for the same reason. Its only slow if you are bad at it. And C++ does not intrisically have more overhead than C, you can write a program that compiles in either and they will be equally fast.

 

You are correct here. C++ only makes you pay for the features you use. If you were to compile plain C code with a C++ compiler, you would likely get identical (or very close to identical) performance from the C code compiled by a true C compiler. C++ does incur overhead when you begin to use abstractions, but that's part of the reason why people use C++. It affords the same low level capabilities as C, but allows you to use higher level abstractions. Definitely look into smart pointers (unique_ptr and shared_ptr) because they reference count the allocated memory and automatically dispose of it. This is called RAII or Resource Allocation is Initialization. It's an alternative to classic GC (which C++ DOES NOT have) and even works with file handles.

Link to comment
Share on other sites

Link to post
Share on other sites

Just learn both? If you're going to learn C++, you're going to basically be learning C at the start. Plus, the only C compiler I can find for windows is TCC (which is kinda questionable) so you're probably going to compile your code with a C++ compiler.

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×