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, 10:08 am

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Hello everyone
#22
RE: Hello everyone
(April 9, 2010 at 10:26 pm)Tiberius Wrote: This web page: (your URL) 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.
I haven't used Java in a pretty long time, so maybe some things have changed. I'll look into that.

I'm clumping these quotes together because they all have the same response...
(April 9, 2010 at 10:26 pm)Tiberius Wrote: 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.

(April 9, 2010 at 10:26 pm)Tiberius Wrote: 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...
I know that, but that is only true for built-in types. Now what happens when you write your own math class like Point, Vector2/3, Matrix, etc.? Then you are not able to use those operators, because, how will Java know what to add, multiply, etc.? That was my whole point. You have to write methods to do it for you.

(April 9, 2010 at 10:26 pm)Tiberius Wrote: 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.
Almost always, that will be the same thing in C++. Someone could potentially use it for something else (that's what is so great about C++), but why would they? They will most likely implement the equivalent of multiplication for their type.

(April 9, 2010 at 10:26 pm)Tiberius Wrote: 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.
And it generally does. It generally is used "to check if the left-value is equal to the right-value". But again, the beauty of C++ lets the user do whatever he would like with the == operator.

You could do the same thing in C++ using pointers, and in that case, the "==" is always the same. This is where the argument seems to drift apart. Java, and most other high object-oriented languages, hide the pointer from you and call your object a reference (and rightfully so, of course). C# does the same thing. However, C# took the smart route and inverted Java's method. Operators are overloadable and the base Object class has a few virtual methods such as "Equals", which can compare references. So, if we use pointers in C++ to do what Java does, it works exactly the same. But again, we still have the option to use our overloaded operator by dereferencing the pointer. I don't want to get too technical, but here is an example of my point.

Code:
int *x = &a;
int *y = x;

if (x == y) { .. } // this is a reference equality check
if (*x == *y) { ... } // this is a value equality check

MyWeirdClass *x = &a;
MyWeirdClass *y = &b;
if (x == y) { ... } // this is a reference equality check, our '==' operator is NOT called.
if (*x == *y) { ... } // this is a value equality check, which means it'll call our '==' operator.

(April 9, 2010 at 10:26 pm)Tiberius Wrote: 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).
You missed my point. The Point class, as a whole, would implement operators such as "+" and "==". Unless Point is a built-in type (which it probably is, but this is just an example), you cannot check if the two points are equal without expanding it out to what I showed above, instead of simply doing:

Code:
if (point1 == point2) { ... }

as that would compare the references, not the values. That is why operator overloading is useful. Imagine if Java didn't implement a Matrix class (it probably did, I don't know) and you had to write your own. Your class would have to implement "add", "subtract", "multiply", etc. methods to do operations on the matrix, which should naturally be written out as a multiplication symbol, addition symbol, etc.

(April 9, 2010 at 10:26 pm)Tiberius Wrote: 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.
I absolutely love Visual Studio when programming on Windows. For PHP, and all of those other similar languages, I use notepad++ because I don't care too much for the bulk of a full IDE. However, when developing on Linux I tend to use (depending on my mood) either gedit or Code::Blocks. But no way in hell would I choose Code::Blocks over Visual Studio if I am compiling/working on Windows. Even if my project is cross-platform, I still create a Visual Studio project for Windows, and generally just have a makefile for linux.

(April 9, 2010 at 10:26 pm)Tiberius Wrote: 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...
I meant "they must be regretting it now" jokingly, only semi-serious. .NET has taken a lot of competition from Java, including on mobile devices, however. Probably not enough to hurt Sun, but Microsoft has in fact taken some of the competition. I wasn't saying that C# vs. Java wasn't a fair comparison. I was saying that Java vs. Mono was an unfair competition.

What you were doing was comparing another company's funded implementation of the language to that implementation of the original developer. Compare Microsoft's implementation of C# to Sun's implementation of Java, not Novell's implementation of Mono to Sun's implementation of Java. That's all I meant. I never agreed that Novell did a bad job at implementing it either, I was in no way blaming that company for anything. I'm not sure where you got that from. And yes, Novell is funding the porting of .NET, so they did take the responsibility of mono - keep that in mind. But again, I'm not blaming Novell for anything. I, for one, think they've done a great job and I'm glad they ported silverlight and .NET.

(April 9, 2010 at 10:26 pm)Tiberius Wrote: 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.
I never said that C++ was exactly a "low-level" language. I said it was low-levelish by today's standards. So are you saying that ASM (NASM, for example) isn't a low-level language (it does 'compile' (depending on what you mean by that word))?

(April 9, 2010 at 10:26 pm)Tiberius Wrote: 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
Again, I never said it was. I said I considered it "low-leveish" compared to the higher leveled languages we have today.
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 2017 June 27, 2020 at 9:31 am
Last Post: Fireball
  Hello Everyone! Chicken 33 3089 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
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 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
Brick Hello to everyone Wryetui 23 5196 May 4, 2016 at 9:27 pm
Last Post: ignoramus



Users browsing this thread: 2 Guest(s)