Ah C++, extremely useful language. Perhaps I'll take time to learn a little for hobbyist purposes. Welcome
Our server costs ~$56 per month to run. Please consider donating or becoming a Patron to help keep the site running. Help us gain new members by following us on Twitter and liking our page on Facebook!
Current time: December 26, 2024, 11:09 am
Thread Rating:
Hello everyone
|
I hate C++. Java FTW!
Did you just say you hated Apple? *takes deep breath*
What don't you like about Java exactly? RE: Hello everyone
April 9, 2010 at 2:28 pm
(This post was last modified: April 9, 2010 at 2:36 pm by cppman.)
Absolutely.
As for why I don't like Java... 1. It is fully interpreted as opposed to being compiled JIT (like C#), which makes it slower (and uses more resources). 2. The syntax is terrible (camel-case method names and uncomfortable "imports"/packaging for people coming from C++). 3. No operator overloading. 4. Reference comparison as opposed to value comparison when using the string class and "==" operator. 5. No good IDE (in my opinion, which includes NetBeans). 6. I don't like original crap Sun pulled with Microsoft back when Microsoft developed a Java VM.
1) You can actually compile it down to byte-code, but that isn't the point of Java. Java is meant to run on any platform
2) You can create methods with non camel-case if you so wish. The syntax is similar to that of C++ anyway. There are a few minor differences, but you'll find them with any two languages designed to do different things: http://www.cprogramming.com/tutorial/jav...a-c++.html 3) That is a good thing. 4) Everything in Java is an object since it's an object oriented language from the bottom up. The == operator by default compares the two objects (s it should). With Strings, you can use the equals() method to compare the values. I don't see how this is any different from strcmp()? 5) NetBeans is an epic IDE!!! What's wrong with it? 6) I have no idea what you are talking about. Anyway, the operation of a corporation doesn't have any bearing on how good the language is... RE: Hello everyone
April 9, 2010 at 6:14 pm
(This post was last modified: April 9, 2010 at 6:20 pm by cppman.)
(April 9, 2010 at 3:33 pm)Tiberius Wrote: 1) You can actually compile it down to byte-code, but that isn't the point of Java. Java is meant to run on any platformJava compiles to its own byte-code, not the byte-code of the host machine. It can run on any platform which Java is compiled for. And don't forget that the Java compiler was written in C/C++. Therefore, any platform Java exists on, so can C++ (aside from the fact that some mobile devices have licensing issues). (April 9, 2010 at 3:33 pm)Tiberius Wrote: 2) You can create methods with non camel-case if you so wish. The syntax is similar to that of C++ anyway.I'm referring to the built-in libraries. Yeah, Java itself has the same syntax as C, C++, C#, etc. (April 9, 2010 at 3:33 pm)Tiberius Wrote: 3) That is a good thing.Not in my opinion. Operator overloading is a very useful (and powerful) feature in C++ and C#. (April 9, 2010 at 3:33 pm)Tiberius Wrote: 4) Everything in Java is an object since it's an object oriented language from the bottom up. The == operator by default compares the two objects (s it should). With Strings, you can use the equals() method to compare the values. I don't see how this is any different from strcmp()?"strcmp" is C, though it could still be used in C++. C++ strings (from the STL) overload the '==' operator for string comparison. So does C#, and it is Object-Oriented from the bottom up. Rarely does someone want to compare the underlying pointer of a reference. They want to compare the value. Hence, Java should have implemented a "referenceEquals" (or similar) method and made the "==" a value-equality operator like every other language. In the cases where a "value" can't exactly be determined (or shouldn't be), the "==" can fall back on the "referenceEquals" method. (April 9, 2010 at 3:33 pm)Tiberius Wrote: 5) NetBeans is an epic IDE!!! What's wrong with it?I'm too used to Visual Studio (the most amazing IDE ever), so I suppose that gives me a lesser view of NetBeans. (April 9, 2010 at 3:33 pm)Tiberius Wrote: 6) I have no idea what you are talking about. Anyway, the operation of a corporation doesn't have any bearing on how good the language is...A long time ago Microsoft distributed it's own Java virtual machine with Windows. Sun decided to sue Microsoft, and then Microsoft was forced to stop distributing it. Because of that, Microsoft developed .NET which became extremely popular. (I bet Sun is wishing they never forced Microsoft into that direction right now...) And you're right about the quality of the language having nothing to do with this. But with all my other reasons, this is just something that adds to it. Same thing with Apple. Along with my other reasons, I cannot stand the company itself. But all that aside, I'm a low-level programmer (ASM, C, C++) so naturally it is hard for me to like any high level language (C# excluded), or any interpreted language for that matter. Just personal opinion I guess. (April 9, 2010 at 6:14 pm)cppman Wrote: Java compiles to its own byte-code, not the byte-code of the host machine. It can run on any platform which Java is compiled for. And don't forget that the Java compiler was written in C/C++. Therefore, any platform Java exists on, so can C++ (aside from the fact that some mobile devices have licensing issues).No, there are compilers that compile Java down to the host machine byte-code. Yes, any platform Java exists on, C++ can run on too, but the point is that you have to compile your C++ program for that platform, whilst you don't for Java, which is the bonus you get when using Java Quote:I'm referring to the built-in libraries. Yeah, Java itself has the same syntax as C, C++, C#, etc.Ok, but even so, it is good to have consistency in any programming language. If you know that all methods in Java libraries are Camel Case, then you only have to remember that fact and you don't have compilation errors (although if you use an IDE it will alert you anyway). I see it as a moot point to be honest; it's just nitpicking that doesn't affect the functionality or usability of the language in the slightest. Quote:Not in my opinion. Operator overloading is a very useful (and powerful) feature in C++ and C#.The problem I have with operator overloading is consistency. You have the same operators doing different things depending on the type of the variable you are using. All these uses could equally just be made into different methods, so I fail to see how it makes C++ powerful and Java not. You can do the same things with methods in Java that you can with overloading operators in C++. Quote:"strcmp" is C, though it could still be used in C++. C++ strings (from the STL) overload the '==' operator for string comparison. So does C#, and it is Object-Oriented from the bottom up. Rarely does someone want to compare the underlying pointer of a reference. They want to compare the value. Hence, Java should have implemented a "referenceEquals" (or similar) method and made the "==" a value-equality operator like every other language. In the cases where a "value" can't exactly be determined (or shouldn't be), the "==" can fall back on the "referenceEquals" method.Again, it's consistency that is argued for. The == operator should have one purpose, and if it can be used on all objects, that purpose should be similar to all objects. The only such thing that all objects share is a reference, so == becomes the check for references. As you say, there aren't values associated with some objects, so it becomes absurd to use == for value checking. It also flies in the face and purpose of object orientation. Objects are containers for values, not values themselves. If you are dealing with objects, you may have multiple different values assigned within them, so the == operator is messy if used in this way. Quote:I'm too used to Visual Studio (the most amazing IDE ever), so I suppose that gives me a lesser view of NetBeans.If it's the most amazing IDE ever why doesn't it run on multiple platforms...just saying Quote:A long time ago Microsoft distributed it's own Java virtual machine with Windows. Sun decided to sue Microsoft, and then Microsoft was forced to stop distributing it. Because of that, Microsoft developed .NET which became extremely popular. (I bet Sun is wishing they never forced Microsoft into that direction right now...)Well I didn't know about that, cheers for the info. I don't see what the problem is with the suing though; if Sun make a product and don't want competitors from infringing their rights to the product, they have every right to sue. As for .NET, it still can't be run on multiple platforms, so I'm not so sure that Sun regret their decision (actually, I know a guy at Sun, and so I know they don't regret it!). Quote:And you're right about the quality of the language having nothing to do with this. But with all my other reasons, this is just something that adds to it. Same thing with Apple. Along with my other reasons, I cannot stand the company itself.Well I can't stand Microsoft, but I don't use that as a reason for not using C# or Visual Basic. I've used them in the past (XNA mainly) and whilst it is as easy to use as Java, it lacks the power of Java in terms of reliability and usability (on other platforms). Quote:But all that aside, I'm a low-level programmer (ASM, C, C++) so naturally it is hard for me to like any high level language (C# excluded), or any interpreted language for that matter. Just personal opinion I guess.Well C++ is a high level programming language with low-level features, as is Java (just with less low-level features). But yeah, I guess it is hard for low-level programmers to make the jump to high-level and like it...and vice versa RE: Hello everyone
April 9, 2010 at 9:47 pm
(This post was last modified: April 9, 2010 at 9:50 pm by cppman.)
(April 9, 2010 at 7:02 pm)Tiberius Wrote: No, there are compilers that compile Java down to the host machine byte-code. Yes, any platform Java exists on, C++ can run on too, but the point is that you have to compile your C++ program for that platform, whilst you don't for Java, which is the bonus you get when using JavaThey come with Java, or they are hacked together programs? Either way, C# does as well - and it actually comes with .NET. But yes, having to have a few macros in a config header for your C++ project can get annoying, but I still think the pros outweigh that minor annoyance. (April 9, 2010 at 7:02 pm)Tiberius Wrote: Ok, but even so, it is good to have consistency in any programming language. If you know that all methods in Java libraries are Camel Case, then you only have to remember that fact and you don't have compilation errors (although if you use an IDE it will alert you anyway).Of course. (April 9, 2010 at 7:02 pm)Tiberius Wrote: I see it as a moot point to be honest; it's just nitpicking that doesn't affect the functionality or usability of the language in the slightest.I'll give you that one. It doesn't affect usability at all, it is just something that bugs me. (April 9, 2010 at 7:02 pm)Tiberius Wrote: The problem I have with operator overloading is consistency. You have the same operators doing different things depending on the type of the variable you are using.That's the point. Depending on the needs of your type, you can implement whatever operators you'd like. (see next response) (April 9, 2010 at 7:02 pm)Tiberius Wrote: All these uses could equally just be made into different methods, so I fail to see how it makes C++ powerful and Java not. You can do the same things with methods in Java that you can with overloading operators in C++.An example would be the STL iterators. You can move to the next node by using the overloaded "++" operator. This flows naturally because when you traverse a list, you will almost always use a for-loop and increment "i". Yes, I know you could have an "iterator.getNext" method, but then you lose the natural flow and it feels like you just wrote a linked-list class. Code: for (int i = 0; i < 10; i++) { ... } Another example would be when using a Vector class. When you were using XNA, I'm pretty sure you didn't use a method to do all of your Vector and Matrix multiplication. It comes naturally to use them just like you would in math. Code: Vector pos = (x + y) * z + a; as opposed to Code: Vector pos = z.Multiply(x.Add(y)).Add(a); It just doesn't flow naturally and makes some things hard to debug. (April 9, 2010 at 7:02 pm)Tiberius Wrote: Again, it's consistency that is argued for. The == operator should have one purpose, and if it can be used on all objects, that purpose should be similar to all objects.In C++, it might not be able to be used on all objects. It is up to you to implement it. (April 9, 2010 at 7:02 pm)Tiberius Wrote: The only such thing that all objects share is a reference, so == becomes the check for references. As you say, there aren't values associated with some objects, so it becomes absurd to use == for value checking.You should know if the class has a value that can be checked for equivalence. So, it would be absurd to try to use "==" on a class that doesn't implement it in the way you expect it to. So as I said before, it is a "powerful feature" of C++ because it allows versatility and improvement in the flow of code to feel more natural. (April 9, 2010 at 7:02 pm)Tiberius Wrote: It also flies in the face and purpose of object orientation. Objects are containers for values, not values themselves. If you are dealing with objects, you may have multiple different values assigned within them, so the == operator is messy if used in this way.Not at all. Take a look at checking if two Points are equal. How do we check? If Point1.X == Point2.X and if Point1.Y == Point2.Y. That is how you would overload the "==" operator for the Point class. It actually compliments object-orientation, if you ask me. (April 9, 2010 at 7:02 pm)Tiberius Wrote: If it's the most amazing IDE ever why doesn't it run on multiple platforms...just sayingHa. How could you possibly ask that after you've used XNA in Visual Studio!? C# is a very beautiful language in Visual Studio. (April 9, 2010 at 7:02 pm)Tiberius Wrote: Well I can't stand Microsoft, but I don't use that as a reason for not using C# or Visual Basic.It's not the reason I don't use Java, it is just something that adds to the fire for me. (April 9, 2010 at 7:02 pm)Tiberius Wrote: I've used them in the past (XNA mainly) and whilst it is as easy to use as Java, it lacks the power of Java in terms of reliability and usability (on other platforms).That's not a fair comparison. .NET isn't naturally cross-platform. Novell just took it upon themselves to write a Linux port (called Mono, and Moonlight for Silverlight). So, if anything, blame Novell, not C#. (April 9, 2010 at 7:02 pm)Tiberius Wrote: Well C++ is a high level programming language with low-level features, as is Java (just with less low-level features). But yeah, I guess it is hard for low-level programmers to make the jump to high-level and like it...and vice versaEh, I really hate to call C++ a "high level" language. With the definition of a "high level" language now-a-days, I would consider it low-levelish with assembly being low-level. Here is my view (in order from low-level to high-level): ASM -> .. old languages .. -> C -> C++ -> C++ 0x -> Java -> C# I guess I shouldn't have said it was "hard". I just mean I can't stand a language that doesn't have low-level features, even if I never use them. It just annoys the hell out of me, for some reason. All this talk about programming languages makes me want to write my own now. That should be a fun project, for a while... |
« Next Oldest | Next Newest »
|
Possibly Related Threads... | |||||
Thread | Author | Replies | Views | Last Post | |
Hello, everyone | Rolls | 21 | 2017 |
June 27, 2020 at 9:31 am Last Post: Fireball |
|
Hello Everyone! | Chicken | 33 | 3091 |
December 25, 2018 at 10:57 pm Last Post: Peebothuhlu |
|
Hello Everyone :) , { Just an ape trying to socialize } | Enlightened Ape | 31 | 6668 |
April 24, 2018 at 1:22 pm Last Post: Enlightened Ape |
|
Hello Everyone! | rskovride | 15 | 2501 |
February 21, 2018 at 5:45 am Last Post: ignoramus |
|
Hello Everyone | Shai Hulud | 32 | 8950 |
May 14, 2017 at 12:04 pm Last Post: Shai Hulud |
|
Hello Everyone! | Driggs | 22 | 3196 |
April 12, 2017 at 10:29 pm Last Post: c172 |
|
Hello everyone | account_inactive | 25 | 4455 |
April 12, 2017 at 9:55 am Last Post: Brian37 |
|
Hello Everyone! | Flavius | 9 | 1536 |
March 30, 2017 at 6:54 pm Last Post: TheoneandonlytrueGod |
|
Hello everyone | Yoo | 11 | 2736 |
August 29, 2016 at 12:11 pm Last Post: account_inactive |
|
Hello to everyone | Wryetui | 23 | 5196 |
May 4, 2016 at 9:27 pm Last Post: ignoramus |
Users browsing this thread: 5 Guest(s)