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.
I'm itching to learn how to program, maybe even make a career out of it eventually (without a computer science degree, I'm not sure how possible a career is). Careers aside, however, I think programming can become a fun hobby that will help keep my mind sharp too.
Anyways, I'm looking into C, C++, and Java. It seems there are certain advantages and disadvantages to each, but I'd like to learn a language that is, perhaps, more marketable and widely used of the three. That's probably very subjective, but I'm hoping for some feedback.
I was thinking it might actually be better if I learn the fundamentals of each language in the order of C, C++, then Java. Maybe that approach would help me decide which language I should stick to.
Also, what common types of programs should an intermediate programmer be able to produce?
Any recommended books for people in my situation? Are there standard development methodologies I should understand before I start?
The two best books ever! The internet is also a good source to find stuff out, just google it!
If you still need help (with C/C++), or would just like it explained in person, please feel free to e-mail me anytime (The_Nerd@linuxmail.org). I would be happy to help you out! Have fun and goodluck!
As for starter programs:
File converters,
Simple text based apps,
rrrrrrr windows just sticked me>>>>
I know both C++ and Java quite well. The choice between the two isn't easy since each has advantages and disadvantages. To give you the best career chances, I would suggest that you learn both. It isn't as difficult as it sounds.
Start with C++. The two books you should have are C++ How to Program , and The C++ Programming Language. The first is great for beginners that do not know any programming. The second is the ultimate C++ reference, which should be a part of any serious C++ programmer's library.
If you decide to learn C++ I wouldn't waste my time on C, unless you have a compelling reason (e.g. you want to get into embedded software development, in which case you'll also need to learn a lot about computer architecture, and might as well go back to school and get a CS or EE degree!)
If you want a comparison of C++ and Java let me know and I could throw something together for you.
Google for it, or its abbreviation TICPP. Its available as a free download, so its well worth the price. (I think there might be some Java books available on his website too.)
Originally posted by eric.r.turner If you decide to learn C++ I wouldn't waste my time on C, unless you have a compelling reason (e.g. you want to get into embedded software development, in which case you'll also need to learn a lot about computer architecture, and might as well go back to school and get a CS or EE degree!)
What the heck are you talking about??? C++ IS C upgraded! Thats why its called C++, meaning the next version, or C incremented by one. C++ is simply a better C.
Personally if your just learning I would begin with C. The reason is that both C++ and Java contain quite a bit of C. I recommend C before C++ simply because C is largly a subset of C++ and it would be beneficial to know the differences. It would be much harder to remember the dividing line between C and C++ if you leaned C++ first and then C I think. Also you would not be wasting learning time because C contains all the basics of C++ that you would need to know anyway. After C I recommend C++ before Java. Once you know C++ then moving to Java will be much easier. I suspect you'd get more headaches going from Java to C++. There is no reason why you shouldn't aim to be able use all three languages, they do share many common themes.
learn C you have learned structured programming methodology.
learn C++ you have learned object oriented programming methodology.
when u have learnt both, JAVA would seem too easy to learn..
I think if you learn C first, then move on to either C++ or Java. Once you've learned one of Java and C++ I would imagine learning the other would be pretty easy (compared to learning from scratch anyway).
Originally posted by The_Nerd What the heck are you talking about??? C++ IS C upgraded! Thats why its called C++, meaning the next version, or C incremented by one. C++ is simply a better C.
Though they are very close, C++ is not purely a better C. Stroustrup identifies some of the differences in Appendix B. For example:
Code:
int x[99];
void f()
{
struct x { int a; };
sizeof(x);
}
This code actually behaves differently in C and C++! In C you get the size of the array, but in C++ you get the size of the structure.
More importantly, there are idioms that a good C programmer typically uses that a good C++ programmer does not, even though it is legal in C++. String handling is a good example. A C programmer uses null-terminated arrays of characters and the stdio library functions (and sometimes even directly manipulates the arrays and uses pointer arithmetic) whereas a good C++ programmer uses the string class and streams. Memory management is also done differently in the two languages.
The differences are not difficult to learn, but the C++ programmer wanting to program in C will need to learn the way things are done in C (strings, libraries, memory management, etc.) Of course, you lose the OO paradigm in C, so that takes a different way of thinking about program design. Is it worth spending the time to learn these differences if you have no compelling reason to?
Of course, the learning curve for a C programmer wishing to learn C++ is tremendous: classes, templates, streams, additional keywords, namespaces, casting, libraries, etc.
Last edited by eric.r.turner; 06-06-2004 at 05:21 PM.
Hey everyone, thanks for all your input! This has been really great for me. I think I will learn the basic concepts of C++ and then learn everything else in Java (rumor has it that Java could be open sourced in the near future).
Oh, is there such a thing as C++ or Java certification? I don't have time to go back to school, sadly, but I'm thinking that maybe if I get certified and pass an exam, that might help me.
Originally posted by simsjr Oh, is there such a thing as C++ or Java certification? I don't have time to go back to school, sadly, but I'm thinking that maybe if I get certified and pass an exam, that might help me.
Thoughts?
For Java, check out http://suned.sun.com/US/certification/java/index.html . I'm not sure about a C++ certification. Most employers will look at certification as a good thing, though it is no substitute for experience. At the very least, earning a certification can be very educational. I learned a lot becoming a Sun Certified Programmer for the Java 2 Platform.
If I need a visual program I normally program in Java. Java has the advantage being portable over the different os (at least, should be). When something must be fast and a visual interface is not required, I take C/C++.
Visual programming in C++ depends strongly on the os!
The reason for this is, that the java compiler creates a bitcode, which is close to machine language (but os independent). Executing a Java bitcode, means that the bitcode is interpreted by a Java Virtual Machine.
For a beginner Java might be easier because Java don't allow you to program dubious code (ex: pointers).
Java might be 'easier' in terms of not breaking things but its library is too big to fit in your head. That's why I recommend C. It's compact, small and you learn a lot from all the things you blow up.
Steps to successful programming
1 read a lot of code
2 write a lot of code.
3 GOTO 1
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.