Good high-level programming language

InorganicMatter

[H]F Junkie
Joined
Oct 19, 2004
Messages
15,464
I took a course in Matlab a year ago, and will be taking a course (Programming Applications for Electrical and Computer Engineers) covering C/C++/Fortran this semester.

I'm looking to learn another high-level programming language. Something that's useful on a day to day basis, and is pretty easy to learn. Nothing serious, just tinkering around. Cross-platform would be nice, as I'm split between Windows and Mac OS. So far, I've looked at:
  • Python
  • Perl
  • Ruby
  • Java
  • PHP (I know, not a real programming language)
But I'm overwhelmed with all the choices. I don't know that much real programming, so the idea here is to learn. I'd go for Java, but is seems like "everyone's doing it." Like I said, I'd like something to learn with, but is also useful in real life.
 

mikeblas

[H]ard|DCer of the Month - May 2006
Joined
Jun 26, 2004
Messages
12,776
"useful" depends on what you're using it for, as does "good".

Given what little you provide as influencing your choices, I'd consider Python or Perl.
 
Joined
Jun 24, 2001
Messages
974
I would recommend Python.

It is definitely faster to knock something together in Python than it is in Java because it is not as wordy and does not enforce classes or the like. It has a higher adoption rate than Ruby so far. As far as the other alternatives go, I just find it much more readable and natural to write than Perl and PHP.

Just one man's opinion.
 
Joined
Oct 28, 2004
Messages
722
Python is absolutely wonderful, I work in it constantly from smallish scripts to distributed applications. It's not always the best tool for the job, but I am a huge fan of using it for prototypes.
 
Joined
Apr 4, 2003
Messages
836
if you are an engineering student or are considering the engineering track, i would forgoe learning something new and instead master matlab, or learn more about how to use it.
 

Fryguy8

[H]ard|Gawd
Joined
Sep 26, 2001
Messages
1,707
If there _IS_ a right answer to this, python is probably it. Obviously lots of languages have lots of purposes, but it's really hard to argue against python for pretty much any application. The fact that it has a clean "move down" into C level apis for when speed is important is another plus.

If it's good enough for google to pick as 1 of the 4 languages they use in the company (Python, javascript, c++ and java is all they use), that's as good a reason as any for me to pick it over other choices.

Insane library support is another plus.

Django and/or wsgi is swell as well.
 

maw

Supreme [H]ardness
Joined
Sep 27, 2000
Messages
4,134
sorry if this sounds like a thread hijack, but with all the talk of Python, I've been interested in learning more about Python for web development. Does anyone have a good resource they can point me to? Or even post a "Hello World" type of example?
 

ambientZ

[H]ard|Gawd
Joined
Mar 1, 2004
Messages
1,466
sorry if this sounds like a thread hijack, but with all the talk of Python, I've been interested in learning more about Python for web development. Does anyone have a good resource they can point me to? Or even post a "Hello World" type of example?

The Python Tutorial is decent.

Hello world:
Code:
% python
Python 2.3.5 (#1, Aug 12 2006, 00:08:11) 
[GCC 4.0.1 (Apple Computer, Inc. build 5363)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> print 'hello world!'
hello world!

python is interpreted, so you get an interactive interpreter you can just type stuff in and see what it does.
 

Khanmots

Gawd
Joined
May 12, 2007
Messages
905
if you are an engineering student or are considering the engineering track, i would forgoe learning something new and instead master matlab, or learn more about how to use it.

I'd like to point out that you can generate C++ code from matlab... in a form that lets you create libraries out of your stuff. Highly useful.

What are you going to use your programming knowledge for? If you're anything like the engineers I'm working with it's not going to be to create fancy GUIs. You're not going to create web pages. You're not going to create apps for general users.

Instead You'll be coding up stuff to do mathematical analysis. You'll be wanting to do stuff that won't normalize nicely in matlab. You'll be wanting to throw in SSE optimizations for FP calcs.

But figure out what you're wanting to do with the language. Then we can help you pick it.

Personally I'd stay focused on C/C++, however if you're really wanting a scripting language... I found python to be pretty nice.
 

Thuleman

Supreme [H]ardness
Joined
Apr 13, 2004
Messages
5,833
Let's just start by re-stating the obvious: C/C++ are not "useful on a day to day basis, and is pretty easy to learn".

Then let's move on to talk about the need of optimization, oh wait, there is none!
In terms of course work it doesn't matter whether the analysis takes 5 minutes or 50 minutes, unless one is really in a rush I suppose because one waited till the last hour to turn a project in.

So then, let's talk about usefulness and ease of learning. Some good candidates up there, but in the end Ruby takes the crown. There simply is no scripting language as complete and easy as Ruby.

Check out "Learn to Program" by Chris Pine, and you will be coding your scripts in no time flat.
 
Joined
Apr 4, 2003
Messages
836
Let's just start by re-stating the obvious: C/C++ are not "useful on a day to day basis...".

i disagree. if you are EE or comp eng, you will eat, sleep, and breath C if you are doing embedded programming and the like.

Then let's move on to talk about the need of optimization, oh wait, there is none!
In terms of course work it doesn't matter whether the analysis takes 5 minutes or 50 minutes, unless one is really in a rush I suppose because one waited till the last hour to turn a project in.
.

i would HATE to be on a team with you. haven't you ever done a project that requires real-time analysis? i'd much rather collect and analyze 40 different sets of real-time data than collect and analyze 2 sets in the same amount of time. statistical analysis isn't very accurate when your data set is only 2 large, is it?


your post is what is wrong with young engineers and developers.

despite the fact that he/she/it disagreed with me, Khanmots' reply to my post is a very good reply, as are others even though they have suggested similar languages that you suggested.
 

sickwookie

Limp Gawd
Joined
Aug 2, 2005
Messages
151
It really does not matter what language you learn to program in. It matters more that you learn to program. Once you have learned the fundamentals of programming it becomes almost trivial to pick up and use a new language.

With that said and the fact that you are going to be learning C/C++ and fortran anyway I would steer you towards Groovy. It is a dynamic language with a easy learning curve, and it compiles to Java byte code for portability.
 

CreganTur

Gawd
Joined
Jan 15, 2004
Messages
882
But I'm overwhelmed with all the choices. I don't know that much real programming, so the idea here is to learn. I'd go for Java, but is seems like "everyone's doing it." Like I said, I'd like something to learn with, but is also useful in real life.

Some people scoff at it, but VBA is an extremely powerful programming language for controlling any and all Microsoft Office Applications. And, when you consider all of the 3rd party object libraries out there, you can do pretty much anything with it.

Most office environments use Microsoft Office, so learning VBA can help you automate tedious tasks, or enhance or create new processes to increase productivity.
 

Thuleman

Supreme [H]ardness
Joined
Apr 13, 2004
Messages
5,833
i disagree. if you are EE or comp eng, you will eat, sleep, and breath C if you are doing embedded programming and the like.
Maybe so, but the OP isn't an EE, he's merely taking one EE course. For just monkeying around in automating certain tasks, or writing small apps to do something or other, C/C++ is orders of magnitude too much effort.

i would HATE to be on a team with you. haven't you ever done a project that requires real-time analysis? i'd much rather collect and analyze 40 different sets of real-time data than collect and analyze 2 sets in the same amount of time. statistical analysis isn't very accurate when your data set is only 2 large, is it?
True, except the OP isn't asking about statistical analysis, is he now?

your post is what is wrong with young engineers and developers.
Actually, I was about to same the same thing about your post, just replacing the "young" with "old". ;)

The old guard tends to feel that since they went through the pain and suffering, everyone else has to as well. Since they had to spend days carefully considering every last byte of available memory, everyone else should do as well. Since they took pride in writing an inline function with the last amount of characters, so cryptic that even they themselves had no idea what it actually does just a few weeks after they wrote it, so should everyone else.

Times change, and most of these things are of no importance today. What matters is to write code that is easily understood by anyone, even those folks with the most basic background, because such code makes the most sense from a business point of view.

Maintainable code in a language that is easily read and also easy to pick up if you ever have to hire someone who is not an expert at it. That's what matters most. Yes, there are a few tasks here and there where execution times actually still matter, but in the end it's not about who has the fastest and shortest code, but about who has a working well documented and easily understood solution done as quickly as possible. And for that C/C++ is not the right tool.
 
Joined
Apr 4, 2003
Messages
836
Maybe so, but the OP isn't an EE, he's merely taking one EE course. For just monkeying around in automating certain tasks, or writing small apps to do something or other, C/C++ is orders of magnitude too much effort.

actually, we don't know what he is other than the fact that he took an EE course.. but being that he's taking a FORTRAN course, i think it's likely that he is pursing that track.

True, except the OP isn't asking about statistical analysis, is he now?

yes, and nor did he ask for an idiotic statement such along the lines that slow programs are a good thing. you stated that in a classroom setting there is no need to be concerned about efficiency. this flat-out WRONG. i gave you ONE example of why fast algorithms are necessary when they can be coded.

Actually, I was about to same the same thing about your post, just replacing the "young" with "old". ;)

i'm 24 years of age. does that qualify as "old" in your classification?

The old guard tends to feel that since they went through the pain and suffering, everyone else has to as well. Since they had to spend days carefully considering every last byte of available memory, everyone else should do as well. Since they took pride in writing an inline function with the last amount of characters, so cryptic that even they themselves had no idea what it actually does just a few weeks after they wrote it, so should everyone else.

no, they and i both realize the importance of efficient code.

as a side note, it is apparent that you have no idea what an inline function is based off of the way you used the phrase as support of your argument.

Times change, and most of these things are of no importance today. What matters is to write code that is easily understood by anyone, even those folks with the most basic background, because such code makes the most sense from a business point of view.

your first sentence in this section is entirely wrong. people get mighty pissed when it takes 30 seconds for a query to run, and especially if they run that query several times daily. if someone who isn't as ignorant of the science as you are can write the same part of code to operate orders of magnitude faster than yours, you are out of a job... whether their code is "readable" or not. THAT makes business sense.

as another side note, i would introduce the argument that code can be a little obfuscated and it will have almost no bearing on product maintainability if it has been engineered by competent people with great foresight who know how to architect a software system and document what each part does... however, if a system is constructed with maintainability in mind and you hire nothing but fresh college grads who have it in their head that efficiency doesn't matter, your product will surely fail even if the code is very easy to read.

one last side note... if you are speaking strictly in terms of web and scripting languages, you may be correct... but aren't you damn glad that the guy who wrote the interpreter for ruby paid attention when the old farts told him that efficiency matters?

Maintainable code in a language that is easily read and also easy to pick up if you ever have to hire someone who is not an expert at it. That's what matters most. Yes, there are a few tasks here and there where execution times actually still matter, but in the end it's not about who has the fastest and shortest code, but about who has a working well documented and easily understood solution done as quickly as possible.

i agree 100%. however, slow and memory-hogging code is not usually considered "working" code.

mikeblas always likes to talk about efficiency and often helps people wrap their hands around the subject and appreciate it better. why don't you visit some of the threads where he writes and see if you can pick something up? here are two types of common topics he likes to talk about that you could ask him about: sorting and searching... ubiquitous topics in software development.

And for that C/C++ is not the right tool.
really?

code me a simple multitasking operating system for my current client for the 8086 architecture in a language of your choice. you can't use C or C++. their requirements are that all code must be original (i.e. part of the standard set of the language or written by us). do you think ruby will make it on this one??

how about if you get a job doing intense real-time digital signal processing? will ruby work there?

C/C++ are very good languages for these and other applications, and they are the very best options for many applications.

and despite what you believe, efficiency matters today.

how about if you have to program a new wireless sensor? even if you are putting a JVM on it, you had better know how to code very well and have efficiency in mind. don't want to waste battery power on dumb thoughts like: "it's okay if i traverse this array in O(n) time every time it is accessed. i don't even need to analyze the situation because i read on the internet that efficiency doesn't matter anymore."

how about if you are writing a driver for a new device? i hope you don't litter your code with branches in the name of "readability" rather than inserting some comments to clarify your algorithm that craftily gets the same work done with half as many if statements and loops. otherwise your pipeline will be continually stalling and your driver will be slow.

...i think there are many more circumstances than you would like to admit where efficiency is a very high priority.
 

Thuleman

Supreme [H]ardness
Joined
Apr 13, 2004
Messages
5,833
one last side note... if you are speaking strictly in terms of web and scripting languages, you may be correct... but aren't you damn glad that the guy who wrote the interpreter for ruby paid attention when the old farts told him that efficiency matters?
Actually, he didn't, and it shows that Ruby doesn't scale well at all. The best example is Twitter, though you could argue that it's Rails that's holding it back and not Ruby per se.

C/C++ are very good languages for these and other applications, and they are the very best options for many applications.
The problem with a lot of folks these days is that they read what they want to read, not what's actually written. As you are reading what I wrote, you are already forming a response even though you aren't done reading yet, and the point is obviously missed.

The OP asked about which of the listed languages would be "useful on a day to day basis, and is pretty easy to learn. Nothing serious, just tinkering around."

I don't think anyone can seriously maintain the argument that C/C++ is the best choice to fit the above requirement. I am not saying C/C++ doesn't have its place, I am saying that for what the OP is asking about C/C++ is overkill.
 

devman

2[H]4U
Joined
Dec 3, 2005
Messages
2,400
I'm usually a big Java fan, but based on the OP reqs I'd say Perl or Python. Leaning more in favor of Python.
 

Dyslexic_Dog

Limp Gawd
Joined
Oct 1, 2005
Messages
260
If you're going to learn C/C++ you might as well pick up PHP and yes PHP is a language just the same as python or ruby. All three are interpreted languages, but support a wide variety of abilities. I recommend PHP because the syntax is very similar to C/ C++. PHP has also been shown to scale EXTREMELY well i.e. Digg.com. If you learn Object based programming when using C++ you should be able to transition to PHP objects fairly easily.
 

Scali2

2[H]4U
Joined
Apr 20, 2006
Messages
2,845
  • Python
  • Perl
  • Ruby
  • Java
  • PHP (I know, not a real programming language)
But I'm overwhelmed with all the choices. I don't know that much real programming, so the idea here is to learn. I'd go for Java, but is seems like "everyone's doing it." Like I said, I'd like something to learn with, but is also useful in real life.

Java is the odd one out in that list, if you ask me.
Especially Python, Perl and PHP are quite similar.

Java is more of an 'oldskool' programming language and is the closest to C/C++, which is what real programmers use :)
What are real programmers, you ask? Well, programmers that write all those wellknown OSes, applications, games and such that you use everyday (including the programming tools required to use these other languages). Oh yes, real programmers also use a smidge of assembly here and there, because even the almighty C/C++ can't cover everything.

So I think Java is the best step towards becoming a real programmer... And you want to be a real programmer when you grow up, right? ;)
 
Joined
Apr 4, 2003
Messages
836
Actually, he didn't, and it shows that Ruby doesn't scale well at all. The best example is Twitter, though you could argue that it's Rails that's holding it back and not Ruby per se.

i was referring to the time it takes to interpret a script. i should have been more clear. in general, i do not like MVC frameworks and only use them sparingly, so i will withold comment for someone with more knowledge on the subject.

The problem with a lot of folks these days is that they read what they want to read, not what's actually written. As you are reading what I wrote, you are already forming a response even though you aren't done reading yet, and the point is obviously missed.

The OP asked about which of the listed languages would be "useful on a day to day basis, and is pretty easy to learn. Nothing serious, just tinkering around."

i do tasks like this on a DAILY basis. many others do as well.

additionally, it also depends what you intend to do with your programming. the OP seems to be taking engineering courses. i would stick to languages he's likely to see in his curriculum so that he doesn't have to cram learning a language into the three-week timeslot students are usually given in a class to learn a language.
I don't think anyone can seriously maintain the argument that C/C++ is the best choice to fit the above requirement. I am not saying C/C++ doesn't have its place, I am saying that for what the OP is asking about C/C++ is overkill.

what i am saying is that under many more circumstances than you seem to be willing to admit, c or c++ are the very best optionsin many circumstances. not some circumstances. many circumstances. the world of software development encompasses more than web development and desktop application development.

http://hardforum.com/showpost.php?p=1032744584&postcount=9
http://hardforum.com/showpost.php?p=1032747681&postcount=12

read those two posts i made earlier this year concerning what i think about C. you'll understand soon after that i agree completely that C/C++ are inappropriate for some tasks simply because there are better tools. i disagree completely, however, with your assertion that C/C++ are "overkill" for the OP. if anything, i think learning a scripting language is a bad idea at best and overkill at worst because he'll waste time that he could be spending learning a language he's going to see very soon in his studies and will spend time learning functionality that he won't ever even see in his studies.

i think you're misunderstanding that i don't dislike ruby or language ____ at all. i just disagree with your idiotic statements. i don't think you're an idiot, mind you. you are just demonstrating yourself to be very ignorant of the field.
 

Scali2

2[H]4U
Joined
Apr 20, 2006
Messages
2,845
If I understood correctly, he'll be learning C/C++ and Fortran later this year?
Which is why I thought Java would be the most logical first step towards those other languages.
And in that case I don't get the debate on how useful C/C++ is or isn't. If it's what they use for those courses, he'll have to learn it.
I had to learn some pretty obscure and useless languages in my time at uni aswell. That's just how it is.
 

limxdul

Limp Gawd
Joined
Sep 16, 2004
Messages
465
If you want to do system administration or engineering I'd definitely look into learning perl.
 
Joined
Apr 4, 2003
Messages
836
If I understood correctly, he'll be learning C/C++ and Fortran later this year?
Which is why I thought Java would be the most logical first step towards those other languages.
And in that case I don't get the debate on how useful C/C++ is or isn't. If it's what they use for those courses, he'll have to learn it.
I had to learn some pretty obscure and useless languages in my time at uni aswell. That's just how it is.

that's what i am getting at --study material you know you're going to see coming up soon so you can spend that time learning more about the subject and doing better in it. the debate came because the individual doesn't believe C/C++ is worth the OP's time to learn, which is just wrong. even from a purely academic standpoint, the OP will understand how computers work much better if he learns C as opposed to a scripting language. and practically speaking, you also understand that it's a language he's going to see very shortly in class and the way i see it, he's probably going to be using it in the future too.

my recommendation again: learn more matlab or learn C or learn C programming in C++, but don't think you know C++ if you take this route.
 

Scali2

2[H]4U
Joined
Apr 20, 2006
Messages
2,845
I always say that C/C++ is the English of programming languages.
Just like how most scientific publications are in English (regardless of country of origin), most available code is in C/C++, and most publications use C/C++ in examples and such.
So it's very useful if you can understand and use C/C++, because of all the resources out there.

I mean, sure, there may be a lot of things written in PHP aswell, but most of it is web-related. If I want to write an MPEG encoder, I won't expect to find much useful PHP code. But I'm sure to find something in C/C++. I think that about 90% of all free/open code available is C/C++.
 

Sgarissta

Limp Gawd
Joined
Jul 16, 2003
Messages
168
I always say that C/C++ is the English of programming languages.
Just like how most scientific publications are in English (regardless of country of origin), most available code is in C/C++, and most publications use C/C++ in examples and such.
So it's very useful if you can understand and use C/C++, because of all the resources out there.
It all depends on the field. If you're looking for code for batch renaming files, or manipulating a directory listing, listing data on a web page, parsing a csv file, etc, then C/C++ are not likely to be the first search results, nor will they provide the easiest methods of getting the job done.

I mean, sure, there may be a lot of things written in PHP aswell, but most of it is web-related. If I want to write an MPEG encoder, I won't expect to find much useful PHP code. But I'm sure to find something in C/C++.

See above. But of course if you're looking for a low level component or library, look in a low level language.

I think that about 90% of all free/open code available is C/C++.

Making up statistics off the top of your head to support your argument is kind of silly isn't it?
 

Scali2

2[H]4U
Joined
Apr 20, 2006
Messages
2,845
It all depends on the field. If you're looking for code for batch renaming files, or manipulating a directory listing, listing data on a web page, parsing a csv file, etc, then C/C++ are not likely to be the first search results, nor will they provide the easiest methods of getting the job done.

The question is: what are you aiming for?
In my field, I don't want the easiest method, I want the best method. I have to deliver software that is as efficient, accurate and reliable as possible. It doesn't matter that much if the software takes longer to write, if it means it will find better use in the field. Failure could be catastrophic. It's an investment that will pay itself back.
 

devman

2[H]4U
Joined
Dec 3, 2005
Messages
2,400
most available code is in C/C++, and most publications use C/C++ in examples and such.
[Citation Needed]

I would imagine publications use the language they are geared towards, or they use pseudo-code.

So it's very useful if you can understand and use C/C++, because of all the resources out there.

There are lots of resources for lots of languages.

I mean, sure, there may be a lot of things written in PHP aswell, but most of it is web-related. If I want to write an MPEG encoder, I won't expect to find much useful PHP code.

It's all about using the right tool for the right job, there is no one size fits all.

But I'm sure to find something in C/C++. I think that about 90% of all free/open code available is C/C++.


I know most of the software I make use of for development and production purposes is Java based (if you wander over to the Apache Software Foundation a lot of their projects are java based). Plus you have companies like IBM and Red Hat devoting resources to open source Java projects I can think of a dozen right off the top of my head. Now obviously I run in to a lot of this stuff because I'm currently working with J2EE, but there is a ton of it out there.

That being said I stick with my earlier recommendation for Python
 
Joined
Apr 4, 2003
Messages
836
At work, I see everything from Matlab to Coldfusion. When we program on bare hardware, it's all in C.

Now, in Grad school when I look at projects, almost all of it is in C or C++. some is in LISP. Very little is in Java. I have not seen any other languages.
 

Scali2

2[H]4U
Joined
Apr 20, 2006
Messages
2,845
I would imagine publications use the language they are geared towards, or they use pseudo-code.

Your imagination is wrong.
As I said, C/C++ is like English.
Most scientific publications are in English, even if they're written by foreigners, geared at foreigners. It's just how the scientific world works. Most people understand English, therefore you use that language.
Likewise, the code is C/C++ most of the time, or pseudo-code, which often closely resembles C/C++.
The same goes for SDKs and such. If I download the DirectX SDK, I get a ton of examples in C++. I won't find anything in Java or PHP or whatever.
I downloaded the new Cuda 2.0 SDK yesterday, all C++ code.
A while ago I downloaded the ASIO SDK and developed a driver, again all C++.
PhysX SDK, all C++...
And obviously all documentation was in English in all cases.

There are lots of resources for lots of languages.

Yes, but by far the most resources are for C/C++.
Most other languages have a more limited scope in practice. Nearly all types of software are written in C/C++.

It's all about using the right tool for the right job, there is no one size fits all.

Not really, the 'job' here is learning how to program. The best tool for learning might not necessarily be the best tool to getting the job done aswell. It's about educational value.

I know most of the software I make use of for development and production purposes is Java based (if you wander over to the Apache Software Foundation a lot of their projects are java based). Plus you have companies like IBM and Red Hat devoting resources to open source Java projects I can think of a dozen right off the top of my head. Now obviously I run in to a lot of this stuff because I'm currently working with J2EE, but there is a ton of it out there.

Java is probably a close second to C/C++ these days. I know it's very popular at universities and such, because it's a very clean language, easy to teach the concepts of object-oriented programming.
It also has quite a wide scope. Aside from that, it's not too different from C++, so if you know Java, you can work your way up to C++ easily. The syntax is nearly the same, you just need to learn some extra concepts.

That's why I said to go with Java, and then work your way up to C++.
 

sickwookie

Limp Gawd
Joined
Aug 2, 2005
Messages
151
Java is probably a close second to C/C++ these days. I know it's very popular at universities and such, because it's a very clean language, easy to teach the concepts of object-oriented programming.
It also has quite a wide scope. Aside from that, it's not too different from C++, so if you know Java, you can work your way up to C++ easily. The syntax is nearly the same, you just need to learn some extra concepts.

That's why I said to go with Java, and then work your way up to C++.

First of all, Java has been the most popular programming language for quite some time now. In fact according to TIOBE it was only less popular than C for a short period in 2005-2006. As for C++ its popularity has fallen off consistently over the years, and there is no reason to believe that this decline will not continue. Of course "popularity" is a subjective thing, but a clear trend can be seen in the data regardless of the exact definition used.

Secondly, there is no reason to work your way up to C++ from Java. Many, myself included, would argue the other way around in fact. If you are a C programmer you can use C++ to work your way up to a "real" object oriented language like Java. In reality there is no directionality in learning programming languages. They are all different and for good reasons.

Going back to the post I made before it really does not matter what language one starts with. What matters is that the concepts are learned, understood, and applied. I could teach anyone to be a "good" programmer using JavaScript if needed. The reason being good JavaScript applies the same principles as good Java, good C++, or good Ruby.

I suggested Groovy in my first post. My reasoning is that the OP is going to be using C/C++ and FORTRAN, and I feel that it would be very helpful for him in his development as a programmer to see how the same principles of programming are applied in procedural languages like C/FORTRAN, an object oriented language like C++, and a dynamic language like Groovy/Ruby. This would also give him the opportunity to see the strengths and weaknesses of each approach and compare them subjectively.
 

Scali2

2[H]4U
Joined
Apr 20, 2006
Messages
2,845
First of all, Java has been the most popular programming language for quite some time now. In fact according to TIOBE it was only less popular than C for a short period in 2005-2006. As for C++ its popularity has fallen off consistently over the years, and there is no reason to believe that this decline will not continue. Of course "popularity" is a subjective thing, but a clear trend can be seen in the data regardless of the exact definition used.

Exactly, I never contested that. I just lumped C/C++ together, it's hard to draw the line between them at times.

Secondly, there is no reason to work your way up to C++ from Java. Many, myself included, would argue the other way around in fact. If you are a C programmer you can use C++ to work your way up to a "real" object oriented language like Java. In reality there is no directionality in learning programming languages. They are all different and for good reasons.

Well, my point was that he had to learn C++ anyway for the courses he's going to take later. So Java would be a way to work up to C++ when those courses arrive. It's already a given that he has to learn C++, so there's no need to debate its usefulness.
Otherwise I wouldn't insist on C/C++ because it's mainly for the more 'hardcore' programmers. If you just want to do some 'casual' programming, you could just stick to something a bit simpler and more userfriendly like Java, C#, VB or whatever. It all depends on how far you want to take this programming. If you want to be hardcore like me, then I'd say at least assembly, C and C++ are mandatory (aswell as a solid knowledge of mathematics... optimizing advanced algorithms and processes is usually done mostly by streamlining the mathematics and overall dataflow in the routine), and having a good look at C#, Java, PHP and perhaps some functional languages are good for building a wider frame of reference. You can pick up most languages in a matter of days, because you're familiar with the basic concepts anyway.

Other than that, I'd say that Java is much simpler and cleaner than C++ when it comes to dealing with objects. Java is like a 'dumbed down' version of C++ in that sense. They removed a lot of the low-level aspects like pointers and virtual or non-virtual methods and all that, and focus mainly on programming with objects themselves, not how they have to be implemented on the machine. So working your way up from C++ to Java seems strange to me. How can you work your way up from something complicated to something simple?

I suggested Groovy in my first post. My reasoning is that the OP is going to be using C/C++ and FORTRAN, and I feel that it would be very helpful for him in his development as a programmer to see how the same principles of programming are applied in procedural languages like C/FORTRAN, an object oriented language like C++, and a dynamic language like Groovy/Ruby. This would also give him the opportunity to see the strengths and weaknesses of each approach and compare them subjectively.

Yes, you have to do a bit of everything if you want to be a well-rounded programmer, but he doesn't seem to have that much time before he starts with C++, so I think that should be left for later.
 

sickwookie

Limp Gawd
Joined
Aug 2, 2005
Messages
151
Other than that, I'd say that Java is much simpler and cleaner than C++ when it comes to dealing with objects. Java is like a 'dumbed down' version of C++ in that sense. They removed a lot of the low-level aspects like pointers and virtual or non-virtual methods and all that, and focus mainly on programming with objects themselves, not how they have to be implemented on the machine. So working your way up from C++ to Java seems strange to me. How can you work your way up from something complicated to something simple?

Well I will answer your question with a series of my own questions.

what is high level vs. low level? Is Java more high level than C++? If we work from low to high are we working our way up? If we move from complex to less complex are we moving up or down?

More to the point, are we talking about the actual implementation details of the languages or your perceived hierarchy of languages? Is Java better than C++ or is C++ better than Java? Can "better" even be defined without first setting forth a set of criteria?
 

Scali2

2[H]4U
Joined
Apr 20, 2006
Messages
2,845
what is high level vs. low level? Is Java more high level than C++? If we work from low to high are we working our way up? If we move from complex to less complex are we moving up or down?

You seem to be confusing some concepts here.
In terms of a "high-level programming language", Java is higher level than C++. The 'level' in this context is basically how much of an abstraction of the underlying machine the language is. Java is more abstract, and as such hides more machine-specific aspects.

As such, this means that Java requires less knowledge of the machine, so if you're learning programming, Java is easier to learn than C++, because you need to know less.
Basically C++ requires you to know pretty much everything there is in Java, but also a lot of things that are more machine-related, like pointers, memory-alignment, endianness, and various other details.
So in terms of knowledge level, you're working your way up from Java to C++. But in terms of level of programming language as in abstraction, you're working your way down, closer to the machine.

As such, working your way up from C++ to Java makes no sense. If you know C++, you basically know Java implicitly, except perhaps for some syntax-specific details, but you'll pick those up in a day or two. The biggest part in learning to program is the concepts, not the syntax. You already know the concepts if you know C++.

More to the point, are we talking about the actual implementation details of the languages or your perceived hierarchy of languages? Is Java better than C++ or is C++ better than Java? Can "better" even be defined without first setting forth a set of criteria?

I don't think this discussion is about which language is 'better' in the first place, except ofcourse in the sense of which is easier to learn/meets his requirements better. In which case, I've already explained why Java is 'better' in this sense earlier in my post: there is less you need to know in order to use it.
Other than that, I don't really see why you need to bring it up in the first place. I think the context was pretty obvious.
The opening post already spelled out the criteria:
"I'm looking to learn another high-level programming language. Something that's useful on a day to day basis, and is pretty easy to learn. Nothing serious, just tinkering around. Cross-platform would be nice, as I'm split between Windows and Mac OS."
Whichever language meets those criteria better, is the better language in this context. In my opinion, Java is that language.
 

sickwookie

Limp Gawd
Joined
Aug 2, 2005
Messages
151
I don't think this discussion is about which language is 'better' in the first place, except ofcourse in the sense of which is easier to learn/meets his requirements better. In which case, I've already explained why Java is 'better' in this sense earlier in my post: there is less you need to know in order to use it.
Other than that, I don't really see why you need to bring it up in the first place. I think the context was pretty obvious.
The opening post already spelled out the criteria:
"I'm looking to learn another high-level programming language. Something that's useful on a day to day basis, and is pretty easy to learn. Nothing serious, just tinkering around. Cross-platform would be nice, as I'm split between Windows and Mac OS."
Whichever language meets those criteria better, is the better language in this context. In my opinion, Java is that language.

You are the one who seems to keep bringing up that C++ is somehow the better language which I why I asked the question of you. I feel that trying to learn Java in order to better understand C++ is a horrible reason to learn Java. If you want to learn C++ learn C++.

Since the OP is already going to learn C++ there is no reason to start with Java. In fact since the OP is going to learn C++ anyway there should be no reason to learn another object oriented language at this point. Once you know how to implement an algorithm in an object oriented language you know pretty much how to do it in any object oriented language. However, implementing that same algorithm in a dynamic language could present an entirely new challenge, and therefore provide the best opportunity to learn something new.
 

Scali2

2[H]4U
Joined
Apr 20, 2006
Messages
2,845
You are the one who seems to keep bringing up that C++ is somehow the better language which I why I asked the question of you.

Would you mind quoting what I said exactly, and where? Because I can't recall saying anything remotely like that.

Since the OP is already going to learn C++ there is no reason to start with Java. In fact since the OP is going to learn C++ anyway there should be no reason to learn another object oriented language at this point.

My experience is that a lot of people run away crying and screaming after their first encounter with C/C++ (and these are university students). It's just a very complicated language and you need to know a lot of things before you can really start to write code. Java is a much easier starting point for OOP, allowing you to concentrate more on the programming concepts themselves, and less on the machine-specific details. Especially pointers seem to be quite confusing to people who are new to programming. Java makes that a lot easier.
 

mikeblas

[H]ard|DCer of the Month - May 2006
Joined
Jun 26, 2004
Messages
12,776
Especially pointers seem to be quite confusing to people who are new to programming. Java makes that a lot easier.
I can't imagine hiring someone who doesn't know what pointers are. Since addressing and memory addresses are a fundamental concept in computer programming and architecture, why not teach 'em first? It turns out that computer programming is hard. Pointers and the underlying concepts are pretty concrete, especially compared to the ideas behind object-oriented programming. Most of the things you need from OO techniques are things you only realize you need after you've been programming for a while.

InorganicMatter says he just wants to tinker around. I think the most appropriate language for him, then, is one that's adept at whatever kind of tinkering he wants to do.
 

Scali2

2[H]4U
Joined
Apr 20, 2006
Messages
2,845
I can't imagine hiring someone who doesn't know what pointers are.

I'm not talking about hiring. I'm talking about people at university having to program C++ for the first time (even when they already know Java).

Since addressing and memory addresses are a fundamental concept in computer programming and architecture, why not teach 'em first? It turns out that computer programming is hard. Pointers and the underlying concepts are pretty concrete, especially compared to the ideas behind object-oriented programming. Most of the things you need from OO techniques are things you only realize you need after you've been programming for a while.

I agree, but that's not how the world works today.
'Old guys' like us, who learnt programming the hard way, know it works like this.
But these days people need to perform right away, so languages are simpler and the learning curve is less steep. As a result, we have a lot more people who can program, but only a small percentage is actually good at it.
 

mikeblas

[H]ard|DCer of the Month - May 2006
Joined
Jun 26, 2004
Messages
12,776
I agree, but that's not how the world works today.
What's not the way the world works? That people don't learn things in the right order? Do you really believe that people need to perform right away? So, first year pre-med students are doing cardio-thoracic surgery?

If they need to perform right away, why isn't the goal of learning the same as the goal of getting hired? Your note seems to point at settling: that's not the way things work, but the way things work is turning out people who aren't actually good at what they've spent years and tens of thousands of dollars to learn.

If your version really is the way things work, why not work to fix it?
 
Top