ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I really enjoy linux and the philosophy it has with it and someday want to contribute back to the community. I was wondering which language I should focus on learning C++ or C#. I have no experience in either of those languages. I really hate bloated software, and I have heard C++ performs better. (Things like fluxbox are programmed in it I believe) However, C# is supposed to be the thing of the future, and automatic garbage collection is a nice plus.
EDIT:
Found my answer C++ DEFINATELY. I have another thread dedicated to what material I should use.
Thanks for your help!
Last edited by Super TWiT; 03-28-2010 at 02:21 PM.
Click here to see the post LQ members have rated as the most helpful post in this thread.
C# is a nice language (I like programming in it), and you can open source your code in any language. Mono would be your only real runtime choice outside of the MS world, however - and it tends to lag development by quite a bit.
C++ would be the better choice, though I must mention that GCC/G++ is a freaking mess. You'll end up making quite a few tweaks to optimize your code for the compiler rather than the other way around. You might want to try clang or some of the other ones.
I was wondering which language I should focus on learning C++ or C#.
I think MS has a strong track record of trying to pervert standards to sabotage software development on non MS platforms. They tried and failed with C++ and I think the C++ standard is now far beyond their power to pervert that way. They tried, came a lot closer, but still failed with Java. That standard may also be beyond their control at this point.
I think C# exists for the original purpose of giving MS another shot at taking control of an important standard so they can pervert it later to the detriment of the rest of the software industry. I think they still are in control of future changes in the C# standard.
For any development on Linux, one advantage to C++ over C# is the lesser (not zero, unfortunately) influence of MS on the future directions of the language standard.
I also think C++ is a fundamentally better language than C#.
Quote:
I have heard C++ performs better.
When performance matters, C++ performs enormously better. The many comparisons "proving" the performance difference is smaller are distortions primarily based on examples where performance doesn't matter.
Quote:
automatic garbage collection is a nice plus.
Those are fighting words, meaning that once someone makes a serious comment agreeing or disagreeing with that statement, the thread tends to get taken over by an argument on that question and no-one ever convinces anyone. I disagree with your statement about automatic garbage collection, but I'd rather not have that fight again nor here.
Stick with c++. I've been using c# for about a year now and though I have developed a proficiency, I haven't developed any fondness for the language or any of its attributes. I don't believe it will catch on outside of MS for many reasons. Indeed, I have one project that I've spent about a month on now (a fairly simple service that communicates with serial devices, a database, and a web-based configuration) in c# and I'm going to scrap that code and write it in c++. The aggravations are just too many and I've reached a point of diminishing return.
Yeah, I guess that answers my question. I was leaning towards c++ anyway, and have heard a lot about the lack of openess. I really don't want to get tied in to .net. I guess it really doesn't matter if it is "newer" because c++ is still going strong, and will be especially on non microsoft platforms. I had in my mind that c# would outmode C++, but C++ didn't outmode C. I am going c++ all the way. Any good gcc tutorials I should look at? I have how to think like a computer scientist c++ edition. It teaches generic c++ programming
Yeah, I guess that answers my question. I was leaning towards c++ anyway, and have heard a lot about the lack of openess. I really don't want to get tied in to .net. I guess it really doesn't matter if it is "newer" because c++ is still going strong, and will be especially on non microsoft platforms. I had in my mind that c# would outmode C++, but C++ didn't outmode C. I am going c++ all the way. Any good gcc tutorials I should look at? I have how to think like a computer scientist c++ edition. It teaches generic c++ programming
C# is definitely not outmoding C++. It's probably put a nice dent in VB, though.
Especially for beginning C++ programming there isn't enough specific to gcc that you need to learn to even call that learning. There is a lot to learn about C++, but it is not specific to gcc.
In choosing your C++ tutorial, you will want to make sure you are selecting one that is not based on MFC nor .net nor Visual Studio.
You might want to select an IDE such as KDevelop or code::blocks. In that case, you would have an easier time with a C++ tutorial that is specific to the IDE you select.
I was just wondering if there was anything more tailored to g++.
My point was that "tailored to g++" isn't even a meaningful concept for a C++ tutorial.
There is nothing specific to g++ (other than the simple command to compile a program) that should be used or learned by a beginner.
You should be far more advanced in C++ programming before you have any interest in __attribute__ or any other features that are part of g++ but not part of generic C++.
This is in contrast to MS C++. A tutorial tailored to MS C++ would probably use MFC or .net or other MS specific features that wouldn't be available in generic C++.
A generic C++ tutorial shouldn't use MS specific features. That is all the tailoring to g++ you should want (simply not being tailored to MS).
As I said before, you might want to use an IDE. In that case it is very helpful to choose a tutorial tailored to that IDE. GCC is compatible with many different IDEs.
Also, you might want to write GUI and/or graphics programs early in the process of learning C++. If so, you should choose a GUI and/or graphics tool kit and choose a tutorial based on the tool kit.
MS C++ bundles all that in, so learning GUI or graphics with MS C++ probably means learning the MS specific GUI or graphics tools.
There is no GUI/graphics in generic C++ nor is there any GUI/graphics support specific to GCC. GCC is compatible with many different GUI/graphics tool kits.
Seriously just start with a solid IDE and work the basic C, then C++ tutorials. Don't worry about advanced stuff at this point.
Once you need them you can start learning the compiler eccentricities for whatever platform
I would recommend the opposite - learn to do programming without an IDE. And, if you wish, without a debugger. These are sure ways to learn to first think and only then do.
I'd go one further and suggest try to avoid IDEs at all cost, they promote a lot of really, really bad working habits and practices, and are way too resource intensive for what they are; a glorified text editor.
As for your main question; out of the two I'd recommend c++; it is more widely used in the community, and it isn't tied to one vendor; this allows for a much better language community. Much wider at the very least.
If I were to suggest another similar language, though, for my money it always has to be c. Its logically more sound (to me at least), it is a lot simpler than the others, it is quick, and it is fantastic to learn; you make a mistake, it is your mistake and no one elses.
I'd go one further and suggest try to avoid IDEs at all cost, they promote a lot of really, really bad working habits and practices, and are way too resource intensive for what they are; a glorified text editor.
As for your main question; out of the two I'd recommend c++; it is more widely used in the community, and it isn't tied to one vendor; this allows for a much better language community. Much wider at the very least.
If I were to suggest another similar language, though, for my money it always has to be c. Its logically more sound (to me at least), it is a lot simpler than the others, it is quick, and it is fantastic to learn; you make a mistake, it is your mistake and no one elses.
It has also been a standard for what, 38 years?
Depends on what you consider an IDE
I consider Vim and Kate IDEs - not that Eclipse and Xcode don't serve a purpose ( I guess ).
The point is though, use something with syntax highlighting and you'll be on a good start. Something that uses fixed width fonts, especially.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.