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: July 28, 2025, 6:16 pm

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Hello everyone
#20
RE: Hello everyone
(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 Java Tongue
They 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++) { ... }
for (iterator i = something.begin(); i !=something.end(); 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 saying Tongue
Ha. How could you possibly ask that after you've used XNA in Visual Studio!? C# is a very beautiful language in Visual Studio. Smile

(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 versa Big Grin
Eh, 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. Sad

All this talk about programming languages makes me want to write my own now. That should be a fun project, for a while...
Reply



Messages In This Thread
Hello everyone - by cppman - April 8, 2010 at 4:30 pm
RE: Hello everyone - by Autumnlicious - April 8, 2010 at 4:55 pm
RE: Hello everyone - by fr0d0 - April 8, 2010 at 5:25 pm
RE: Hello everyone - by Minimalist - April 8, 2010 at 6:39 pm
RE: Hello everyone - by Tiberius - April 8, 2010 at 6:45 pm
RE: Hello everyone - by cppman - April 8, 2010 at 8:33 pm
RE: Hello everyone - by Minimalist - April 8, 2010 at 8:52 pm
RE: Hello everyone - by Autumnlicious - April 8, 2010 at 9:05 pm
RE: Hello everyone - by Minimalist - April 8, 2010 at 9:23 pm
RE: Hello everyone - by The_Flying_Skeptic - April 8, 2010 at 9:12 pm
RE: Hello everyone - by Disinter - April 8, 2010 at 9:47 pm
RE: Hello everyone - by cppman - April 8, 2010 at 10:10 pm
RE: Hello everyone - by Tiberius - April 9, 2010 at 8:49 am
RE: Hello everyone - by cppman - April 9, 2010 at 2:02 pm
RE: Hello everyone - by Tiberius - April 9, 2010 at 2:09 pm
RE: Hello everyone - by cppman - April 9, 2010 at 2:28 pm
RE: Hello everyone - by Tiberius - April 9, 2010 at 3:33 pm
RE: Hello everyone - by cppman - April 9, 2010 at 6:14 pm
RE: Hello everyone - by Tiberius - April 9, 2010 at 7:02 pm
RE: Hello everyone - by cppman - April 9, 2010 at 9:47 pm
RE: Hello everyone - by Tiberius - April 9, 2010 at 10:26 pm
RE: Hello everyone - by cppman - April 9, 2010 at 11:33 pm
RE: Hello everyone - by Tiberius - April 10, 2010 at 12:45 am
RE: Hello everyone - by cppman - April 10, 2010 at 2:00 am
RE: Hello everyone - by Tiberius - April 10, 2010 at 2:59 am
RE: Hello everyone - by Edwardo Piet - April 14, 2010 at 10:25 am
RE: Hello everyone - by Tiberius - April 14, 2010 at 12:40 pm
RE: Hello everyone - by fr0d0 - April 14, 2010 at 2:09 pm
RE: Hello everyone - by Minimalist - April 14, 2010 at 2:17 pm
RE: Hello everyone - by cppman - April 15, 2010 at 8:20 pm
RE: Hello everyone - by Minimalist - April 15, 2010 at 9:29 pm

Possibly Related Threads...
Thread Author Replies Views Last Post
  Hello everyone Dredon 4 260 June 16, 2025 at 10:09 am
Last Post: Thumpalumpacus
  Hello To Everyone TravestNiggle 8 1736 June 8, 2025 at 4:08 pm
Last Post: MR. Macabre 666
  Hello Everyone Zymurgy 5 814 May 28, 2025 at 8:04 am
Last Post: Gwaithmir
  Hello Everyone! Rift Zone 9 1387 May 22, 2025 at 1:26 pm
Last Post: Pat Mustard
  Hello everyone GANIBALxD 9 1446 March 18, 2025 at 5:15 pm
Last Post: MR. Macabre 666
  Hello, Everyone I Am Hugh 14 2158 February 23, 2025 at 3:56 am
Last Post: Belacqua
Smile Hello, everyone Rolls 21 3019 June 27, 2020 at 9:31 am
Last Post: Fireball
  Hello Everyone! Chicken 33 4252 December 25, 2018 at 10:57 pm
Last Post: Peebothuhlu
  Hello Everyone :) , { Just an ape trying to socialize } Enlightened Ape 31 7931 April 24, 2018 at 1:22 pm
Last Post: Enlightened Ape
Wink Hello Everyone! rskovride 15 3358 February 21, 2018 at 5:45 am
Last Post: ignoramus



Users browsing this thread: 1 Guest(s)