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 25, 2024, 10:45 pm

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Hello everyone
#21
RE: Hello everyone
(April 9, 2010 at 9:47 pm)cppman Wrote: 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.
This web page: http://www.bearcave.com/software/java/why_native.html discusses the native code compilers for Java, but also some interesting benchmarks that suggest the performance of Java is actually in a lot of cases better than C++, due to the amount of work that has gone into the JVM, compared with some failures in C++ compilers to create efficient native code.

Quote:That's the point. Depending on the needs of your type, you can implement whatever operators you'd like.
You shouldn't have to though, that is the point of consistency. A '+' should always "add" things, whether you are adding together two integers, or two strings (concatenation). A '*' should always multiply, etc, etc.

Quote: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.
Begging your pardon, but this is clearly an absurd example. In Java, if you multiply, you use * (not a Multiply() method) and if you add, you use + (not an Add() method). I'm not sure what experience you have with Java, but if you are honestly suggesting this is how things work, I suggest you take another look...

The idea behind consistency is that a programmer can pick up a piece of code, and know exactly what it is doing by looking at it. If you have to learn what * does under a multitude of different types, then the simple code:

Code:
a * b

could mean any number of things. In Java, it means one thing: a multiplied by b.

Quote: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.
Yes, you should know. However in terms of consistency, knowing shouldn't matter, the == should behave the same way for every object. In fact, checking the reference of an object using == is very useful when coming to design patterns. The Singleton pattern requires it in Java (to detect whether an Object is null), and so you could argue that == is useful for checking the reference of every object in this instance.

Quote: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.
That isn't overloading. X and Y are variables within the class, and if they are primitive types (which they are in Java if I recall - integers) then you are checking the reference (which returns the value stored by the variable).

Quote: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
I want an IDE I can actually use. What is the point of having an IDE that only runs on Windows if I want to take my work home from the office and I run Linux or Mac? In my opinion, a good IDE should support multiple Operating Systems. If you only use Windows-only programming languages, then I can understand why you'd love Visual Studio more than anything else. I use three different operating systems with different languages that are all multi-platform (Java, Ruby, PHP); I need a powerful IDE, and that would be NetBeans.

Quote: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#.
Well it is a fair comparison. Java is designed to run on multiple operating systems...C# has yet to implement that feature. I love the logic of blaming a company that doesn't have any responsibility to port these things across though...good show. Novell port things because Microsoft don't want to.

You originally said that Sun must have been regretting the decision that led to Microsoft making C#. Well, C# still isn't multi-platform, so it isn't a competitor to Java in that field. It's only an unfair comparison if you asume that C# wasn't a competitor to Java, which you seem to think it was...

Quote: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#
A low-level programming language runs on a specific instruction set architecture with little to no abstraction. It also doesn't have a compiler since it is written for the processor.

C++ isn't written for a specific instruction set (it is compiled down to one), contains abstraction, and has a compiler. Ergo, not a low-level programming language in any sense of the word Tongue

Heck, even C is a high level programming language (although most people like to call it "middle" level).
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
Smile Hello, everyone Rolls 21 2016 June 27, 2020 at 9:31 am
Last Post: Fireball
  Hello Everyone! Chicken 33 3088 December 25, 2018 at 10:57 pm
Last Post: Peebothuhlu
  Hello Everyone :) , { Just an ape trying to socialize } Enlightened Ape 31 6667 April 24, 2018 at 1:22 pm
Last Post: Enlightened Ape
Wink 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 4454 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
Brick Hello to everyone Wryetui 23 5195 May 4, 2016 at 9:27 pm
Last Post: ignoramus



Users browsing this thread: 1 Guest(s)