This is an archived, read-only copy of the United-TI subforum , including posts and topic from May 2003 to April 2012. If you would like to discuss any of the topics in this forum, you can visit Cemetech's Calculator Programming subforum. Some of these topics may also be directly-linked to active Cemetech topics. If you are a Cemetech member with a linked United-TI account, you can link United-TI topics here with your current Cemetech topics.

This forum is locked: you cannot post, reply to, or edit topics. General Coding and Design => Calculator Programming
Author Message
JoeImp
Enlightened


Active Member


Joined: 24 May 2003
Posts: 747

Posted: 15 Oct 2008 04:47:16 pm    Post subject:

Quote:
Java is similar to C and C++ only insofar as it uses curly braces. It's a rather different language, with a different design philosophy. (Gone are the undefined behaviour pitfalls of C and C++, as well as the horrible compilation model). I'm a big fan of C# (which is very clearly based on Java's ideals), which fixes some of the problems of Java (like its generics implemented as a compiler hack).


.... lol.
Back to top
JoeImp
Enlightened


Active Member


Joined: 24 May 2003
Posts: 747

Posted: 15 Oct 2008 04:56:07 pm    Post subject:

Quote:
You get as much power in other languages, however it's not as easy to accidentally shoot yourself in the foot in the process as with C or C++.


I love this philosophy, it's like wanting a fast car and your friend recommends a minivan to you because you might kill yourself in a fast car. And if you had as much power in other languages why are 99% of all crucial/major systems coded in either C/C++.
Back to top
benryves


Active Member


Joined: 23 Feb 2006
Posts: 564

Posted: 15 Oct 2008 05:03:46 pm    Post subject:

JoeImp wrote:
.... lol.
[post="127888"]<{POST_SNAPBACK}>[/post]
Care to elaborate? :P

C and C++ both suffer from a convoluted compilation model that even assembly programmers don't have to put up with. Would you not agree that the requirement for header files for forward declaration is rather silly, given that other languages can do fine without them?

As for undefined behaviour, what does i = i++; do? ;)

Java at least tries to get it right, but its "generics" (I use the term as loosely as possible) are an example of where it went a bit wrong. A generic list in Java is actually a list of object internally, with the compiler inserting the necessary casts in place. This technique, type erasure, means that if you then use reflection to look at the type of that list, you can only see that it's a list of objects.

.NET took the other route, which was to add support for generics to the actual runtime. A list of ints is, in fact, storing ints, not boxing them as objects. When you perform reflection on that list, you can identify that correctly.
Back to top
benryves


Active Member


Joined: 23 Feb 2006
Posts: 564

Posted: 15 Oct 2008 05:09:48 pm    Post subject:

JoeImp wrote:
Quote:
You get as much power in other languages, however it's not as easy to accidentally shoot yourself in the foot in the process as with C or C++.


I love this philosophy, it's like wanting a fast car and your friend recommends a minivan to you because you might kill yourself in a fast car. And if you had as much power in other languages why are 99% of all crucial/major systems coded in either C/C++.
[post="127890"]<{POST_SNAPBACK}>[/post]
Chiefly, legacy codebases. I know people maintaining systems in VB6 and COBOL for this unfortunate reason.

More importantly, are there many things in C or C++ that you can't do in "minivan" languages?
Back to top
JoeImp
Enlightened


Active Member


Joined: 24 May 2003
Posts: 747

Posted: 15 Oct 2008 05:56:59 pm    Post subject:

Anything that has to be in any way computation heavy, time critical, or stable. And yes, C++ is much more stable than Java / C#, even if you can "shoot yourself in the foot." Program correctly and you're fine. Id love to see the a mars lander or such try and come in for a landing using Java/C#, right in the middle of calculations it decides to randomly garbage collect, system hangs, and lander crashes. And I don't have any problems with the compilation model, it makes logical sense.
Back to top
benryves


Active Member


Joined: 23 Feb 2006
Posts: 564

Posted: 15 Oct 2008 07:36:00 pm    Post subject:

.NET is not suited for time-critical apps, you are correct there. Its current incarnation also lacks support for SIMD intrinsics, so its runtime performance can be below that of native code, so I'll agree with you there. I don't see either of those as especially important features for general-purpose programming languages, as few people are dealing with real-time operating systems and its performance is certainly good enough as it is.

JoeImp wrote:
And yes, C++ is much more stable than Java / C#, even if you can "shoot yourself in the foot."
How exactly are you quantifying "stability"?

And, just to chuck a few terms back at you: reflection, attributes, properties, implicit types, anonymous types, lamdba expressions, extension methods, proper booleans, runtime code generation, events, namespaced enums. Smile
Back to top
simplethinker
snjwffl


Active Member


Joined: 25 Jul 2006
Posts: 700

Posted: 15 Oct 2008 08:00:02 pm    Post subject:

We should probably get back on topic... There are already enough C++ vs. Java vs. everything else threads Smile
Back to top
sgm


Calc Guru


Joined: 04 Sep 2003
Posts: 1265

Posted: 16 Oct 2008 02:13:06 am    Post subject:

simplethinker wrote:
We should probably get back on topic... There are already enough C++ vs. Java vs. everything else threads  Smile
[post="127907"]<{POST_SNAPBACK}>[/post]

No, this is shaping up to be a a entertaining colloquy.

But I will split the thread off.
Back to top
Display posts from previous:   
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
    »
» View previous topic :: View next topic  
Page 1 of 1 » All times are UTC - 5 Hours

 

Advertisement