PDA

View Full Version : Is Java a future proof language ?




fab5freddy
Feb 10, 2007, 07:43 PM
Hi, i have just started a computer science degree, and Java is the language we are going to be learning first. Are there any advantages or disadvantages of learning Java as your first language ? By the way, i live in Denmark, where 98 % of the country is a PC Windows world........
I have seen many companies starting to use C# instead......so jobwise, you probably have to know C# as well.....?

FF



Eraserhead
Feb 10, 2007, 08:05 PM
Once you know one computer language it's easier to pick up others like with Real Languages (English, French, German, Danish etc.).

bronxbomber92
Feb 10, 2007, 08:05 PM
C++ is the language in the industry as of now. Though many new companies are using C#, I don't think it will ever replace C++... Java, well, I don't know too much about it. My personal feeling I get from other people (if that makes sense ;)) is that Java is a good starter language, but will die outside of web development, and becomes too slow.

bousozoku
Feb 10, 2007, 08:12 PM
Java hasn't been the big solution to everything that Sun purported it to be originally. It's a very good language to know, along with C++ and C.

C# is a Microsoft creation that's basically Java without the security, so if you know Java, you should be able to learn C# quickly.

Future proof? Java continues to evolve since after 10 years, it's still a young language. Recently, Sun started to work to open up the language for standardisation, which will likely mean two things: there will be more input used to make it a better language and it will take years for it to be standardised.

It'll be around for a while. Plenty of businesses use it.

ChrisA
Feb 10, 2007, 08:44 PM
Hi, i have just started a computer science degree, and Java is the language we are going to be learning first. Are there any advantages or disadvantages of learning Java as your first language ? By the way, i live in Denmark, where 98 % of the country is a PC Windows world........
I have seen many companies starting to use C# instead......so jobwise, you probably have to know C# as well.....?

FF

Future proof?? Depends how far into the future. The first programming language I learned was FORTRAN in the 1970's. It is no longer main stream except in specialized areas but it's still going strong. I can say the same about Ada too. Ada was going to be the one language used for everything and now people only use it on mission critical real time projects in aerospace, transportation and nuclear power. (In other words in places where people die if the software crashes) I worked on some Cobol projects too, long ago but Cobol is not yet dead either. My guess is that java will be like the above. It will live "forever" but it's scope of use will become more and mre specialized.

If you are just starting out what you want to learn is "programming". Start with a widely used object oriented language. Learn it, use it and then the next language will be very easy. It's the concepts not the syntax that you need to learn. Java is not a bad first language, neither is C++. What you want is one that best illustrates the CONCEPTS that are being taught. One of my computer science proffs taught in a language that had no compiler. There was no way to run the code. Another one didn't care what language we used for a project. He said to just pick whatever best suited the task. I used PL/1 mostly and some Lisp and prolog. (Maybe you can guess my age?)

You don't need a "future proof" language. The effort you expend to learn will be easy to transfer to some other programming language later.

darkwing
Feb 10, 2007, 09:31 PM
I think Java is one of the worst languages in the world. Do I say this because it's particularly bad? No. I say it because it's generated more bad programmers than anything else I've ever witnessed. We had a lot of students in my school's CS department from an unnamed country who only liked to work with Java, did it poorly, and whined about pointers in their C classes. These people cheated like crazy (every student I ever caught cheating in my 5 quarters grading papers was in that group) and usually a class that started with 15 of them would have 1 or two at the end.

People try Java, make it print "hello world" and pop up a Window, and think they have what it takes to enter computer science.

Now, if you begin with Java and learn real OOP (object oriented design) principles and are taught it correctly, you can go far both with it and real languages.

The worst part about Java is the overhead that comes with a VM adding an extra layer to the software. The bad programmers it seems to generate only fuel the fire of slow crappy software.

With all the hub-bub about global warming, when will someone ask how much energy has been wasted (and the pollution to generate it) for wasted CPU cycles from interpreted high overhead languages like Java?

Oh, let me add that the JVM on OSX stinks. It runs about 10x faster on an equivalent Windows machine.

bobber205
Feb 10, 2007, 10:26 PM
What the above poster says is true.

What's weird, only a few people in my cs classes have used Java. I think it's incredibly intuitive to use, it's a good step up from BASIC languages. It was my step and the things it taught me about classes and stuff should carry me far in my future career.

And yes, Java on OS X blows. (See Azereus and memory consumption!)

rtharper
Feb 11, 2007, 12:36 AM
Hi, i have just started a computer science degree, and Java is the language we are going to be learning first. Are there any advantages or disadvantages of learning Java as your first language ? By the way, i live in Denmark, where 98 % of the country is a PC Windows world........
I have seen many companies starting to use C# instead......so jobwise, you probably have to know C# as well.....?

FF

The only dis/advantages in what your first language are purely pedagogical. It will dictate how you learn certain concepts. If you are starting a BSc. in CS, esp under the education system in Denmark, you will find that language selection will be the farthest thought from your mind by your senior year when you are looking for a job. All medium-to-high-level languages that descend from C have similar syntax, and transitioning from one to the other is fairly intuitive with a little bit of documentation.

The more important thing to learn, especially in undergraduate Computer Science, is programming techniques and theory (and don't neglect your math classes, they will provide more than you think). Program a lot, develop good habits, and know what the source code on your screen really means. Most software developers suck at this. They know a few languages, and maybe a few APIs. They very rarely understand the distinction between strongly typed and weakly typed languages, between lexical and dynamic scoping, between statically and dynamically typed languages, type safe versus non type safe, call by value versus call by reference versus call by need. When you understand these concepts, understanding the basics of any programming language only takes a few days of study (learning more takes more time, obviously).

People here talk about what the "industry" is doing. bronxbomber 92 claims C++ is THE language. I don't know what industry he is talking about, but I can tell you that you will see a lot more than JUST C++. You will see C, you will see Java, you will see Python, and probably a lot more (I worked on a project that involved Perl, C++, and C all in one application).

I can tell you that high paid software engineers transition gracefully across the platforms that change, and they change a lot. Java, C# and .NET, etc are all fads. They're important and relevant now, and it is worth the time to learn them to make yourself marketable. But, don't depend on your college education to give it to you. They will give you the tools to learn these things quite on your own or through internships or early jobs. And expect to see newer technologies that will exist alongside or replace these platforms and languages.

A lot of people think that the language matters and that you must start from square one with each language, or that one language will beat all, or that even one CLASS of languages will beat all. This is not the case. Most of these people are code monkeys that write poor code (and indeed, are the reason for the majority of software awfulness out there).

Keep in mind also that language is one aspect of the issue, and the other is platform. I have done operating system programming and GUI programming in C++. DRASTICALLY different, involving different libraries, etc. C# is a language that is made specifically for .NET, and learning the language is not the same as the platform on which it runs (I can write objects and methods in C# in my sleep, I am only right now getting comfortable with using them in the context of the .NET platform). Platforms change even more than languages. Don't worry about the "right" one, you'll see a variety of them over the course of your career. Learn the concepts behind them and you will find picking them up is much easier as you encounter them.

bronxbomber92
Feb 11, 2007, 12:47 AM
The only dis/advantages in what your first language are purely pedagogical. It will dictate how you learn certain concepts. If you are starting a BSc. in CS, esp under the education system in Denmark, you will find that language selection will be the farthest thought from your mind by your senior year when you are looking for a job. All medium-to-high-level languages that descend from C have similar syntax, and transitioning from one to the other is fairly intuitive with a little bit of documentation.

The more important thing to learn, especially in undergraduate Computer Science, is programming techniques and theory (and don't neglect your math classes, they will provide more than you think). Program a lot, develop good habits, and know what the source code on your screen really means. Most software developers suck at this. They know a few languages, and maybe a few APIs. They very rarely understand the distinction between strongly typed and weakly typed languages, between lexical and dynamic scoping, between statically and dynamically typed languages, type safe versus non type safe, call by value versus call by reference versus call by need. When you understand these concepts, understanding the basics of any programming language only takes a few days of study (learning more takes more time, obviously).

People here talk about what the "industry" is doing. bronxbomber 92 claims C++ is THE language. I don't know what industry he is talking about, but I can tell you that you will see a lot more than JUST C++. You will see C, you will see Java, you will see Python, and probably a lot more (I worked on a project that involved Perl, C++, and C all in one application).

I can tell you that high paid software engineers transition gracefully across the platforms that change, and they change a lot. Java, C# and .NET, etc are all fads. They're important and relevant now, and it is worth the time to learn them to make yourself marketable. But, don't depend on your college education to give it to you. They will give you the tools to learn these things quite on your own or through internships or early jobs. And expect to see newer technologies that will exist alongside or replace these platforms and languages.

A lot of people think that the language matters and that you must start from square one with each language, or that one language will beat all, or that even one CLASS of languages will beat all. This is not the case. Most of these people are code monkeys that write poor code (and indeed, are the reason for the majority of software awfulness out there).

Keep in mind also that language is one aspect of the issue, and the other is platform. I have done operating system programming and GUI programming in C++. DRASTICALLY different, involving different libraries, etc. C# is a language that is made specifically for .NET, and learning the language is not the same as the platform on which it runs (I can write objects and methods in C# in my sleep, I am only right now getting comfortable with using them in the context of the .NET platform). Platforms change even more than languages. Don't worry about the "right" one, you'll see a variety of them over the course of your career. Learn the concepts behind them and you will find picking them up is much easier as you encounter them.
I agree with you on pretty much all your points. I think I may have been a bit vague when I said THE language. I meant, C++ is used a lot, all over the board. Most likely you'll come across it *somewhere*. I'm not saying that won't find commercial and/or independent companies using other languages (most likely independent or small companies). But, many big name companies all ready have a huge foundation of code written in a certain language, and more times then not I would bet it's in C++. They aren't likely to switch languages just becuase.

All I'm was trying to say, is that C++ is a very widely used language and you're most likely going to have to learn it some time or another. I wasn't saying C++ is the only language though (thank god) :)

rtharper
Feb 11, 2007, 12:52 AM
I agree with you on pretty much all your points. I think I may have been a bit vague when I said THE language. I meant, C++ is used a lot, all over the board. Most likely you'll come across it *somewhere*. I'm not saying that won't find commercial and/or independent companies using other languages (most likely independent or small companies). But, many big name companies all ready have a huge foundation of code written in a certain, and more times then not I would bet it's in C++. They aren't likely to switch languages just becuase.

All I'm was trying to say, is that C++ is a very widely used language and you're most likely going to have to learn it some time or another. I wasn't saying C++ is the only language though (thank god) :)

Agreed! I realised that even as I was trying to invalidate your point, I was using my own experiences with C++ for points...

garidan
Feb 11, 2007, 02:22 AM
Java is the best language to start because it's complete:
- you learn OOP;
- you have plenty of free tools;
- you have plenty of docs and tutorials and code to copy & study;
- you write and run it everywhere (mac, pc, or linux, at home or work or your university) and it's consistent across OSes;

BUT best of all you can learn a lot more on multithreading, RPC, messaging (JMS),transactions etc.

C++ is good and used a lot, but as a language is a lot more difficult and full of "powerfull dark sides" (templates , pointers to pointers ...). And if you write something more than print "Hello", you need to use external libraries bound to a specific OS or non-standard framework.

As a student, you must learn a little of C first, and C++ if you have time, anyway in order to understand how a computer works and the tradeoffs dealt whith each choice.

As for business: java is not interpreted language, it's translated to assembly language when first run, is it X86-32bit or X86-64bit or powerPC or Sparc or Itanium.
C++ can't do it with one deployed binary.
As for RAM you are right: but we have 1 to 2 Gb nowadays, who cares about 20 Mb more for the VM ?

lazydog
Feb 11, 2007, 04:01 AM
Lots of good advice posted!

I'd just like to add that yes I think Java would be a good first language to learn. In fact there are lots of languages that would be a good first choice but that doesn't really matter. What matters is that *you* become a good programmer. Your first language will be used to learn the basic principles etc of programming. You don't have to stick with it the rest of your life! A good programmer, imho, would, by nature and curiosity, know more than one language.

b e n

janey
Feb 11, 2007, 04:49 AM
can you say legacy code?

anyway, the people above make the same points i would have made. java was my first programming language, but I'm fairly decent with a couple others now and I'm a noob at ruby and objc but im going at it :D Don't focus on the language, but on the concepts. They will serve you well :)

And just because your school is focusing on java (so is mine, and all the schools i want to transfer to), doesn't mean that you can't peek around at others and play around a bit.

Ruby's a fun awesome language if you need a place to start :)


edit: it's sorta weird that i spotted this thread right after having a particular conversation with someone...basically i'm learning ruby right now and exception handling in ruby is the same as exception handling in java except the syntax is different, AND ruby has keywords that Java also has that do something slightly different from what they do in Java (try/catch/finally or throw in java vs. begin/rescue/ensure or raise in ruby, and ruby ALSO has throw/catch but not for exception handling but java doesn't quite have anything like ruby's throw/catch) and oh my god it's so confusing. But I still understand exception handling and goto and all that fun stuff, so hey look, real life example :p

Xyl
Feb 11, 2007, 09:18 AM
My personal feeling I get from other people (if that makes sense ;)) is that Java is a good starter language, but will die outside of web development, and becomes too slow.

That's a very good point...but you also missed your own point. Maybe Java will be dead outside of web development, but is web development dying? Quite the contrary...

edit: Web development is not about making web sites, and more about viewing the Internet as a platform rather than an application, and a platform that is OS independent, scalable, and multi-user driven....things that are harder to achieve in desktop applications

rtharper
Feb 11, 2007, 09:27 AM
That's a very good point...but you also missed your own point. Maybe Java will be dead outside of web development, but is web development dying? Quite the contrary...

No, but it's also not what a Computer Science student should be learning in his undergraduate curriculum. Skills like that are vocational and not very useful in the long term because (as I mentioned before) the platforms change so rapidly.

I have to disagree with garidan about Java being 'great' as a pedagogical tool. It is a pure OOP language, and OOP has its place. Concurrency, multithreaded execution, RPC, etc, is not the place for it, esp when you are first taking the concepts from the abstract into implementation. I've programmed some HEAVILY parallel stuff in Java and other languages, and the Thread model in Java sucks hardcore. Even lightly multi-threaded apps require so much bureaucratic code it's hard to formulate the abstract idea of how you want to accomplish tasks in a multi-threaded environment. And RMI (my only experience with RPC) is cool, but also very limited in use as it incurs a lot of overhead and has limits because of Java's requirement that everything rigidly conform to its OOP model.

I hope that the original poster's program steers him away from Java when first learning any sort of concurrency. Sadly, most of the decently written parallel languages are a bit old, but I bet there's a SuperPascal compiler out there ;)

I will agree that C++ is evil, and I hope people abandon it somewhere in the near future for the majority of issues. Non-type-safe languages, as powerful as they are, should be not be the basis for MOST applications.

jsw
Feb 11, 2007, 09:33 AM
My first language was BASIC. Then FORTRAN, C, C++, and Java. I've dabbled in others. I agree that the single most important thing is learning how to write good, solid, robust, and efficient code. The language is secondary.

That said, I'm a big fan of Java. I understand that some, mentioned in posts above, are terrible Java programmers, but, of course, you can be terrible in any language. Java has its limits, true, but given recent (past few years) JDKs and modern computers, most any app can be written well using Java. And it's more platform independent than C/C++, includes GUI classes, and works well with web development. If I had to pick just one language now, it'd be Java.

But nothing you learn will be sufficient in 10 years, because languages evolve and emerge all the time. Concepts, though? Not so much. Names for concepts change all the time to promote new books. But the concepts remain.

Learn the concepts, pick a language to start with, try to write code you're proud of, and you'll be fine.

BigPrince
Feb 11, 2007, 09:35 AM
I supposedly learned some Java in my intro course. Now I am working on C++. Where are you attending? I am attending East Stroudsburg Univeristy for Computer Science and Computer Security.


Learn the concepts, pick a language to start with, try to write code you're proud of, and you'll be fine.

lol, are you a teacher in the real world? Thats why my C++ teacher says "make sure to hand in something your proud of' in his thick Russian accent.

darkwing
Feb 11, 2007, 10:49 AM
Java is the best language to start because it's complete:
- you learn OOP;
- you have plenty of free tools;
- you have plenty of docs and tutorials and code to copy & study;
- you write and run it everywhere (mac, pc, or linux, at home or work or your university) and it's consistent across OSes;

As for business: java is not interpreted language, it's translated to assembly language when first run, is it X86-32bit or X86-64bit or powerPC or Sparc or Itanium.
C++ can't do it with one deployed binary.
As for RAM you are right: but we have 1 to 2 Gb nowadays, who cares about 20 Mb more for the VM ?

It is an interpreted language in many cases, and only in certain deployments does it get "compiled." I'm not actually convinced we have JIT on OSX, which might explain why it's so slow. I haven't taken the time to research it. It still runs inside a VM, which adds overhead. I love it when Java fanboys try to say it's 500 times faster than C. :rolleyes:

Java is also not deterministic due to the fact that with JIT it's often translated when needed. It's like Rosetta, and we all know how slow that can be. OSX has this problem due to its runtime binding (rather than load time binding.) This is one of my major gripes with OSX.

And it's only OOP if you don't turn in assignments for your OOP class with everything inside the main function. I've seen that way too many times.

darkwing
Feb 11, 2007, 10:56 AM
I will agree that C++ is evil, and I hope people abandon it somewhere in the near future for the majority of issues. Non-type-safe languages, as powerful as they are, should be not be the basis for MOST applications.

This is the argument most Java fanboys use. C++ is bad because it's "hard to use." Don't blame a language because you're an incompetent programmer. C++ is mostly type safe, and where it isn't it can provide much flexibility. Regardless of that, there are many compilers that are stupid (won't enforce enum types for example) but a good compiler can be set up in such a way that it will enforce typing with warnings at least.

Janey had the best advice of all. Learn the concepts, not the language. Any good CS student can move to any language and work with it. I started an OOP with Java class 2 weeks late (added it) when I was an undergrad, and had never touched Java before. (I tried to avoid it.) By the end of the class, I was answering people's questions. I had been in the industry as a realtime systems programmer (and driver programmer) for 7+ years and was able to read a few things and get it. That's where you want to position yourself.

jsw
Feb 11, 2007, 10:58 AM
lol, are you a teacher in the real world? Thats why my C++ teacher says "make sure to hand in something your proud of' in his thick Russian accent.
Nah. But I don't see the point in deciding to be a software engineer if you don't feel pride in your work. :) Class assignments? That's not the same, and I see why people'd blow them off. But in general I wouldn't write code I wouldn't want others to see.
<Java stuff>
Yes, it's slower than C in most cases.

But it doesn't matter in most cases.

I write network management software used by most of the Fortune 500. It's all in Java, and it works fine. I wouldn't write games in it, or RTOS stuff, but most apps run well with it. And, yeah, it's slower on OS X and that irks me.

plinden
Feb 11, 2007, 11:19 AM
It is an interpreted language in many cases, and only in certain deployments does it get "compiled." I'm not actually convinced we have JIT on OSX, which might explain why it's so slow.
It's pretty fast on Intels. As fast as in Linux, faster than in Windows. Do you only have a PPC Mac? Or not used Java for over a year?

I haven't taken the time to research it. It still runs inside a VM, which adds overhead. I love it when Java fanboys try to say it's 500 times faster than C. :rolleyes:
Funny, I've never heard any Java "fanboy" say that. Most of us would agree it's as fast as C at some things, slightly slower at others, and very much slower at stuff you should use C++ for (string manipulation is a lot slower because you can't do pointer arithmetic hacks to get at the data). It's never going to be as fast as a natively compiled language, but as long you avoid the pitfalls that novice programmers fall into it will be not be noticeably slower, or use up tremendous amounts of RAM.

And I'm not talking about the String vs StringBuffer red herring here, which since JDK 1.3 is no longer an issue for 99% of cases. Rather things like using List where an array would be better and using List.indexOf and List.set(index), or picking the correct size for Lists and Maps, or over- and under-using synchronization, or premature optimization etc. Sure, there's a lot to learn to code decent Java apps (it's easy to write a Java application, but difficult to do it well) but that's the same for any decent programming language. And there are enough free profilers (like JProbe) out there, that so any programmer that fails to make use of one is being lazy or stupid or both.

And it's only OOP if you don't turn in assignments for your OOP class with everything inside the main function. I've seen that way too many times.

??? I think you'll find there's more to OOP than that.

darkwing
Feb 11, 2007, 01:13 PM
Nah. But I don't see the point in deciding to be a software engineer if you don't feel pride in your work. :) Class assignments? That's not the same, and I see why people'd blow them off. But in general I wouldn't write code I wouldn't want others to see.

Yes, it's slower than C in most cases.

But it doesn't matter in most cases.

I write network management software used by most of the Fortune 500. It's all in Java, and it works fine. I wouldn't write games in it, or RTOS stuff, but most apps run well with it. And, yeah, it's slower on OS X and that irks me.

I agree that it often doesn't matter if something is slower. However, you're wasting energy and CPU time that could need to go to something else someday. Imagine how frustrating it is when your java server suddenly needs to handle a thousand more users and can't because it's too darn slow. Good Java programming can be quite scalable, but this requires more hardware. And thus, more wasted energy. Let's conserve!

It's pretty fast on Intels. As fast as in Linux, faster than in Windows. Do you only have a PPC Mac? Or not used Java for over a year?

I have the latest C2D MBP. Before that I had a 1.67 ghz PB. I haven't done a lot of Java on the MBP. I didn't think that Intel vs PPC would matter. The fact is, I saw a Java game my friend wrote run perfectly with 10% of the CPU used on a 800 mhz pentium 3, while it ran like crap and took 100% of the G4. This is not right. Unless the JVM code from Windows (on x86) is somehow public, I really doubt that the intel JVM will even come close to competing because it isn't worth Apple's time to put so much research into it as Sun did for Windows. They sure ddin't spend more than $5 on it for the PPC.

Funny, I've never heard any Java "fanboy" say that. Most of us would agree it's as fast as C at some things, slightly slower at others, and very much slower at stuff you should use C++ for (string manipulation is a lot slower because you can't do pointer arithmetic hacks to get at the data).

Just because C++ can do something Java can't doesn't make it a hack. It simply makes it a much more flexible (and powerful) language.

http://www.kano.net/javabench/

This is the best link to show any Java fanboy how silly they are.

??? I think you'll find there's more to OOP than that.

Yes, I am just saying that Java doesn't force you to write in OOP because you can do what I described.

jhande
Feb 11, 2007, 01:23 PM
I have to disagree with garidan about Java being 'great' as a pedagogical tool. It is a pure OOP language, and OOP has its place. Concurrency, multithreaded execution, RPC, etc, is not the place for it, esp when you are first taking the concepts from the abstract into implementation. I've programmed some HEAVILY parallel stuff in Java and other languages, and the Thread model in Java sucks hardcore. Even lightly multi-threaded apps require so much bureaucratic code it's hard to formulate the abstract idea of how you want to accomplish tasks in a multi-threaded environment. And RMI (my only experience with RPC) is cool, but also very limited in use as it incurs a lot of overhead and has limits because of Java's requirement that everything rigidly conform to its OOP model.

Also, contrary to what most programmers think (and beginning CS students), there are other programming paradigms than procedural and OO. After more than 20 years churning out one type of code or another, I've gotten involved with a completely different paradigm: functional programming. Whether you work with Haskell or Erlang or.... I would recommend it go any CS student. It gives you a completely different take on software design.

leroymuc
Feb 11, 2007, 02:57 PM
It's as simple:

1. Computer science is not programming, so the language is actually just a tool and which one you use is not important at all. As a computer scientist you should be able to get used to new programming languages quickly. Don't expect to "learn" one language and then to stay with it for your lifetime.

2. Starting off with Java is a very good idea, since Java very, very clearly implements all concepts a modern programming language should offer. As opposed to languages like C++, Java forces you to use the features in the way they are intended (e.g. exception handling, inheritance, interfaces, ...).

3. C# is basically a Microsoft edition of Java. If you know Java, you almost know C#. It has some nice additions that go beyond Java, but they're nothing you can't learn by reading a few tutorials (not even a book).

Cheers.

darkwing
Feb 11, 2007, 03:07 PM
2. Starting off with Java is a very good idea, since Java very, very clearly implements all concepts a modern programming language should offer. As opposed to languages like C++, Java forces you to use the features in the way they are intended (e.g. exception handling, inheritance, interfaces, ...).

You could get all that with D and not have a horrible runtime component. Java is a bad idea because of how it was implemented. Even Sun won't use it for anything crucial.

http://www.archub.org/javamemo.txt
http://www.pcworld.com/article/id,109301-page,1/article.html

Java is a non-deterministic bloat machine, and anybody who would champion its usefulness for anything other than Fisher Price Baby's First Programming Language is no computer scientist.

leroymuc
Feb 11, 2007, 03:14 PM
Good Java programming can be quite scalable, but this requires more hardware. And thus, more wasted energy. Let's conserve!
Let's not be shortsighted. Do we live in a world of human brains that get more and more complex, powerful, and unfallible? No. We do live, however, in a world of increasingly complex problems to be solved. And we live in a world of computing technology evolving at an extremely high pace. Now, should we worry about the computers being overloaded or rather our brains?

The way to cope with high complexity is abstraction. Java (and other strictly object-oriented languages, like C#) is abstraction. That's all.

leroymuc
Feb 11, 2007, 03:22 PM
You could get all that with D and not have a horrible runtime component.
The problem is that in C and C++ you can, but you don't have to. Programming in a clean and modern way often seems overkill to beginners and if they are given a programming language that allows ugly, old-fashioned procedural coding, then they will go ahead and do it that way. Then, however, they will never appreciate the real advantages of clean OOP - as probably you never did.

Java is a non-deterministic bloat machine, and anybody who would champion its usefulness for anything other than Fisher Price Baby's First Programming Language is no computer scientist.
Hehe, that statement just adds to the impression that you have no idea what you're talking about, yet quite a big mouth. Actually I used to reason the same way before I really got deep into large-scale Java and C# projects.

darkwing
Feb 11, 2007, 03:23 PM
Let's not be shortsighted. Do we live in a world of human brains that get more and more complex, powerful, and unfallible? No. We do live, however, in a world of increasingly complex problems to be solved. And we live in a world of computing technology evolving at an extremely high pace. Now, should we worry about the computers being overloaded or rather our brains?

The way to cope with high complexity is abstraction. Java (and other strictly object-oriented languages, like C#) is abstraction. That's all.

Yes let's abstract Java and C# to the bin where they belong.

Are computers getting more advanced? Hrm. It's the same stuff from the 70s only getting faster and smaller. Where's the next big step? Atomic computing has not evolved to the level of general purpose yet. Multi-cores... yeah, a newer achievement but still another build on top of previous designs. Where's the next big thing? Oh well maybe it'll never come.

Java and other languages that run inside a VM provide nothing more to OO than a language like C++ does. Good programming practices and leaving a lot of things to the compiler reduce run-time overhead and make efficient code. Trying to say a language is good because it may help against the human element is ludicrous when you consider the runtime sacrifice.

Besides, if Java is so powerful and flexible why are JVMs written in C++?

The problem is that in C and C++ you can, but you don't have to. Programming in a clean and modern way often seems overkill to beginners and if they are given a programming language that allows ugly, old-fashioned procedural coding, then they will go ahead and do it that way. Then, however, they will never appreciate the real advantages of clean OOP - as probably you never did.

Let's see. For over 8 years I worked at a medical device company, and the last 4 years of that was for hard realtime embedded systems running on small footprint PCs under Linux. The realtime and kernel side was done with C (RTAI and kernel modules) while the GUI was done in c++. In 2000, I designed an entire set of GUI classes (framebuffer) for C++ and then abstracted that to work with other output devices. (An LCD screen over a parallel port, and curses for a text-based interface.)

Don't presume to tell me that I don't understand OOP.

Hehe, that statement just adds to the impression that you have no idea what you're talking about, yet quite a big mouth. Actually I used to reason the same way before I really got deep into large-scale Java and C# projects.

Oh yes, I don't know what I'm talking about. :rolleyes: Clearly you can't hold a real discussion so you're going to insult me instead.

Would you like a copy of some of the tests I wrote in java and c++? They're sorting algorithms. They also have the exact same syntax. On one of them, the c++ version was over 1000 times faster on my (at the time) 1 ghz g4 PB. Wow! :eek:

And as for the comment about the bloat? Well, guess which used less memory? (way less) :)

leroymuc
Feb 11, 2007, 03:50 PM
Let's not be shortsighted.

Are computers getting more advanced? Hrm. It's the same stuff from the 70s only getting faster and smaller. Where's the next big step?
You certainly have an idea of the number of abstraction levels in a modern computer nowadays (including the operating system). A computer in the 70s that was just a bit slower than today, as you point out, would not be able to cope with just two of them at a time. Another level of abstraction in the form of a virtual machine is negligible on the medium to long term. Thats all I'm saying.

darkwing
Feb 11, 2007, 03:59 PM
Let's not be shortsighted.

You certainly have an idea of the number of abstraction levels in a modern computer nowadays (including the operating system). A computer in the 70s that was just a bit slower than today, as you point out, would not be able to cope with just two of them at a time. Another level of abstraction in the form of a virtual machine is negligible on the medium to long term. Thats all I'm saying.

Some people consider an OS to be a VM. We discussed this in my undergraduate OS class. I do not consider an OS to be a VM because if this were true, then all processes would have a separate virtual cpu. While this may appear to be the case, the fact that there is only one set of page tables per CPU, these have to be swapped out often. This helps with the separation of processes yes, but adds tremendous overhead on what the CPU is capable of. Of course, we can't have a computer in today's world without this level of abstraction and thus it is necessary.

What Java and C# provide in its abstraction is not necessary, and thus becomes meaningless overhead.

I want abstraction where practicality and performance meet. Not for abstraction's sake.

rtharper
Feb 11, 2007, 06:00 PM
Also, contrary to what most programmers think (and beginning CS students), there are other programming paradigms than procedural and OO. After more than 20 years churning out one type of code or another, I've gotten involved with a completely different paradigm: functional programming. Whether you work with Haskell or Erlang or.... I would recommend it go any CS student. It gives you a completely different take on software design.

Exactly my point! =) I have found multi-paradigm and functional programming languages to be the best for complex tasks. If performance is number one they are not your best pick, although Haskell is very fast using the Glasgow Haskell Compiler. I use functional programming for tasks all the time, and something nothing is faster in terms of dev time, and the code is often extremely elegant. Python and Lua both offer certain benefits of functional programming languages, namely lazy evaluation and first-class functions, allowing the creation of higher order functions.


This is the argument most Java fanboys use. C++ is bad because it's "hard to use." Don't blame a language because you're an incompetent programmer. C++ is mostly type safe, and where it isn't it can provide much flexibility. Regardless of that, there are many compilers that are stupid (won't enforce enum types for example) but a good compiler can be set up in such a way that it will enforce typing with warnings at least.


Funny, my previous posts in this thread say I dislike Java, just that I dislike C++ even more. C++ is hard to use--It allows the programmer to make too many mistakes, as proven by the number of poorly coded applications written in it. Sure, it is quite possible to write solid C++ applications, and they exist, but I would go so far as to suggest that a language should facilitate this process if it is well designed, and that C++ does not. It's syntax is poorly suited to the OO paradigm, and don't get me starting on this like operator overloading, which in C++ allow such obfuscation as never before seen.

I have written full applications in C++ before--I hope I never repeat the process again (and as I go off to get my MSc and PhD, I will hopefully just be so terminally unemployable that it won't be an issue =p). Is Java better? In some ways. I always say choose the language that suits the task best, and I rarely find that to be C++, esp with C, Java, and C# around (as well as higher level languages such as Haskell, Lisp, Python, and Lua).

rtharper
Feb 11, 2007, 06:04 PM
Some people consider an OS to be a VM. We discussed this in my undergraduate OS class. I do not consider an OS to be a VM because if this were true, then all processes would have a separate virtual cpu. While this may appear to be the case, the fact that there is only one set of page tables per CPU, these have to be swapped out often. This helps with the separation of processes yes, but adds tremendous overhead on what the CPU is capable of. Of course, we can't have a computer in today's world without this level of abstraction and thus it is necessary.

What Java and C# provide in its abstraction is not necessary, and thus becomes meaningless overhead.

I want abstraction where practicality and performance meet. Not for abstraction's sake.

Most people would consider garbage collection and automatic memory management, plus completely cross platform libraries that run on any platform with a VM to be within the realm of practicality. And this isn't true for just Java. Look at Lua, Python, Haskell, Lisp, D...while platform specific libraries exist for these languages, so do a lot of platform independent ones. Can't say that I always feel the same about C++, esp for concurrency and Threads.

jsw
Feb 11, 2007, 06:24 PM
Java is a non-deterministic bloat machine, and anybody who would champion its usefulness for anything other than Fisher Price Baby's First Programming Language is no computer scientist.
Gosh. Guess all those web people aren't computer scientists.

Guess the large-scale software I work on is kiddieware.

Java is immensely useful. Anyone who bases the utility of a language solely on its performance characteristics is no software engineer. If such people are defined as "computer scientists", then my respect for that title has diminished.

Speed is only important when it is insufficient. Doing something 1000 times faster than it needs to be done isn't any better than doing it as fast as it needs to be done.

bobber205
Feb 11, 2007, 07:10 PM
Well put.

If what you do takes 2000 cycles in java or 200 is C++ but 1,000,000 cycles take a second, who really cares?

darkwing
Feb 11, 2007, 07:21 PM
Funny, my previous posts in this thread say I dislike Java, just that I dislike C++ even more. C++ is hard to use--It allows the programmer to make too many mistakes, as proven by the number of poorly coded applications written in it.

This is the "wah wah the language is too hard for me so let me stick with something easier" argument that makes me sick. :rolleyes:

Plenty of techniques out there to save yourself time and energy and prevent human error in c++.

darkwing
Feb 11, 2007, 07:24 PM
Gosh. Guess all those web people aren't computer scientists.

Guess the large-scale software I work on is kiddieware.

Java is immensely useful. Anyone who bases the utility of a language solely on its performance characteristics is no software engineer. If such people are defined as "computer scientists", then my respect for that title has diminished.

Speed is only important when it is insufficient. Doing something 1000 times faster than it needs to be done isn't any better than doing it as fast as it needs to be done.

Well then why can't we both be happy? Why can't Java be re-done so that the syntax and class structure are the same, but it doesn't run in a VM and it can be mapped to the platform/OS it's running on? Then all my problems with it go away.

Why does a language that makes kiddie programmers brag about not having pointers have NullPointerExceptions?

darkwing
Feb 11, 2007, 07:29 PM
Most people would consider garbage collection and automatic memory management, plus completely cross platform libraries that run on any platform with a VM to be within the realm of practicality. And this isn't true for just Java. Look at Lua, Python, Haskell, Lisp, D...while platform specific libraries exist for these languages, so do a lot of platform independent ones. Can't say that I always feel the same about C++, esp for concurrency and Threads.

Memory management and thread concurrency always seem to kinda "design themselves" every time I write a program of some sorts. I guess being competent means you don't have to use slow interpreted VM languages just so you can write some code.

Thank goodness Objetive-C 2.0's GC is optional. I consider that a best of both worlds scenario.

rtharper
Feb 11, 2007, 07:34 PM
Well then why can't we both be happy? Why can't Java be re-done so that the syntax and class structure are the same, but it doesn't run in a VM and it can be mapped to the platform/OS it's running on? Then all my problems with it go away.

Why does a language that makes kiddie programmers brag about not having pointers have NullPointerExceptions?

Because Java bases its memory management on garbage collection, uses a universal Thread concept that not only dictates the use of threads, locks, and semaphores, but also all of its RPC libraries and GUI libraries--that's the point. Java is syntactically similar enough to C++ that without these features it's pointless to exist on its own. And these features aren't trivial.

Your point about pointers shows a little ignorance. References are exposed in C++ (and called 'pointers') but they exist in nearly every high level language. Most languages more high level than FORTRAN and C are call by need or call by reference. Many of the naysayers of C++ point out that explicit pointers are probably one of the most issue-creating problems in C++. I myself am against the use of pointers as they are not type safe and make it impossible for the compiler to see a lot of errors that lead to unpredictable behaviour. I concede, however, that they are very powerful, but if you are doing that sort of manipulation I'd rather use C and cut out the OO overhead anyway.


This is the "wah wah the language is too hard for me so let me stick with something easier" argument that makes me sick.

Plenty of techniques out there to save yourself time and energy and prevent human error in c++.


If you're referring to formal program proofs and formal methods, I'm familiar with them and have used them. If you're referring to other less rigorous techniques, that's fine, too. My question would be why? Why would you favor a program where you have to work extra hard to program clearly and correctly? To me, that is the sign of a poorly designed language. Is it too hard for me to use? No. I've used it. I've also used several other languages that prove to be superior in their clarity and utility. Do they sacrifice some performance? Yes, but not that I could tell.

rtharper
Feb 11, 2007, 07:41 PM
Memory management and thread concurrency always seem to kinda "design themselves" every time I write a program of some sorts. I guess being competent means you don't have to use slow interpreted VM languages just so you can write some code.

Thank goodness Objetive-C 2.0's GC is optional. I consider that a best of both worlds scenario.

Care to provide an example of decent complexity. Personally, having written numerical analysis algorithms in massively parallel implementations (gaussian elimination, primality testing, jacobi relaxation, to name a few), OS features, and concurrent database applications, that if you ever wrote a system of decent complexity, these aspects do not "design themselves". If they did, CSP, CCS, CBS, and Pi-calculus would be rather

Also, regardless of the ease, threads behave differently in different libraries. Using the Win32API versus pthreads versus java is different, but only in Java can you write one application whose thread implementation is cross platform.

As for memory management, it is something every programmer should know about, but sometimes it's not something you want to write, nor should you have to. Garbage Collection systems are often so efficient that there is no PRACTICAL performance difference, and the point is that you never worry about pointer issues or (for example) buffer overflows. And don't tell me they aren't an issue, as they're the reason for most security flaws in large systems (and small ones, for that mebber)

ryan
Feb 11, 2007, 08:58 PM
You could get all that with D and not have a horrible runtime component. Java is a bad idea because of how it was implemented. Even Sun won't use it for anything crucial.

http://www.archub.org/javamemo.txt
http://www.pcworld.com/article/id,109301-page,1/article.html


You realize that both these articles refer to only Java on Solaris, and the second is 4 years old?


Java is a non-deterministic bloat machine, and anybody who would champion its usefulness for anything other than Fisher Price Baby's First Programming Language is no computer scientist.

Google, Apple, Nintendo, along with tens of thousands of other companies, certainly don't feel that way.

In any case, I've never understood why people hate certain languages so much. I've seen slow, bloated applications written in Java, C/C++, C#, Ruby (among others) and sure, I've muttered under my breath about the developer that wrote the code but it has never caused me to damn the language itself.

To the original poster, go back a read rtharper post #8; it is by far the most balanced, well thought out post I've seen in this entire thread.

darkwing
Feb 11, 2007, 09:05 PM
f you're referring to formal program proofs and formal methods, I'm familiar with them and have used them. If you're referring to other less rigorous techniques, that's fine, too. My question would be why? Why would you favor a program where you have to work extra hard to program clearly and correctly? To me, that is the sign of a poorly designed language. Is it too hard for me to use? No. I've used it. I've also used several other languages that prove to be superior in their clarity and utility. Do they sacrifice some performance? Yes, but not that I could tell.

All your arguments reek of "c++ is too hard for me, so I'll defend the one I'm capable of using."

You said it yourself. Pointers are very powerful. I don't have to work extra hard to have thread concurrency and memory management in c++. It's all very simple and easy to do, provided you take the time to learn how to do it properly.

In my software engineering 2 course as an undergrad, I had a professor who is a total java fan. He had us take a C implementation of a red-black tree program and convert it to Java. The thing that ticked me off most about this is Java has no concept of pointers to pointers (or references to references) so it requires a class wrapper every time you do it. With java's new templates, this would be a bit more powerful of course, but that wasn't available at the time.

BTW, the C version ran in about 81 ms and the Java version took over 1.2 seconds to do its thing. Ouch! Now that's performance I can see!

You realize that both these articles refer to only Java on Solaris, and the second is 4 years old?



Google, Apple, Nintendo, along with tens of thousands of other companies, certainly don't feel that way.

All those nice Java cell phone games that get 2-4 frames per second really demonstrate how awesome Java is! :rolleyes:

Whether they refer to Solaris or not, it's rather funny to see Sun themselves saying that Java isn't viable for any serious commercial application.

I suppose Google's search engine does all its back-end database stuff in Java. OSX is obviously written in Java, as are iPhoto, iMovie, etc etc. And the Wii must be programed entirely with Java as well. This explains the last-gen graphics.

I never thought of it that way!

darkwing
Feb 11, 2007, 09:08 PM
I just demonstrated (in C) a complete distributed object framework with demo application fully secure using ccmmac validation with aes256 encryption to some co-workers. It all fit in under a k of ram and under 10K of ROM and ran on a $1.25 piece of crap processor. The fact that the key is 256 bytes, that's pretty good actually.

Java can't even print "hello world" with resource constraints that small. :rolleyes:

And I know many of you will say that isn't the sort of application you would use Java for, so the point is moot. However, you'd all be the same people who will sit there with a straight face and tell me how flexible Java is.

rtharper
Feb 11, 2007, 09:22 PM
In any case, I've never understood why people hate certain languages so much. I've seen slow, bloated applications written in Java, C/C++, C#, Ruby (among others) and sure, I've muttered under my breath about the developer that wrote the code but it has never caused me to damn the language itself.


It's important to take into account the context of the argument. The quality of a given application isn't what makes me praise or damn a programming language. It's my experiences with various languages and my personal opinions based upon my knowledge of programming language theory. Personally, I tend to be against non-type safe languages. I understand the need for them (pointers, for example, allow for some pretty elegant string manipulation and sorting methods), but I think the descendants of C in terms of syntax and their use of pointers is a bad thing for programming languages. From a compiler point of view, it makes program correctness checking very difficult, and often times impossible.

Also, I tend to think that, given the hardware available these days, for complex reasoning, high level languages utilising lazy evaluation (especially functional programming or multi paradigm languages) are a suitable platform for a lot of programming these days because a) they allow the programmer to focus on the algorithm instead of other issues b) the code is often elegant, easy to read and c) most of these languages are written in a defining language such as a C that allows the creation of primitive functions that are super fast, and combining them in a higher level language can oftentimes stil l yield excellent performance. They are often easier to debug, too ;)

darkwing has gotten rather snarky and claims I'm praising Java, which I'm not. I've said it again and again, the right language for the right task. I don't think Java should be used for RegExp string manipulation. I DEFINITELY don't think GUI programs should be written in it. I would never recommend it for embedded apps. But, as people have mentioned, resource constraints aren't always the main concern. Neither is real time response. I DO think it can be a valuable pedagogical tool, it can be great for web applets, and it has decent use for utilities where there are multiple target platforms. The fact of the matter is that often APIs should be developed and C and C++ because of their performance gain, but I don't believe that they should be written FOR C and C++ as much, and allow people to code in other, higher level languages instead. This is not a unique or new idea, though it is gaining popularity, now.

rtharper
Feb 11, 2007, 09:25 PM
I just demonstrated (in C) a complete distributed object framework with demo application fully secure using ccmmac validation with aes256 encryption to some co-workers. It all fit in under a k of ram and under 10K of ROM and ran on a $1.25 piece of crap processor. The fact that the key is 256 bytes, that's pretty good actually.

Java can't even print "hello world" with resource constraints that small. :rolleyes:

And I know many of you will say that isn't the sort of application you would use Java for, so the point is moot. However, you'd all be the same people who will sit there with a straight face and tell me how flexible Java is.

It is moot. I've never said (and you're talking to me, because I'm the one posting) that Java is appropriate for all occasions. It isn't even appropriate for most. There is no beat-it-all language. I also noted you said C, which I have discussed as useful many times. Incurring the additional overhead for C++'s OO paradigm is a different story, and not part of what you said.

I'd also be interested how you wrote a distributed object framework in a purely structural/procedural programming language.

jsw
Feb 11, 2007, 09:27 PM
darkwing: your arguments seem to be entirely based on speed and size of the executable. You seem to have no concern for speed of development, maintainability, team-oriented aspects of using a language, etc. By your line of argumentation, a motorcycle is always superior to a sedan.

How many professionally sold applications developed with a team have you completed?

How many 100K+line apps have you maintained?

How many cross-platform apps with GUIs have you worked on?

I spent 5 years professionally developing with C. 7 with C++. 8 with Java. Java is far and away a vastly better language for large-scale team-oriented development of most user-oriented applications. I thought I'd miss pointers. I don't... haven't needed them yet.

darkwing
Feb 11, 2007, 10:37 PM
It is moot. I've never said (and you're talking to me, because I'm the one posting) that Java is appropriate for all occasions. It isn't even appropriate for most. There is no beat-it-all language. I also noted you said C, which I have discussed as useful many times. Incurring the additional overhead for C++'s OO paradigm is a different story, and not part of what you said.

I'd also be interested how you wrote a distributed object framework in a purely structural/procedural programming language.

You're right that there's no beat it all language. I made an online UNO game during school that used a Java applet client and a c++ server running on Linux. Definitely the best of both worlds. Clearly c++ did not offer me an easy way to make an applet.

I read an interesting article a few years back about how Microsoft has driven developers away from Windows programming and more towards web based designs. Why can't people see the Macintosh is here in all its glory and needing DEVELOPERS DEVELOPERS DEVELOPERS!! :)

You can research the basis for the technology by googling for "emWare" and "emit". emWare was purchased by Panasonic, and I work with a team of people locally with a sister-team of sorts in Japan. The purpose for the project I mentioned was to prove such things can be done in a small scale.

The neat thing about that project was that it was talking to c# apps using existing code, too. Somebody wrote a bridge application from our little serial port board to a broader tcp network.

darkwing: your arguments seem to be entirely based on speed and size of the executable. You seem to have no concern for speed of development, maintainability, team-oriented aspects of using a language, etc. By your line of argumentation, a motorcycle is always superior to a sedan.

Incorrect. A motorcycle can't hold 4 people comfortably, but a C application (let alone C++) can do anything Java or some higher level language can do and typically more efficiently. (If implemented correctly.) In some cases it becomes harder (my applet example) but things can be done. When you draw the line that cpu cycles should make up for incompetent programmers, then computer science as a whole goes down the tubes.

How many professionally sold applications developed with a team have you completed?

About 7.

How many 100K+line apps have you maintained?

2

How many cross-platform apps with GUIs have you worked on?

3

I spent 5 years professionally developing with C. 7 with C++. 8 with Java. Java is far and away a vastly better language for large-scale team-oriented development of most user-oriented applications. I thought I'd miss pointers. I don't... haven't needed them yet.

I agree that Java is a good language for a team environment. So is c++. One of the benefits to OO paradigms and design-by-contract languages in general is that you get a good team environment.

I'd rather have top-notch people developing an app that will run fast and be efficient than a bunch of mediocre people basing their language of choice on what's easier for them to grasp.

plinden
Feb 11, 2007, 11:06 PM
Just because C++ can do something Java can't doesn't make it a hack. It simply makes it a much more flexible (and powerful) language.

You know the funny thing about this? I am a Java "fanboy". But I'm also a C++ "fanboy". And a Python "fanboy". I'm definitely not a PHP or a Perl "fanboy"

I just shudder when I think about writing a webapp in C++, without Tomcat, JSPs, Servlets, JAAS, JMX, Log4J etc. And I've done that, back in 1999-2000. We had a team of 20 working on a project that ended up needing just five developers when we switched to Java. You see, Java isn't slow when written well, and raw speed is not the most important thing in enterprise software. It was much less expensive for my employer to increase (by about 25%) the number of front end web servers than to pay 15 developers at > $100,000 per year.

On the other hand I shudder when I think about writing a game in Java.

One thing you need to realize if you want to be a professional software engineer, when you start talking about fanboys, you become unable to think about what's the best tool for the job. In the past year I've worked on two Java web applications, a C++ plugin for the Darwin Streaming Server, a Python based web service and have attempted to maintain Perl code written by another programmer. Apart from Perl, which is a incredibly powerful and flexible language that takes a particular kind of person - not me - to be expert at, and the choice between Python or Java for the web service (a decision I didn't make - I don't think it was a bad decision for what it did) each of the languages I worked with were the best ones for the job.

Hell, I'd even code in C# if I had to work in a Windows-only environment.

darkwing
Feb 12, 2007, 12:06 AM
One thing you need to realize if you want to be a professional software engineer, when you start talking about fanboys, you become unable to think about what's the best tool for the job. In the past year I've worked on two Java web applications, a C++ plugin for the Darwin Streaming Server, a Python based web service and have attempted to maintain Perl code written by another programmer. Apart from Perl, which is a incredibly powerful and flexible language that takes a particular kind of person - not me - to be expert at, and the choice between Python or Java for the web service (a decision I didn't make - I don't think it was a bad decision for what it did) each of the languages I worked with were the best ones for the job.

Hell, I'd even code in C# if I had to work in a Windows-only environment.

Of course, and I already mentioned an example of using Java for a web app. I'd use c# for Windows but only because I need to have more experience with it than I do to be more well-rounded. If I was doing a serious app where performance was an issue, I'd probably stick with win32. (I'd not use Windows at all if I could avoid it!)

I really like Python and I like it more than Perl, but I feel perl is kinda ugly when it comes to classes.

I don't feel that Java has any business at all being a server language. For simple things that are mostly IO bound, it's great. But when you need some real power behind it, it lacks heavily.

angelneo
Feb 12, 2007, 01:04 AM
All those nice Java cell phone games that get 2-4 frames per second really demonstrate how awesome Java is! :rolleyes:

I have no idea how old is your frame of reference, a lot of the current java games, even those 3D ones, are running fine and smooth on the current phones.

darkwing
Feb 12, 2007, 07:03 AM
I have no idea how old is your frame of reference, a lot of the current java games, even those 3D ones, are running fine and smooth on the current phones.

2 different phones since 2003. My current phone (razr v3x) has crappy motorola software and no java games. (I think Motorola has the worst software people... just look at their cable boxes)

jsw
Feb 12, 2007, 07:17 AM
I don't feel that Java has any business at all being a server language. For simple things that are mostly IO bound, it's great. But when you need some real power behind it, it lacks heavily.As I said, I used C++ for well over half a decade. It was ideal for the AI/image recognition/image processing apps I was writing then. I'm not disputing that some apps need something like C++ or C or assembly code.

But to say Java lacks real power? Because... why again? No pointers? It would seem that you're unfamiliar with it if you think it is underpowered compared to C++. And having written a fair amount of Java-based server code, and having used a fair amount of Java-based server apps, you're clearly wrong when saying it has no business there. You seem, again, to base it all on speed without any real argumentation as to why that would matter - look plinden's post, and my experiences are similar. Java is often a much better business decision because it's cheaper to use.

When speed or raw efficiency or access to native functionality or real-time needs are paramount, then, in many cases, C++ is a better choice. But you continue to argue it's better simply because it's faster and has a smaller memory footprint, and you continue to ignore any comments that, in these days where the cheapest CPUs you can buy easily exceed 1GHz, speed isn't all it used to be.
I'd rather have top-notch people developing an app that will run fast and be efficient than a bunch of mediocre people basing their language of choice on what's easier for them to grasp.Wouldn't we all? Of course, this does nothing to advance your argument. And at least it's nice to hear you admit Java is easier to grasp. Obscurity is never a plus. I've coded in Symbian, and the fact it's got excellent access to the phone hardware doesn't in any way counteract the fact that it's exceedingly poorly designed.

I still have a lot of love for C++ and other languages. I don't think Java is the be-all and end-all of languages. It isn't. It's bloated compared to a lot of other choices. It takes longer to start up. It has a number of weaknesses. But... to say that it's inappropriate for business/server apps is simply wrong. That's exactly where it's most suitable. Consumer apps? No. Games? No. Scientific visualization? Not so much. Agreed.

I don't mind that you prefer C++. I just wish your defense was better than "it's faster and smaller." What language features make it superior?

darkwing
Feb 12, 2007, 08:11 AM
But to say Java lacks real power? Because... why again? No pointers? It would seem that you're unfamiliar with it if you think it is underpowered compared to C++. And having written a fair amount of Java-based server code, and having used a fair amount of Java-based server apps, you're clearly wrong when saying it has no business there. You seem, again, to base it all on speed without any real argumentation as to why that would matter - look plinden's post, and my experiences are similar. Java is often a much better business decision because it's cheaper to use.

I guess I'm not making myself clear.

People who find Java better because it's easier to use are incompetent and have no business whatsoever calling themselves engineers. Or rather, no decent company who cares about the performance (especially look and feel) has any business hiring them.

When Java becomes "cheaper to use" or a "better business decision" due to inept employees it's time to re-think the business all around.

And why does speed matter? Gee, I don't know. :rolleyes:

I guess it's time to simply agree to not see eye-to-eye on this one and move on.

Xyl
Feb 12, 2007, 08:22 AM
I guess I'm not making myself clear.

People who find Java better because it's easier to use are incompetent and have no business whatsoever calling themselves engineers. Or rather, no decent company who cares about the performance (especially look and feel) has any business hiring them.

When Java becomes "cheaper to use" or a "better business decision" due to inept employees it's time to re-think the business all around.

And why does speed matter? Gee, I don't know. :rolleyes:

I guess it's time to simply agree to not see eye-to-eye on this one and move on.

I found it hilarious that you decided to throw out the term "Java fanboy" out there. What a hypocrite? It looks like you're a "C++ fanboy". As noted by already several billion posts in this thread, speed is not always the #1 issue. It's called compromises - performance is always an issue, but not always the #1 issue - there's other constraints such as development costs, development times, multi-platform requirements, you could go on and on - it seems like you don't get it, you keep talking as if performance is the #1 issue for all applications (every single one) - it's not, and you should start drilling that into your head.

Edit: You need to get out of the engineering side and venture more into the business side. You have no idea what you're talking about. "Better business decision" and "cheaper to use" does not equal to inept employees. I don't even know where to start on this issue...go read a book (yes even that will help), talk to some higher management business people that actually balances the books and pays your salary.

darkwing
Feb 12, 2007, 08:54 AM
I found it hilarious that you decided to throw out the term "Java fanboy" out there. What a hypocrite? It looks like you're a "C++ fanboy". As noted by already several billion posts in this thread, speed is not always the #1 issue. It's called compromises - performance is always an issue, but not always the #1 issue - there's other constraints such as development costs, development times, multi-platform requirements, you could go on and on - it seems like you don't get it, you keep talking as if performance is the #1 issue for all applications (every single one) - it's not, and you should start drilling that into your head.

Edit: You need to get out of the engineering side and venture more into the business side. You have no idea what you're talking about. "Better business decision" and "cheaper to use" does not equal to inept employees. I don't even know where to start on this issue...go read a book (yes even that will help), talk to some higher management business people that actually balances the books and pays your salary.

Yes I am a c++ fanboy. Is "fanboy" a derogatory term? I use "fan" as someone who likes something and "fanboy" who likes only that one thing out of a group of possible choices. (Or at least in the realm of comparison.)

I don't need to read a book as I've been in the industry for 10 years and have seen all I need to see. If you have a team of total c++ experts, you'll get the job done just as fast as you would in Java, have good maintainable code, and it'll run faster. Much faster. Every time. When you don't have said experts, I guess Java is all you can manage to use.

Why do I like and use Java?

1) Good library of existing classes.
2) I can make a simple GUI app for a Windows friend without needing to use Windows myself.
3) Interfaces as opposed to multiple inheritance of ABCs makes for good design.

Why do I hate Java?

1) Debugger takes forever to load.
2) The program itself takes forever to load.
3) Huge memory hog.
4) Slow slow slow.
5) No real "protected" (c++ meaning) members without making each class its own package. Ugh. (If I'm not correct here, please educate me as I'd really like to know for future use.)

I think that Objective-C can be a good compromise as its runtime cost is much smaller than Java's.

lazydog
Feb 12, 2007, 09:07 AM
I heard a saying some time ago which I think is pretty appropriate for this thread. It goes something like this:-

If all you have is a hammer then pretty soon everything begins to look like a nail.

I guess what I'm saying is that it's a good job there are so many programming languages out there and that the 'best' language, like the 'best' tool in a tool box, is the one that is most appropriate for the taks in hand.

As much as I love C++ sometimes, for whatever reason, Java is a better choice. I'm currently working on 2 projects, one in C++ and the other in Java and I wouldn't want to swap the languages around for either project.

happy coding!

b e n

Xyl
Feb 12, 2007, 09:12 AM
I don't need to read a book as I've been in the industry for 10 years and have seen all I need to see. If you have a team of total c++ experts, you'll get the job done just as fast as you would in Java, have good maintainable code, and it'll run faster. Much faster. Every time. When you don't have said experts, I guess Java is all you can manage to use.

You obviously did not get my point. Not every single company out there (especially smaller startups - and all companies were a start up at one point or another) has the finances to hire 10 C++ experts with 20 years of experience - and as I said before, requirements determine the language, not performance...performance is only one requirement (and it seems you're stating performance as the #1 issue yet again). And depending on requirements, it can be cheaper to develop in Java and still be sufficient, especially when performance is not the #1 issue.

darkwing
Feb 12, 2007, 09:33 AM
You obviously did not get my point. Not every single company out there (especially smaller startups - and all companies were a start up at one point or another) has the finances to hire 10 C++ experts with 20 years of experience - and as I said before, requirements determine the language, not performance...performance is only one requirement (and it seems you're stating performance as the #1 issue yet again). And depending on requirements, it can be cheaper to develop in Java and still be sufficient, especially when performance is not the #1 issue.

Yes this is true not everyone can hire experts. However, people who only feel comfortable in Java and find c++ "too hard" should find a new career choice, imho.

My main point for using Java, which is writing things friends can use on Windows, is kind of hindered now since MS and Sun can't play nice and a JRE is a separate download. :mad:

I'm going to start messing around with mono one of these days.

I much prefer Java to C# but I find C# is better suited for GUIs.

Java gui:

http://madbean.com/anim/totallygridbag

(for those who haven't seen it)

hsvmoon
Feb 12, 2007, 09:35 AM
If you need nothing but pure speed NO language can beat optimized ASM, but if you do not have the rest of your natural born life to code the program you will pick a higher level to work at. The next level of speed would be pure procedural like C, FORTAN, or similar. The next level would be C++ or similar. The top level stuff like JAVA, PERL, RUBY, or similar take very little time to develop new applications. The main idea is you trade speed for easy to code. Most applications do not need to be optimized for speed so much as to dictate what level of language you use, but they do need to be early to market.

darkwing
Feb 12, 2007, 09:46 AM
If you need nothing but pure speed NO language can beat optimized ASM, but if you do not have the rest of your natural born life to code the program you will pick a higher level to work at. The next level of speed would be pure procedural like C, FORTAN, or similar. The next level would be C++ or similar. The top level stuff like JAVA, PERL, RUBY, or similar take very little time to develop new applications. The main idea is you trade speed for easy to code. Most applications do not need to be optimized for speed so much as to dictate what level of language you use, but they do need to be early to market.

I was given a board on a Friday and told we needed a demo by Monday. It was an ARM/9 board with an attached LCD and touch panel. By Saturday night, I had compiled Linux/RTAI, used my re-usable and portable c++ gui classes to create an interface, wrote a driver for the touch panel (in C), and had a working demo. Now I'm not saying that this is the sort of thing Java is used for, however it is an example that C++ can be re-usable and flexible just like Java and bring applications up quickly. Java is better at forcing this on you, but it certainly can be done.

Compilers are good enough that C can come close to optimized ASM, but not always. I do a lot of inline ASM myself when projects aren't supposed to be portable.

rtharper
Feb 12, 2007, 09:58 AM
Yes this is true not everyone can hire experts. However, people who only feel comfortable in Java and find c++ "too hard" should find a new career choice, imho.


I don't think ANY said C++ was "too hard" for them to use. We've all used it successfully. Personally my problem with C++ is that it's in a class of languages whose implementation I disagree with and prefer not to use. From an engineering standpoint I see the need for C++. I also know this: from a programming language design standpoint, which is completely valid and something you have yet to address, the goal of any programming language is usability and clarity. I think C++ has this to a very limited extent, and many other languages, because of their abstraction, provide this much better. The trade-off? Performance. But somehow, the success of not just Java but Perl, Python, Ruby, Lua, and LISP tell me that oftentimes people are okay with that for certain problems.

It is a fact, C++ is not the best for everything. That claim does not mean I can't use it or anyone else thinks it's too hard. If you want to get into the nitty gritty, write in pure C or ASM. I've done both and can tell you I don't think I gained much by using C++ except better scoping, which is all it provides because that's all the OO paradigm is--a sophisticated implementation of lexical scoping rules. In the case of C++ AND Java, the syntax they require to implement these rules is ridiculous, but it's also all we've got.

Once again, you never addressed the issue of how complex your understanding of concurrency is, which is a major reason that Java is used in Enterprise level applications. You never addressed how you managed to have models that "design themselves" when the rest of the world, including the upper echelons of academia, have devoted significant time to correctness proofs and modelling in this area. If you've never had to make sure a program was provably correct, then you may have maintained several apps of 100K lines of code, but I wouldn't want it running on any server I owned. This is a major issue in cross platform development because so much of it--processes, threads, semaphores, etc, are platform specific. And you also never addressed issues on cross-platform usability that many people, including myself, mentioned, only claiming you have experience on them.

You can attack Java, but I'm not defending it. I'm actually responding to the attacks you make on programmers that dislike C++ and sometimes prefer Java in probably a much more well balanced view than your own. The fact of the matter is that people that don't always prefer C++ are neither less intelligent nor less skilled than you, and I would actually suggest the opposite, as you seem to only be able to think it terms of C++ and object oriented program, or perhaps that's all you have experience with.

You also have failed to make the distinction between platform and language. C++ is a language. Java is language and an associated platform. So is c#. The fact that you must program in C++ for a given platform, and that there are so many out there (Win32API, Qt, GTK, just to name a few) makes it a less attractive option for some instances because of the lack of standardisation.

Basically, all you've responded with is "zomg if you liike java ur teh dumbs0rs, c++ is teh only language!" despite concessions to your argument that C++ has a place in the world of programming. If you pushed out all other programming languages and paradigms, you'd find that many of the technologies you use today would be done for, including Yahoo, whose first software was written entirely in LISP and they still maintain much in LISP today.

darkwing
Feb 12, 2007, 10:16 AM
Concurrency: at a bare minimum, (with little thought) can be done safely with recursive mutexes acquired in the same order with some mechanism to prevent priority inversion. Yes, there is nothing in C++ built-in that does that.

Cross platform: plenty of libraries are available for c++ that allow gui development, regex, and a number of other things. Just take your pick.

Proving something is correct: I've been in the medical device industry for over 8 years, and you think I've never had to sit down and prove that something will be safe by design? If I'm wrong I can go to jail. Not doing this is a priority for me. :rolleyes:

C++ is the best compromise right now in my opinion for design ease and flexibility vs performance. I agree there are many parts of the language that are sub-par. I don't much care for the STL. It's powerful but not intuitive. (For example, you can use a std::vector and have your code compile and run, but have problems with erase() unless your contained class implements copy constructors and assignment operators, which isn't required because of their implicit functionality.) I don't at all care for the fact that most of the C library doesn't handle re-entrancy and modern attempts to do this feel like hacks.

I'm starting to become a bigger fan of Objective-C and feel it's much better than Java in many ways. However, it seems the industry support for it is poor.

When you trade performance for ease of design and flexibility, then programmers get complacent. If things don't run well, then just buy more servers and more expensive hardware. That'll solve it! I shudder to think what the next 20 years of software innovation will look like compared to the last 20 years as hardware gets more and more powerful. I think highly skilled people who are capable of writing fast, streamlined efficient code will go by the wayside.

Of course, these skills have always kept me in a job. :cool:

BTW, my suspicion is that when you ask me to explain my understanding of concurrency that you're dealing with something I haven't before. I'd love you to go more in depth on that. Also, the two 100k+ applications I maintained were medical device device code. Embedded linux stuff. One of them had about 24 threads (mostly IO bound) and the highest priority was actually a sound driver that output digital data or DDS-generated tones at 8000 Hz to a dac. I love that little driver. :)

Oh, and Java couldn't hope to do that. Let alone RMS scheduling with hard deadlines.

Oh, and as for your LISP statement. When I took my graduate AI course, the teacher said she preferred python but left it up to us as to what language we used. I took this as an opportunity to learn python and loved it, but man is it slow. An AB tree based checkers game of mine worked great but when the depth was set to 80 or so it could take several minutes to figure out a move. Such is the nature of exponential growth algorithms, though. Reasonable with n=10.

So what do you think about LISP vs Python for AI?

It'd be hard to do AI on C without self-modifying code and being platform specific. You could do it, though. Good thing there are LISP->C converters. (No experience with them though.)

jsw
Feb 12, 2007, 10:28 AM
I'm starting to become a bigger fan of Objective-C and feel it's much better than Java in many ways. However, it seems the industry support for it is poor.
Not that I don't want to keep the thread as antagonistic as it has been ;), but: have you seen the Objective-C improvements coming in Leopard? Pretty nice (although perhaps the garbage collection would not be to your liking). And Xcode is finally starting to grow up and get some big-boy features to support some of those changes.

darkwing
Feb 12, 2007, 10:35 AM
Not that I don't want to keep the thread as antagonistic as it has been ;), but: have you seen the Objective-C improvements coming in Leopard? Pretty nice (although perhaps the garbage collection would not be to your liking). And Xcode is finally starting to grow up and get some big-boy features to support some of those changes.

Actually the garbage collection is OPTIONAL, which I absolutely love. While I don't appreciate people who appreciate GC, it should get a lot more users on board for Obj-C and I think this will be a huge benefit overall.

I am anxiously awaiting Leopard and the new XCode and have been salivating over it for quite some time. :cool:

I actually like Objective-C's memory management model rather nicely, and proposed a C implementation of it for a project currently being worked on here in C.

Oh, I forgot to answer something in a previous post. Code that "designs itself." It's pretty simple to implement a reference counting mechanism (see above) or keep track of a pointer once allocated in a list somewhere. I implemented my own version of something I found out was implemented in boost's shared_ptr (before I ever heard of boost) that was STL safe and managed reference counting. With a few simple rules to keep in mind while coding, it's pretty darn easy to manage memory.

plinden
Feb 12, 2007, 10:41 AM
I don't need to read a book as I've been in the industry for 10 years and have seen all I need to see. If you have a team of total c++ experts, you'll get the job done just as fast as you would in Java, have good maintainable code, and it'll run faster. Much faster. Every time.

I've been in the industry for 15 years and I still haven't seen all I need to see. But if you have a team of total Java experts, you'll get the job done three times faster than you would in C++ using one fifth the personnel, have good maintainable code, and it'll run just slightly slower than native code. Slightly slower. Every time.

For the jobs that Java is the best tool for.

You have been using the classic Artie MacStrawman arguments, arguing against some mythical Java fanboy whom I've never met in seven years of using Java.

darkwing
Feb 12, 2007, 10:56 AM
I've been in the industry for 15 years and I still haven't seen all I need to see. But if you have a team of total Java experts, you'll get the job done three times faster than you would in C++ using one fifth the personnel, have good maintainable code, and it'll run just slightly slower than native code. Slightly slower. Every time.

For the jobs that Java is the best tool for.

You have been using the classic Artie MacStrawman arguments, arguing against some mythical Java fanboy whom I've never met in seven years of using Java.

You should go to my school then. Lots of those fanboys there.

Now you've poised an interesting question. Perhaps some form of contest to design a server that will run (or compile and run) on several platforms. Get a team of x number of people, each an expert in their favorite language, and see who can develop it faster using all tools at their disposal.

We have a team here of two people who maintain the Java side of things and they're both pretty smart guys. The amount of time they had to work on their stuff was no greater than the C# guys. We're doing the C implementation of this project and we have an even shorter deadline. I wonder how that worked out? I guess it can't be done and we'll be massively late on it. :rolleyes:

jeremy.king
Feb 12, 2007, 11:23 AM
OP,

Don't learn C/C++ unless you want to work with people like darkwing :eek: Do you really think all these low level language comparisons mean jack to the OP? Are all C/C++ fanboys as thickheaded and belittling as you?

C# and Java are the two language skills that are most desired at the moment - search any job board for proof. It just depends if you want to bind yourself to Microsoft's domination (is that bad?) or work with a technology that spans platforms (mobile, embedded, server, and desktop) and various industries. Yes, the same can be said of C++, for the most part.

I'm a fanboy, but I don't claim Java is THE language by any stretch - in fact, I know a bit of C/C++, C#, Perl, Tcl, Ruby, and PHP. I only think in terms of $$$, and in my 10 years of experience - my Java skills been quite good to me.

The key will be your ability to adapt as the industry changes, languages seem to fall out of favor as new technologies are introduced. Having a solid foundation of design (OO AND Procedural) skills and problem solving ability should help, whatever language you learn really won't matter in the long run, since you will probably use more than one throughout your career.

Bottom line.

If you learn C/C++ you will make money.
If you learn Java you will make money.
If you learn C# you will make money.
...
...
...

jdechko
Feb 12, 2007, 11:47 AM
2 different phones since 2003. My current phone (razr v3x) has crappy motorola software and no java games. (I think Motorola has the worst software people... just look at their cable boxes)

Are you on Verizon??? I thought that Verizon only supported BREW games and not Java.

Anyway, I think that the most important thing in programming as far as starting out is getting the syntax down. Converting ideas to logical explanations step-by-step has worked for me in the past. I've done very little coding compared to many of you, but logical statements are universal. After that, you just translate them into whatever language you're using.

BTW, I've done pseudocode (don't think it even compiles), java and AutoLISP (variant of lisp for AutoCAD).

darkwing
Feb 12, 2007, 11:49 AM
I had another thought on all this. There's no evidence that I can find that proves Java is easier to develop on than anything else. This is just personal preference and perception. And as for what languages businesses choose to use, well, if managers are told by their employees that Java is the way to go then that's what they'll do. Good managers listen to employees and empower them to do the best job they can.

Fortunately for me I try to base my arguments off things that are easily qualified, namely the efficiency of the finished product. :cool:

And when I searched job boards to get this job (had to leave my last job to escape California) I found nothing but C++/C with Java/C#/etc a plus. Of course, I typed in the word "embedded" in the search field.

Whether I like it or not, I believe the industry is already moving more towards web-based interfaces for large scale enterprise products, and this means a lot of Java. I also believe that desktop programmers vastly outnumber embedded guys which is why I went this route. I got a big fat bonus to actually move here.

GeeYouEye
Feb 12, 2007, 12:31 PM
At a purely language level, Java has certain advantages over C++, and vice versa.
Java > C++:
Interfaces
Encourages inheritance by making final "optional" rather than "virtual".
Generics > templates
Some, however limited, support for introspection ("reflection")
No fragile base class problem
No pointer problems
Non-GUI programs can often translate to Objective-C on the syntactic, if not the lexical, level (case in point, I had a graph traversing program in Java. All it needed was a F&R for the class names, and a regex to go from a.b to [a b])
No "friends"
Garbage collection (I mention this because a language with no way to manage memory must have it, so it's as much a language feature as a runtime feature)

C++ > Java:
Operator overloading (WHEN USED PROPERLY)
Multiple Inheritance (I hate it, but Java doesn't have it)
slightly better scoping syntax (horrible as :: is to use and remember, dot-drill-down is way worse)
Java has no pointers
better access control syntax in terms of readability
class methods (though you wouldn't know it from the syntax alone)
Function pointers > functors
pass-by-X is explicit
procedural programming is available

That's without even getting into the libraries or runtimes.

Of course, Objective-C has them both beat in all three areas (except for Java in the libraries department, where it became tied when WebObjects went all-Java - AppKit is still way better than AWT or Swing), and will have Java beat on it's own terms (garbage collection) in 2.0. :D Elaboration on request; I've spent more time on this post than I should have.

That said, none of the above have: dynamic scoping, pass-by-name* (a good thing - I shudder to think about Intro to Programming students dealing with it), support for functional programming, prototyping, continuations, higher-order messaging**, and others.

*Well, Objective-C has it in practice, but only for selectors, so that doesn't really count.

**In Obj-C via library support, and/or a compiler hack, and/or a set of macros.

To sum up: if you want to start learning procedural programming, learn Pascal (or better yet, ALGOL or Ada). To learn Object-Oriented Programming, learn Objective-C. If you want to learn functional programming, learn LISP.

jsw
Feb 12, 2007, 12:45 PM
I had another thought on all this. There's no evidence that I can find that proves Java is easier to develop on than anything else. This is just personal preference and perception.
Yes, but it's personal preference and perception from, among other people, those of us with a great deal of experience using both languages as well as others. Your assertions that, in essence, Java is for dummies is what a lot of people are reacting to.
Fortunately for me I try to base my arguments off things that are easily qualified, namely the efficiency of the finished product. :cool: I think this has been beaten to death. Efficiency of the finished product is not the prime consideration for a number of product areas.Of course, I typed in the word "embedded" in the search field.Well, duh.

rtharper
Feb 12, 2007, 12:59 PM
To sum up: if you want to start learning procedural programming, learn Pascal (or better yet, ALGOL or Ada). To learn Object-Oriented Programming, learn Objective-C. If you want to learn functional programming, learn LISP.

Oh man, you had me on everything until you brought Ada into this ;).

What are your thoughts on Haskell or Scheme to teach functional programming?

bousozoku
Feb 12, 2007, 01:06 PM
I guess I'm not making myself clear.

People who find Java better because it's easier to use are incompetent and have no business whatsoever calling themselves engineers. Or rather, no decent company who cares about the performance (especially look and feel) has any business hiring them.

When Java becomes "cheaper to use" or a "better business decision" due to inept employees it's time to re-think the business all around.

And why does speed matter? Gee, I don't know. :rolleyes:

I guess it's time to simply agree to not see eye-to-eye on this one and move on.

If speed is all that matters, we should be using dumb terminals running FORTRAN applications. FORTRAN is still likely the most efficient language out there. It's definitely faster than C++ and so is C.

Of course, if we put C++ programmers on FORTRAN, there would be a lot more incompetent developers wouldn't there?

There are a lot of situations where Java is the answer and it's strong enough to do most anything but real-time programming.

That doesn't mean that C++ can't be an effective language in many cases but C++ is more likely to be misused by people who think they know what they're doing. Discipline is required to use C++ (and C) well. It's more likely that a good application will come from Java or Objective-C or Smalltalk simply because they require better coding.

GeeYouEye
Feb 12, 2007, 01:18 PM
Oh man, you had me on everything until you brought Ada into this ;).

What are your thoughts on Haskell or Scheme to teach functional programming?

Scheme's fine, though I think you lose something with only static scoping. Certainly a sight more readable than LISP.

Haskell's good for functional algorithms (I've yet to see a more self-explanitory quicksort), I think, but with monads and for loops, the idea that it's purely functional is put somewhat in doubt.

As for Ada, I mentioned it because it's got quite possibly the greatest flexibility of any procedural language, even if readability is only so-so, and writability is in the crapper. It's still without question an ALGOL/Pascal-derived language (C is a BCPL-derived, lexically), and one that has some continuing practical value.

jhande
Feb 12, 2007, 04:15 PM
Haskell's good for functional algorithms (I've yet to see a more self-explanitory quicksort), I think, but with monads and for loops, the idea that it's purely functional is put somewhat in doubt.

As for Ada, I mentioned it because it's got quite possibly the greatest flexibility of any procedural language, even if readability is only so-so, and writability is in the crapper. It's still without question an ALGOL/Pascal-derived language (C is a BCPL-derived, lexically), and one that has some continuing practical value.

Re: Haskell, the point of monads is precisely to keep the core of the language pure. Anything that 'changes the world', i.e. IO and the like is kept seperate from the core algorithm/program. It took a while for me to grok, but it sure makes for easy to maintain programs, albeit after a while. My first functional programs proved that you can do 'spaghetti' in any language.:D

I do quite a bit of Ada, though, and you're right about the writeability. However, maintenance after the fact is a breeze.

I never could get to love Java. I tried, and though I do use parts of it (Tomcat et al), it's not a language I really like. Different strokes and all that...

darkwing
Feb 12, 2007, 04:28 PM
Let's wrap up the argument. I'll just say perhaps my opinion of Java is based with it being the favorite of students who will never graduate.

Anyway, I've used Scheme but never Haskell. I chuckled at the comment about LISP being unreadable. But that's half the fun. So how does Scheme compare to Haskell? I could look that up, but it generates less discussion. :)

Anybody use brain**** or false? Fun stuff.

janey
Feb 16, 2007, 05:08 AM
Let's wrap up the argument. I'll just say perhaps my opinion of Java is based with it being the favorite of students who will never graduate.
Not saying Java is my favorite, but when I'm stuck with it because almost every single university (including my #1 being uc berkeley) with the exception of maybe a couple (like UCLA) that I'm applying to (for transfer, mind you) this/next year seems to prefer Java over C++ etc...well then, I'm stuck aren't I. It starts mattering less the more advanced the classes are, but in terms of intro CS material..definitely more Java-wanting.

I don't particularly care either way or another in the Java vs. C++ argument, but I know where my strengths and weaknesses lie, and I'll use that to my advantage (or..when it's a strictly-one-language class/project).

Personally I prefer Ruby, but it's not feasible for everything.

darkwing
Feb 16, 2007, 08:43 AM
Not saying Java is my favorite, but when I'm stuck with it because almost every single university (including my #1 being uc berkeley) with the exception of maybe a couple (like UCLA) that I'm applying to (for transfer, mind you) this/next year seems to prefer Java over C++ etc...well then, I'm stuck aren't I. It starts mattering less the more advanced the classes are, but in terms of intro CS material..definitely more Java-wanting.

I don't particularly care either way or another in the Java vs. C++ argument, but I know where my strengths and weaknesses lie, and I'll use that to my advantage (or..when it's a strictly-one-language class/project).

Personally I prefer Ruby, but it's not feasible for everything.

We had a guy at my last job from UC Berkeley. He said that yes, they taught Java at the school. He said because of that, he knew no C++. Somehow he knew no OOP, either. (What the heck?) Luckily he had me to work with and after about a year he was top notch. (Makes me worry about the CS majors UCB is churning out. Personally, I feel they should stick to hippies strumming guitars or writing poetry up in the trees.)

My school (CSU Hayward, now called CSU East Bay) was primarily a C++ school. However, they do use Java for an OOP course and one of the professors is a huge Java fan so if he teaches a software engineering course it's in Java. Pretty useless courses, because all you do is design classes off his UML and write code off his sequence diagrams.

That OOP class at my school was my first exposure to Java. I primarily relied on all my industry experience. I was able to skip 2 classes (and challenged out of assembler) due to that. I had to make up 8 units though for the 2 courses I skipped. Those were the two quarters of C++ programming.

rtharper
Feb 16, 2007, 10:32 AM
We had a guy at my last job from UC Berkeley. He said that yes, they taught Java at the school. He said because of that, he knew no C++. Somehow he knew no OOP, either. (What the heck?) Luckily he had me to work with and after about a year he was top notch. (Makes me worry about the CS majors UCB is churning out. Personally, I feel they should stick to hippies strumming guitars or writing poetry up in the trees.)


Perhaps that's because UCB's Computer Science program teaches Computer Science. That is not equivalent to either a Software Engineering program nor a vocational program in Computing.

G4scott
Feb 16, 2007, 10:35 AM
As stated before, the point of a CS degree is not to learn one particular language, but to make you familiar with programming methods and such. You should be able to pick up a book about a programming language you've never used, and within a day, be able to do something with it.

As far as the Java/C++/C/C#/ML/Haskell/Assembly arguments... I won't get into that too much, but with a CS degree, you shouldn't be stuck with one language, but you should be able to understand and use several of them.

My school primarily uses Java in the introductory classes and such, but when more complex concepts are being taught (such as object oriented programming or operating systems), we'll use C++ and C. For some classes, you may even use perl, haskell, or some other language you may have never thought of using.

If you go through CS knowing just Java, then you've done something wrong. A well rounded CS student should not only understand higher level ideas, but how their code interacts with the hardware down to the lowest level (well, maybe not ones and zeros, but ASM code...)

Either way, I'm sure you'll find there's a lot more to CS than just programming.

plinden
Feb 16, 2007, 10:42 AM
C++ is for wusses. It's programming with training wheels for those who are too stupid and lazy to learn proper programming.

Real programmers program directly in machine code.

jsw
Feb 16, 2007, 10:46 AM
Real programmers program directly in machine code.Real programmers design their own computers, create a language, and then program with that. Using toggle switches.

Anyone who does any less is just a poseur.

deputy_doofy
Feb 16, 2007, 10:58 AM
Now, I must start out by saying that I have not used C++ and Java extensively since school (2002)...
Ok, as messy as they can be, I LIKE pointers. I like being able to manipulate pointers without being forced to only manipulate the variable to which they point. It's not my fault people create too many memory leaks. :p

rtharper
Feb 16, 2007, 11:01 AM
Now, I must start out by saying that I have not used C++ and Java extensively since school (2002)...
Ok, as messy as they can be, I LIKE pointers. I like being able to manipulate pointers without being forced to only manipulate the variable to which they point. It's not my fault people create too many memory leaks. :p

Or buffer overflows...or segmentation faults...the list goes on and on =p And pointers make it impossible for a compiler to tell you of behaviour that might result from incorrect pointer manipulation.

I have to agree that some hacks for pointers are nice, especially for string and list manipulation. But a) you should know what your doing and b) this should form the basis for creating higher level languages where the abstraction eliminates this need. THAT's the point of C/C++. You don't to go so low level for MOST tasks.

darkwing
Feb 16, 2007, 11:12 AM
Perhaps that's because UCB's Computer Science program teaches Computer Science. That is not equivalent to either a Software Engineering program nor a vocational program in Computing.

Understanding OOP is an important part of computer science!

bousozoku
Feb 16, 2007, 11:27 AM
We had a guy at my last job from UC Berkeley. He said that yes, they taught Java at the school. He said because of that, he knew no C++. Somehow he knew no OOP, either. (What the heck?) Luckily he had me to work with and after about a year he was top notch. (Makes me worry about the CS majors UCB is churning out. Personally, I feel they should stick to hippies strumming guitars or writing poetry up in the trees.)
...

They've apparently changed a lot. I know schools with two year degrees that teach better. However, I've met a lot of incompetent instructors. I'd say that people should review their instructor truthfully but, in my experience, most people don't care and, lacking experience, can't criticise an instructor who doesn't know what he's teaching.

I'm not sure how you can teach a Java class, even an introductory class, for a whole term without focusing on OOP and touching on UML or some other method to show the relationships. C++ should be the same way.

darkwing
Feb 16, 2007, 11:34 AM
They've apparently changed a lot. I know schools with two year degrees that teach better. However, I've met a lot of incompetent instructors. I'd say that people should review their instructor truthfully but, in my experience, most people don't care and, lacking experience, can't criticise an instructor who doesn't know what he's teaching.

I'm not sure how you can teach a Java class, even an introductory class, for a whole term without focusing on OOP and touching on UML or some other method to show the relationships. C++ should be the same way.

I didn't learn UML in my OOP class either. Sometimes I'm not sure why instructors do the things they do. Many students graduate by the seat of their pants, but really don't deserve it.

jsw
Feb 16, 2007, 11:42 AM
I'm not sure how you can teach a Java class, even an introductory class, for a whole term without focusing on OOP and touching on UML or some other method to show the relationships. C++ should be the same way.I think this is a fundamental problem with most curricula at most colleges. Students are taught pieces of the puzzle without being taught how they fit together or even really how to use the pieces. There's little or no cohesiveness between courses, and the goals of the course are rarely to improve real-world skills. It's like attending Home Depot University and having a course on each tool where they tell you exactly how it's made and, if you're lucky, ways you can use it - but without ever teaching you how to use all the tools together or when to use a given tool or how to use them as part of a team.

It would be nice if a degree in CS meant that a person would be able to actually integrate into a development team, but it doesn't. Often, all it indicates is that the person probably is interested in software development and maybe knows some interview question answers.

bousozoku
Feb 16, 2007, 12:47 PM
I didn't learn UML in my OOP class either. Sometimes I'm not sure why instructors do the things they do. Many students graduate by the seat of their pants, but really don't deserve it.

I think this is a fundamental problem with most curricula at most colleges. Students are taught pieces of the puzzle without being taught how they fit together or even really how to use the pieces. There's little or no cohesiveness between courses, and the goals of the course are rarely to improve real-world skills. It's like attending Home Depot University and having a course on each tool where they tell you exactly how it's made and, if you're lucky, ways you can use it - but without ever teaching you how to use all the tools together or when to use a given tool or how to use them as part of a team.

It would be nice if a degree in CS meant that a person would be able to actually integrate into a development team, but it doesn't. Often, all it indicates is that the person probably is interested in software development and maybe knows some interview question answers.

I'd found that by tutoring people. I still believe that students shouldn't touch a computer for the first year of development studies. They should be learning methodology, design, and documentation. Code first, design last is an attitude that happens far too often because many instructors and bosses think that you're supposed to be on the keyboard to be productive. I guess they've never heard "A stitch in time saves nine." or similar adages.

I'm beginning to think that business programmers know what they're doing more often, even though they're often ridiculed by high end software developers.

AlmostThere
Feb 16, 2007, 04:52 PM
Students are taught pieces of the puzzle without being taught how they fit together or even really how to use the pieces.
Of course, this is something that experience brings. Good programmers always keep learning throughout their career ... not to mention always keeping their minds open to new methods, possibilities and the advantages of more modern technology.

Spritey
Mar 5, 2007, 12:26 AM
I've been to a couple of career fairs and met potential future employers such as a couple of the leading IT consulting firms, and they say that they've moved over to java programming (and object oriented programming in general) and that's the language that's used in most of their projects nowadays when developing new software.

It also seems to be used a lot in the cell phone industry, i.e. for games and other random widgets.

I'm only in my 2nd semester of java, and I have no prior prog experience and i found it rather easy to learn and understand. I have some friends in CS, and I personally find it a bit more difficult to understand what's going on in C++ just by looking at the code they write. (But then again, I haven't taken any classes in C++)

Spritey
Mar 5, 2007, 12:29 AM
I didn't learn UML in my OOP class either. Sometimes I'm not sure why instructors do the things they do. Many students graduate by the seat of their pants, but really don't deserve it.


I never learnt UML in my java class, but interestingly enough I learnt UML in a class called 'System analysis' (not required or no way encouraged to take before taking java) and it helped me a lot in the java class where the prof said there was no point in learning UML... Especially grasping the whole object oriented approach.