View Full Version : Programming language? Which one?
Darkness3477
February 21st, 2006, 01:30 AM
HI all, I know there is a sticky on this, but I would rather have my own thread so you can easily answer my question, without having to look through it to find it. Anyway, here it is...
I've wanted to start programming for awhile, and I have had a few half arsed attempts at doing so in Python. I brought a C++ book last year, but at the time I felt it just a bit too hard, and too over my head to really get into it. However, I kept going for two weeks or so, only half understanding what I was doing. I then went to Python, and could make more programs in it on the first day (because I didn't have to learn arrays and all of that) then I ever could using C++. Most of the programs I made mostly were maths based and really just did my homework for me (in a way, as I still had to type everything in, but it gave me the answers... Which is cool). ANyway, that was a couple of months ago. And in that time I feel that I have matured immensly and that my understanding of how computers work has also doubled. So, Do you think I should start to learn to program again using Python, which I understand the simplest of programming with, or go into C or C++ and stuggle through but come out of it knowing alot more -although with slightly less hair-, or find another language to learn?
I know alot of you will ask what I want to program, but I cannot honestly say that I reall know, other then I want to try to make anything and everything. I also know XHTML (Well enough to make some good sites), I have a very limited understanding of JavaScript -Which I don't want to improve on in any time soon, as I've done enough of making websites- and I know my way around computers, understand networking well enough and other things like that.
So, I would love some facts, opinions and warnings. Whatever you may be able to give me, it will be greatly appreciated.
P.S. My goal after completing this year at school is to get into the year 11 and 12 programming and advanced computing coarse, then go into Uni and do Computer Science.
LordHunter317
February 21st, 2006, 01:37 AM
Most of the programs I made mostly were maths based and really just did my homework for me (in a way, as I still had to type everything in, but it gave me the answers... Which is cool).If your intrest is Math-based stuff, you should learn Octave, which is an OSS clone of a software package called Matlab. Matlab is a matrix-computation language that's used very heavily in engineering (perhaps excessively so) and can do all sorts of fundamental math stuff very trivally. There's tons of information about it online, most of it very practical. I think almost every EE textbook on my shelf has at least some Matlab code in it.
That depends on how pratical and real-world oriented you want to be, though.
ANyway, that was a couple of months ago. And in that time I feel that I have matured immensly and that my understanding of how computers work has also doubled. So, Do you think I should start to learn to program again using Python, which I understand the simplest of programming with, or go into C or C++ and stuggle through but come out of it knowing alot more -although with slightly less hair-, or find another language to learn?It's up to you. I know good C++ and Scheme texts that teach both the language and how to program. Both will require serious discipline on your part, though.
I know alot of you will ask what I want to program, but I cannot honestly say that I reall know, other then I want to try to make anything and everything.Well, you need to figure that out first. Unless you have the discipline to enforce an academic program on yourself without academia surronding you, you probably won't get far without a goal in mind. What you pick is less important than the fact you pick somethign and stay with it. It doesn't have to be practical or worthwhile, BTW. It just shouldn't be excessively ambitious.
Darkness3477
February 21st, 2006, 01:44 AM
I'm not really that drawn towards Maths, as it's one of my worst subjects (Yet I'm still in the second highest class), and the only reason I made programs to do math stuff was because it's fairly trivial and it's the only thing I can make easily.
Whe I say I've matured alot, it's more based around that I've got the ability to stay focused to tasks, such as learning new things.
Ah thats the thing, I would love to make everything. Which is why I want a language that has the ability to do anything, and I know C++ can do pretty much anything, yet it can be overkill to use it for really trivial things (Like my maths homework, lol.)
Maybe a suggestion on what things are fairly easy to make whilst starting out could be helpful. I just had an idea! Maybe a few encryption/decryption programs would be fun, as I really like learning new security things....I hate using that word, 'things'.
LordHunter317
February 21st, 2006, 01:52 AM
Ah thats the thing, I would love to make everything. Which is why I want a language that has the ability to do anything,That's practically all of them, though some things are eaiser in some languages over others.
and I know C++ can do pretty much anything, yet it can be overkill to use it for really trivial things (Like my maths homework, lol.)So? Overkill isn't necessarily a reason not to use something. If you can write in faster in C++, that's usually reason enough to pick it.
Maybe a few encryption/decryption programs would be fun, as I really like learning new security things....I hate using that word, 'things'.Write a program to dictionary brute-force passwords, ala John the Ripper. That's a good start, requires you to make intelligent decisions about data structures and algorithm choices, and can be written in any language.
Darkness3477
February 21st, 2006, 02:05 AM
I think I might go get out my C++ book tonight, after I've done some other things on the computer. Thanks for your help.
Toodles, as I'm off.
P.S. Please leave anything else here you might want too.
nemik
February 21st, 2006, 02:41 AM
depends on what you wanna code. I LOVE making web-applications. So i picked up PHP and MySQL. Love them both and am best at PHP. but i also dabbled in perl, c, c++, and have pretty good java knowledge. i work as a J2EE/servlets/jsp developer.
i just got into python though because i like new things, and it seems to be great for GUI/desktop apps.
I think it all depends on what you want to do; there are many sides of programming.
but python is a great introduction language to programming IMO. java is good too, but after dealing with it for so long, i think it is too verbose and like python more.
either way, good luck in whatever you decide! :)
Plank117
February 21st, 2006, 03:27 AM
You're a bit like me. I mainly wanted to learn to program so that I could make little tools for myself. In fact, one of my first C programs was a little algorithm that prime-factored numbers.
My advice? Start with C. It's harder to learn than Java or Python, but it's good to start out programming in C so that you get used to doing things very procedurally. Do C for awhile, then go to Java. Java's great because you get experience with object oriented programming (OOP). And finally, C++. C++ is the most commonly used language in industry nowadays, and it's sort of the middle ground between C and Java. It's object oriented to some degree, but it's like C in that it is also very procedural.
Well, that's what I did, mostly by accident (starting with C was my father's recommendation, and he was programming back in the days of BASIC punch cards) but happened to work out pretty well because I didn't piss my pants when I first saw C++. It's probably the most complex language out there, but I understood OOP pretty well by then and I'd been coding in C for a while as well. I mainly use Java now, because I'm still in high school and that's the language my CS class is using, but I've got a pretty solid foundation in C++. But, if you're just going to program little tools for yourself and stuff like that, I'd recommend going straight to Java. I only followed this rather meandering route through three languages because I plan to study for a Master's in Electrical Engineering. While not explicitely required, a strong CS background is a darn good thing for an EE to have.
So there's my three dollars and seventy-two cents.
Darkness3477
February 21st, 2006, 04:17 AM
Thanks very much for your post, it has helped me out alot. I'm about to go have a look at some C code and then some Java code and hopefully that'll give me some sort of indication of which language is right.
At the moment, however, I am feeling like Java would be a good place to start. Yet you said c is a good place to learn, as it would make learning Java and C++ easier to learn. And one day, I do think I'll need to learn C++.
Thanks, I'll be scooting off to find some source code.
Revert
February 21st, 2006, 08:17 AM
I don't think C would be a very good place to start. About all you'd gain from it that would be relevant to C++ would be an understanding of some of the syntax, and considering Java, C++, and Python are all (to varying degrees) OOP languages, I'd say it'd be better to start with something focusing on that paradigm so that you can get used to it.
Java's what I know the best, and it's pretty decent. Depending on your level of committment, you may consider choosing it over C++ to start with because it lacks some of the nuances (such as pointers) of C++.
Python's very human readable, and I find the whitespace based syntax agreeable (although not everyone does). Due to its human readableness, I find it much easier than other languages to prototype and understand algorithms in. It'd probably get the nod for my suggestion.
LordHunter317
February 21st, 2006, 11:43 AM
My advice? Start with C. It's harder to learn than Java or Python, but it's good to start out programming in C so that you get used to doing things very procedurally.That's a poor reason, because we don't think or design things procedurally anymore.
Java's great because you get experience with object oriented programming (OOP). And finally, C++. C++ is the most commonly used language in industry nowadays, and it's sort of the middle ground between C and Java.You have that backwards: Java is far more popular than C++. And Java's OOP, while commonplace, has several deficiencies. I'm generally against teaching it for learning OOP concepts for that reason.
It's object oriented to some degree, but it's like C in that it is also very procedural. It's multi-paradigm. It's fully procedural, fully OO, fully a generic language, and an almost fully-functional language.
Depending on your level of committment, you may consider choosing it over C++ to start with because it lacks some of the nuances (such as pointers) of C++.Except Java does have pointers. In fact, that's all it has for classes.
Houman
February 21st, 2006, 02:55 PM
I think you should consider Java as a first language to learn, first of all its OO so you can easily move to C++ and other OO langauges afterwards, second is that if you want to do math stuff I think its superior to C and C++ in the way that it provides you with a lot of utilities that you dont have in C and C++ ( you need third party libraries)
If you take a look at Java API you see a ton of algebra and geometry utilities there which dont exist in C++/C, (unless you want to write all of them from scratch)
Also if youre not sure which platform you will be working on (Linux/Windows) its better to go with Java, you can run the same code on either one, in fact Java provides its own GUI functionality, so unlike C++/C you dont have to resort to OS dependent libraries;
In brief, i think Java is a nice language to start with (and to stay with, its got everything youd want!) because everything is at your fingertip, and its portable;
LordHunter317
February 21st, 2006, 03:48 PM
I think you should consider Java as a first language to learn, first of all its OO so you can easily move to C++ and other OO langauges afterwards,Not to C++, which adds lots of useful concepts you can't use in Java, that are wortwhile to learn. Real multiple inheritence, proper control over virtual functions, non-member functions, etc.
second is that if you want to do math stuff I think its superior to C and C++ in the way that it provides you with a lot of utilities that you dont have in C and C++ ( you need third party libraries)No, it isn't. The builtin stuff is terrible. It's slow and unituitive to use.
If you take a look at Java API you see a ton of algebra and geometry utilities there which dont exist in C++/C, (unless you want to write all of them from scratch)Nonsense. Look at BLAS, and all sorts of CAS systems. Just run a 'apt-cache search'. All are largely eaiser to use and faster than their Java equivalents. Where they're not eaiser to use, you can wrap them to make them that way.
so unlike C++/C you dont have to resort to OS dependent libraries;You don't either. OTOH with Java, you have to install a JVM. So much for "platform indepedence". Such a myth anyway.
Revert
February 21st, 2006, 05:34 PM
Except Java does have pointers. In fact, that's all it has for classes.
I was meaning pointer support in respect to such things as pointer arithmetic. Sorry. :)
Also, as Houman said, Java's much easier to transfer between OSs if that's a feature you require.
Houman
February 21st, 2006, 05:36 PM
What useful concepts?
multiple inheritance? i thougth thats a bad thing and was removed in java on purpose, it creates ambiguity and I myself never had any use for it (and keep in mind I was talking about a "beginning" langugae, i doubt a beginner would start out by needing to use multiple inheritance).
And nonmember functions? a properly design program in OO fashion wouldnt have many nonmember functions, if you find you have to use a lot of dangling functions i think you should rethink your designs;
and by control over virtual functions, i dont really know what you mean, I havnt actually used Java in a while, but I remember back in the day when I was learning Java I read that most differences between Java and C++ are due to the fact that Java came after C++ and so based upon the collected wisdom of the folks who made Java they decided not to include some features of C++ for good reasons (which i dont remember) ; anywyas Java came after C++ and so the differences are mostly improvements according to most people;
the built in stuff is terrible and slow? I dont think its terrible, they have nicely written classes (such as their matrix class which i used alot) and i dont think a few microseconds delay would matter to a beginner who wants to run some simulations (and Java is slow? thats the myth)
As for the math libraries, I looked up BLAS, if it shared libraries youre talking about cant he just call them from his Java code if he doesnt like Java's math classes? besides, I said everything is at your fingertips in Java, which means you dont have to get a library for math stuff, a library for GUI stuff, and etc. .Each library you use imposes some resctrictions on how you can code, the other day i was looking at GTK+ and it said if you wanna write a program using GTK you shoudl use their library rather than STL (or some such inconvenience) anwyyas I rather use as few third party stuff as possible;
and getting the jvm, come on thats hardly an inconvenience, searching and finding a good third party math library for example is i think harder than getting the jvm;
anywyas i think youre trying to refute a claim that C++ is better than Java, but I never made such a claim, i said for a beginner its better to start form Java. I think anyone who makes a claim like that (some language is better than other) is mistaken, I think they all have something to offer otherwise they wouldnt be around;
thank you for your comments
Houman
LordHunter317
February 21st, 2006, 05:59 PM
I was meaning pointer support in respect to such things as pointer arithmetic. Sorry. :) Oh, yes. I'd almost consider that a misfeature, most of the time. Certainly except when you need bare-metal performance (and I wouldn't be opposed to a C#-esque unsafe construct for being able to do things like pointer arithmetic).
multiple inheritance? i thougth thats a bad thing and was removed in java on purpose,No, it wasn't. It was replaced with a something significantly more constrained: multiple interfaces. It's effectively the same construct while removing some difficult ambiguities (namely, the dreaded-diamond in C++) but leaves some drawbacks.
However, other decisions in Java (mainly, the eventing) mean the lack of full MI is a real PITA. Basically, anytime you want to inherit an Adapter class, you're forced to create an (anonymous) inner class because you're invariably extending something else already.
it creates ambiguity and I myself never had any use for itJava's solution still creates ambiguity: you can't define seperate versions of the method ToXml() if two inherited interfaces define it. This can lead to unresovable conflicts if they have different semantic meanings.
C# provides a solution to this BTW, and makes the lack of full MI much less painful., since it provides anonymous methods instead of classes.
And nonmember functions? a properly design program in OO fashion wouldnt have many nonmember functions,No, incorrect. Non-member functions enhance encapsulation, not weaken it. Why? Because they can (by definition) be dependent only a functions public interface. It means they are hidden from the implementation details as well.
Consider a simple class to add two points:class Point {
private:
int x_;
int y_;
public:
Point(int x, int y) : x_(x), y_(y)
{}
int x() const
{ return x_; }
int y() const
{ return y_; }
double distance()
{ return sqrt(x_*x_ + y_*y_);}
};Now, consider this non-friend, non-member function:double
distance(const Point& point)
{
return sqrt(point.x()*point.x() + point.y() * point.y());
}Now, if I change how x_ and y_ are defined internally, I have to change Point::distance() unless I was very careful to define it using only the public interface. With the non-member function, that risk is simply non-existant because it must use the public interface.
and by control over virtual functions, i dont really know what you mean, I was mistaken. I had it in my head you couldn't define a member method as 'final' but that's not the case.
I havnt actually used Java in a while, but I remember back in the day when I was learning Java I read that most differences between Java and C++ are due to the fact that Java came after C++ and so based upon the collected wisdom of the folks who made Java they decided not to include some features of C++ for good reasons (which i dont remember)Nope, they made a fortune of bad decisions with regard to OOP.
the built in stuff is terrible and slow? Yes, it is. It doesn't look like real math.
and getting the jvm, come on thats hardly an inconvenience, searching and finding a good third party math library for example is i think harder than getting the jvm;Not if you're distributing software, it isn't.
Houman
February 21st, 2006, 06:44 PM
I see your point regarding that example, but distance should be a part of your class's interface, now i see how using the public interface is advantageous in this case, i guess you could use those public interfaces in a member function as well? I mean whats the harm in bringing that second version and making it a member?
I mean if nonmember functions were so good why C# and Java which both came after C++ dont have them? maybe its because they could create a maintenance problem if people start using them every where? im not really sure;
I use nonmember functions alot, and I dont think its becasue im a good C++ programmer, more like because I am still thinking C as it was the language I used more often, and now my code looks like some awful hybrid of C and C++ flows like structured code but uses OO concepts once in a while :|
thanks,
Houman
LordHunter317
February 21st, 2006, 07:00 PM
I see your point regarding that example, but distance should be a part of your class's interface,It is. Not having something a member function doesn't mean it's not part of the interface, as long as the behavior is always defined.
The only disadvantage is you lose the ability to provide overriden versions in subclasses, i.e., you can't have a virtual non-member function in most languages. Some support multimethods, which is a whole different ball game (virtual w.r.t. multiple members).
However, most classes have lots of functionality that doesn't need to be overriden that only needs the public interface.
This is the case for example, of nearly all the helper functions in the factory classes I write.
I mean whats the harm in bringing that second version and making it a member?You lose the ability for the compiler to enforce encapsulation.
I mean if nonmember functions were so good why C# and Java which both came after C++ dont have them?I honsetly don't know. I suspect because Java is a bad copy of smalltalk and many ways and C# copied Java on purpose.
Certainly, Java at least made a lot of seemingly inexplicable decisions that have never truly been properly justified.
I will agree that to inexperienced programmers, the fact that all the methods you can usefully call on an object aren't defined as part of the object can be upsetting. You have to remember that you can call sort(object). That's not something that will be documented in 'Automated Documentation for class Foo' unless your document generator is really good or people take the time to properly augment it.
NoWhereMan
February 28th, 2006, 10:27 AM
maybe ot, what do you think guys about ruby ?
http://www.ruby-lang.org/en/
vBulletin® v3.8.0 Release Candidate 2, Copyright ©2000-2009, Jelsoft Enterprises Ltd.