Programming Language

<p>I'm thinking of self-studying a programming language over the summer, I was wondering which one would be more worthwhile/easier to learn, C/C++ or Java.</p>

<p>Thoughts?</p>

<p>Why are you learning a programming language?</p>

<p>The easiest: Java, C++, C (in that order).
The most useful: C++, Java, C (in that order).</p>

<p>Basically, I would recommend C++ if you plan on doing hardware-related things, and java if you’re into math and theory. Remember, this is only your first language. You definitely want an object-oriented language that supports good software engineering practice.</p>

<p>Avoid C as your first language. It will turn you into a procedural nightmare.</p>

<p>Self-interest, really. Always curious if I liked it, and it wasn’t until like, this year where I felt dedicated to do things (yeah, late , but still). </p>

<p>What’s so bad about C?</p>

<p>I like Math and Theory, so I’ll think about Java. Thanks for the input!</p>

<p>Auburn, where does objective-c fall in the mix? I know java, but I’ve been teaching myself obj-c so i can do some little fun apps on the iPhone.</p>

<p>A question (directed at Xav):</p>

<p>Are you going to be a CS/CompE major?</p>

<p>Silence: No.<br>
Chem E, actually.</p>

<p>Oh, then AuburnMathTutor’s advice is pretty solid.</p>

<p>Still, I’ll give a (maybe inappropriate) recommendation.</p>

<p>Warning: the book I will recommend below may be a little ambitious for a programming beginner to self-study from. It is a lot of material. In some sense, though, it is not so bad because it truly starts with the basics (the 0’s and the 1’s !!!).</p>

<p>That said, if you want to learn quite a bit about computers (and also how to program in C ! ), I recommend working through the book Introduction to Computing Systems: From Bits and Gates to C and Beyond.</p>

<p>If you like math/theory, I would avoid books that start from bits/gates/low level stuff and I would avoid C – those things will get you bogged down in on the hardware programming. If you want to be able to think about algorithms & data structures without having to worry about memory management and other icky things then go with Java. Java is a good language to start with.</p>

<p>Yeah, probably learning how to program in Java would be more useful. It may not be worth it to learn a little bit about how computers work if you aren’t going to be a CS/CompE major. Still . . . it’s a pretty good book . . .</p>

<p>the most useful language in the real world is VBA… Ask patrick bateman</p>

<p>

</p>

<p>C++ and Java more useful than C. I bet. Go find me a language that has done what C has done for computing, then come back and talk. </p>

<p>C is the most useful, functional, solid language ever to be created. To many it is computings second crowing achievement only second to the Turing machine. It is simply the best language ever created, and untill something is created that works as fast and is as flexible nothing else will compare.</p>

<p>There is a reason it is still #2 after nearly ~40 years.
<a href=“http://www.tiobe.com/index.php/content/paperinfo/tpci/index.html[/url]”>Home - TIOBE;

<p>Yeah, C rules. It’s a pretty simple language, so in that sense, learning it as your first wouldn’t be too overdaunting. However, it kind of forces you to know a little bit about computers, because the abstractions it offers aren’t as nice as, say Java. </p>

<p>Xav is a non-CS major who just wants to learn how to program in a language over the summer. I think Java is a language that he could jump into and get stuff done with.</p>

<p>If you want to really learn what the computer is doing and play with bits, go with C.</p>

<p>If you want something that will be useful in the real world, and relatively easy to learn the rudiments of, one that you can start doing stuff with pretty quickly, go with Java or maybe Python.</p>

<p>If you want something in between those two options, go with C++.</p>

<p>If you want something very math/theory-ish where you can make interesting data structures, play with lambda calculus, etc, go with Scheme.</p>

<p>Also, because I thought it was hilarious:</p>

<p>“One Div Zero: A Brief, Incomplete, and Mostly Wrong History of Programming Languages”
<a href=“http://james-iry.blogspot.com/2009/05/brief-incomplete-and-mostly-wrong.html[/url]”>http://james-iry.blogspot.com/2009/05/brief-incomplete-and-mostly-wrong.html&lt;/a&gt;&lt;/p&gt;

<p>Useful to the OP, not useful in general. A new programmer would get nothing but headaches and bad habits from starting with C.</p>

<p>btw: I’m big on OOP, so C is pretty much dead to me.</p>

<p>With C, it depends on how it is taught. It can be taught well but it’s way more work than starting with the OO languages. I work in a place with 35 million lines of C code. There is so much legacy C code around and lots of jobs where you need to be close to the hardware that having a good understanding of C is a benefit.</p>

<p>I know some people say otherwise, but I don’t think going from C++ to C is very hard at all. A few syntactical nuances, no objects, and a little more low-level behavior, and you’re there.</p>

<p>I, for one, would imagine that it’s actually harder to go from C to C++ with OOP… oh well.</p>

<p>

</p>

<p>Why do you say this?</p>

<p>Well, when the SE community moved to OOP and other higher-level paradigms, C became sort of a dinosaur, needed for legacy coding and low-level stuff.</p>

<p>I’m very biased, though, as I prefer the OOP/procedural varieties (C++, Java) to pure procedural (like C). I even prefer declarative (functional / logic) to pure C, when they are appropriate.</p>

<p>I feel that C is too low-level, too dangerous, and too lacking in modern SE features to be considered a general-purpose (especially teaching) language. Not that it’s a bad language, not that you can’t write good programs in it or even learn to be a good programmer by teaching yourself the language, just that I feel that other options are better… namely, C++ (which, to be frank, is an improvement over C in just about every way I can think of, except some very esoteric ones) and Java (a much more modern language with all the benefits that entails).</p>

<p>If you weren’t a fan of OOP, and if you were doing low-level things, then I suppose you could do a lot worse than C. idk.</p>

<p>Oh, and the headaches and bad habits comment:</p>

<ul>
<li>pointers (a problem in C++ too, granted)</li>
<li>memory management (also a problem in C++)</li>
<li>spaghetti code (more a problem with pure procedural code than in general with OOP)</li>
<li>poor scoping choices (possible in C++ as well, but avoidable… much more likely to happen in straight C)</li>
</ul>

<p>By comparison, using C++ with OOP can be beneficial because it can ease memory management (locating memory allocation / deallocation in constructors / destructors), it can reduce errors with pointers (objects can sometimes make pointers unnecessary, and when not, they can at least be encapsulated and partioned off from the rest of the code), it can help in avoiding spaghetti code (instead of thinking in terms of system functions, you can think in terms of things an object can do, which may simplify things), and scoping can usually be made much neater (clean interfaces between objects, less reliance on global scope, increased referential transparency, in a sense, etc.)</p>