Hello all , I've been learning C++ for 3 months till now and I was thinking about learning another language besides C++ !! I am thinking about Java because its technology allows its programs to run on almost all platforms :):)
So tell me Ur Opinions , thoughts :)
Well, you can learn Java, but it's really so similar to C++ that it will hardly be a revelation. I find it somewhat easier to "think" object-oriented in Java, and it has some runtime features that C++ doesn't have, but lacks other things I like in C++ (templates for instance are just syntactic sugar in Java, and not nearly as powerful as in C++, and the lack of operator overloading can be quite annoying sometimes because something like matrix1.mult(matrix2.mult(matrix3))) just looks silly).
If you want to learn something for fun, try a functional language.
If you like C++, you'll hate Java. All variables are passed by value to methods and there are many immutable types in Java that would be much more convenient in Mutable form. There are loads more things I hate about it but I won't go into details.
I recommend learning it. Its disgusting essence is being used more and more frequently.
If you like C++, you'll hate Java. All variables are passed by value to methods and there are many immutable types in Java that would be much more convenient in Mutable form.
Actually, all non-primitive types are passed by reference in Java, and the only type whose immutability can be annoying sometimesis String, but that's because a String is not a char array in Java.
> Well, you can learn Java, but it's really so similar to C++ that it will hardly be a revelation.
> If you want to learn something for fun, try a functional language.
+1
Learning a functional language is more than just fun. It is also a way of discovering many new programming techniques; techniques that programmers who have programmed only in the C based languages tend to miss out on.
@CMinus, Java is a fine languages, but I suggest sticking with C++ a bit more. I don't think there is any good in switching languages every few months, especially if you are new to programming in general.
and the programming market is moving seeing some expansion in the mobile domain.
Which means its only a matter of time until someone gets around to a decent C and C++ compiler for these platforms. :)
If you want another language, learn something that will complement what you already have. Something different, in which you won't still be thinking in C++ and writing it in different notation, but something that actually makes you think about problem solving in a whole new way. How about a functional programming language?
What if you print i at the end of DoStuff? I guarantee it will print 2.
Yes it is immutable, and thus a new one has to be made for each autounbox and autobox operation, so the fact that i is passed by value makes it impossible to have the intended result of changing the value of i outside the function.
Now I have a question: Why in the world are the wrapper classes immutable? It's very annoying...
If they were mutable, they'd exhibit different behavior from primitive types. Primitive types are mutable, but only by assignment, so if you'd get the output 2 then Integer would behave differently from the type it's supposed to wrap, which would be a bug.
Well Guys I think I will stick to C++ until I understand The OOP Programming concepts well & master the syntax :)
Maybe after 3 or 4 Months I will try to learn Functional Language like Lisp Or Haskell Or maybe I will play a little with Web Development :)
Now I have to look after my annoying study (I hate the subjects I take WTF!!).