# First Language?

What would you suggest for a first computer language? Many people told me Python but equally as many said it probably wouldn't do what I wanted to. So, I was told I should try PERL or C++...what would you suggest?

Dagenais
The people who told you it wouldn't do what you wanted are idiots.

It can do practically anything.

I suggest Python. Try it, you won't regret it.

C and C++ are too hard to start out with for a first language. You will be more confused and it will take you longer to make worthwhile applications that are useful to you.

The "Hello World" program is usually used to demonstrate the language and its ease of use:

In C++:

#include <io stream.h>

void main()
{
cout << "Hello, World." << endl;
}

In Python:

print "Hello, World"

It is a small example, but the advantages of Python stand out.

I am quite sure my C++ is right, but please double check.

Last edited:
Python would be a nice starter language. Unfortunately it's not used alot in industry.

For true starter languages check out trueBASIC or Pascal.

Heck even the web languages like actionscript and javascript are great to start learning rpogramming concepts.

Dagenais
Python would be a nice starter language. Unfortunately it's not used alot in industry.

Python is not used in the industry because it is steadily growing. It should be used in the industry, and is a big part of NASA and Google.

It is powerful enough to be in the industry and I can't see it at a disadvantage against languages usually used in the industry like VB.

It should fair just fine.

For true starter languages check out trueBASIC or Pascal.

The point of using basic is now BASICally dead . Even VB.net has minimal BASIC programming in it. Do not learn it if you want to do something with your language. Do something useful that is.

Pascal is a good learning language, but I doubt it can be as robust as Python.

Heck even the web languages like actionscript and javascript are great to start learning rpogramming concepts.

Javascript won't take lots of learning. One should be able to learn it through webdesign. It is useful but he says that Python can't handle some of his needs, so his needs are probably much more advance than both Javascript or Actionscript can provide.

Haskell is a language to consider.

it probably wouldn't do what I wanted to.

What is it that you want to do. That has everything to do with what language you pick up.

Dagenais
What is it that you want to do. That has everything to do with what language you pick up.

I fail to see what Python offers would lack what a beginning programmer would want it to do.

Python would be a nice starter language. Unfortunately it's not used alot in industry.

Yes, that is antoher thing I heard. Well, I dont want anything too easy because if all Python is that simple, I wont be learning much. I want something that will help me make a lot of stuff online games, websites, you know stuff like that, there is a lot I want to do with it but first I would like to see what suggestions I hear. I have seen what PERL can do, and one of my family members is a Computer Programmer, she said that PERL isnt used as much as it used to be, but that there is supposed to be a new edition coming out within the next few years so there is no telling if it will come back. Basically all I know right now is html.

HBar
#include <io stream.h>

void main()
{
cout << "Hello, World." << endl;
}
Oh so many compile errors and warnings in so little code. Should be:
Code:
#include <[b]iostream[/b]>
[b]int[/b] main()
{
std::cout << "Hello, World.\n";
[b]return 0;[/b]
}
I code in C so i know only minimal C++. Because of that I think endl should work, but in MVC++ it throws out an error so i changed it to \n.
Whatever language you choose, I would stay away from VB. At first you'd probably like it because you can make decent programs pretty easily, but later on you will regret it. VB is not portable at all and teaches bad habits, among other things.
Perl might be a good language to start out with. It is basically the lazy man's C. It would be a good intro to C and C++ which is probably the most used programming langauge.
-HBar
note: i'm not sure how coherent this post will be, it is 2:16 in the morning after all ;).

If you want to do web stuff then C and C++ aren't what you want.

Guybrush Threepwood
Originally posted by kenikov

In C++:

#include <iostream.h>

void main()
{
cout << "Hello, World." << endl;
}

I am quite sure my C++ is right, but please double check.

works just fine if you write iostream in 1 word....

Shadow: you could try Java. It is a bit difficult at start but you can do everything you want in it....

STAii
Well, personally i started with VB, and i find it a good start.
I don't know what is meant by "VB teaches bad habits".
I find VB an easy way to start understand the logic of programming, (if, loops, conditions, subs, function ...), and some object programming, and data types, without worrying about pointers and this kind of stuff (which i think will be something hard for a beginnner).
After being quite well in VB, i tried to learn C, and it wasn't really hard knowing that i knew all the concepts of programming from VB.
About actionscripts, they are very strict, and you can get lot of errors in simple code, so i personally don't recommend it as a starting point (if you are not going to face trouble in actionscripting then you are not learning, since you are not doing complicated stuff).
I don't know about Python frankly, so i can't tell if it is a good starting point or not.

HBar
I don't know what is meant by "VB teaches bad habits".
I've only done a little programming in BASIC, but i assume the basic syntax was carried over. One of the first things i notice when i look at a BASIC program is how many goto statements there are. There is one example of VB bad habits. If you put a goto statement in a C or C++ program you need to be slapped. Furthermore:
By Machewy
1)
VB's 'object-oriented features' isn't really object-orientated. This is mainly because it doesn't fully support real polymorphism.

2)
In VB, it does not require one to declare his/her own variables, before they are used. This is a major mistake by Microsoft. Doing this will teach you a very bad habit, and its hard to get out of. When one does create a program using this method, it causes the system's resources to be used alot more than if the variable were declared before hand. Therefore, it is highly recommended, for all VB programmers, to declare their variables before they are used.

3)
VB has so many features, that a person could create a program with just clicking some buttons. This isn't real programming, and it teaches alot of lazyness, which isn't needed within a programmer's attitude. Once again, it is highly recommended for, all VB programmers, to type everything out by hand, and never rely on the easy way out.

4)
VB is not a very good tool to use when involving math. Its mathmatical platform isn't the worst, but it is rather sorry. Alot of the advanced mathmatical features are missing! Fortunatly, Microsoft did address a few of these problems in its newer version VB.net.
works just fine if you write iostream in 1 word....
yes, it will work that way, but the program is still violating many ANSI standards.
-HBar

Dagenais
Yes, that is antoher thing I heard. Well, I dont want anything too easy because if all Python is that simple, I wont be learning much. I want something that will help me make a lot of stuff online games, websites, you know stuff like that, there is a lot I want to do with it but first I would like to see what suggestions I hear. I have seen what PERL can do, and one of my family members is a Computer Programmer, she said that PERL isnt used as much as it used to be, but that there is supposed to be a new edition coming out within the next few years so there is no telling if it will come back. Basically all I know right now is html.

Python is simple, but it teaches many of the programming basics. You want something simple, I doubt you could hack a decent program in C.

Python can do everything you listed. I don't see what the problem is.

If all you know is HTML, you will have enough trouble learning Python.

go to www.hprog.org[/URL] . They have information on Python and other languages.

Perl doesn't do as much as Python.

[quote] code in C so i know only minimal C++. Because of that I think endl should work, but in MVC++ it throws out an error so i changed it to [/quote]

I double checked my code. Iostream should have been one word and it compiles just fine. The code is the exact same as mine in the book (free source/online) How To Think Like A Computer Scientist.

Your code is clunky. Mine looks better, and works.

I win.

Last edited by a moderator:
Dagenais
Perl might be a good language to start out with. It is basically the lazy man's C. It would be a good intro to C and C++ which is probably the most used programming langauge.

What can Perl do that Python can't? They are both easy to learn except Perl is used more in education (Python in CS classes).

Python can create powerful games, is portable, creates great web applications.

HBar
I never said that perl would be better to learn than python, i mearly said that it would be a good starting language.
Your code is clunky. Mine looks better, and works.
Your code violates ANSI standards. "void main()" is a big no no. Using void main with no return value is bad because that has a tendancy to return random values to main and you cannot check if it exited corectly. This can cause confusion, especailly if you use makefiles. There are also various other reasons.
You also didn't declare what namespace to use and in C++ you don't put .h at the end of a header. Readability is more important than clever tricks just so you don't have to type as much, especialy in something as trivial as a hello world program. If you are writing a kernel a few clever tricks would be excusable as long as it increases the efficiency. You especially don't want to show a person new to programming bad syntax.
-HBar

Dagenais
The syntax comes from "How to think like a Computer Scientist"

Find it online. It was written by a programmer, High school teacher and CS teacher in University.

HBar
The final word on syntax comes from ANSI. They make the standards for C and C++. They say that you always need to declare "int main()" and never "void main()". Using "void main()" characterizes your program as ill-formed. You can see for yourself in section 3.6.1 of the standards. If you want a more technical explanation of why they made that standard see here: http://users.aber.ac.uk/auj/voidmain.shtml [Broken]
I suggest you give the author of "How to think like a Computer Scientist" an email.
-HBar

Last edited by a moderator:
Dagenais
First, the program did what I and the writers of the book expected it to do. Demonstrate a "hello world" program.

It worked.

Besides that yours is longer and looks more clunky, I don't see a significant difference.

HBar
Just because the program works does not mean it is good programming. It working is the minimal requirement. Since the hello world program is the first program a novice program writes it makes it even more essential that correct syntax is used. You don't want to be developing bad habits right off the bat.

It doesn't matter if you think it looks clunky, the fact of the matter is it will run smoother if you use the right syntax.
-HBar

Dagenais
True.

I doubt he'll go C++ though. Even if he does, they probably won't finish.

Besides, Python includes some things from C++. Or was it C?

Anyways, Python has some of a lot of languages.

Thanks guys. So since a few people seemed against it and since i think it'd be way to hard to learn right now, It's between PERL and Python. Perhaps afterwards I will learn java since a lot of you seemed to suggest that too. Does it honestly matter if I do PERL or Python? Someone said they are basically the same and then someone said

Perl might be a good language to start out with. It is basically the lazy man's C. It would be a good intro to C and C++ which is probably the most used programming langauge.

so that swayed me in PERLs direction and then this was said:

Python is simple, but it teaches many of the programming basics. You want something simple, I doubt you could hack a decent program in C.

Python can do everything you listed. I don't see what the problem is.

If all you know is HTML, you will have enough trouble learning Python.

go to www.hprog.org[/URL] . They have information on Python and other languages.

Perl doesn't do as much as Python.[/QUOTE]

Which made me unable to make the decision, haha.

Last edited by a moderator:
Guybrush Threepwood
I didn't work much in Perl or Python, but from my limited experience I'd say go with Python . and don't forget about C and/or Java ...

hbar: the ANSI may rule, but all the C++ sources I've seen had .h at the headers. but you're right about the "void main" stuff

STAii
Originally posted by HBar
I've only done a little programming in BASIC, but i assume the basic syntax was carried over. One of the first things i notice when i look at a BASIC program is how many goto statements there are
Well, in VB, we rarely use Goto statements.
Anyone can misuse any language, when we talk about a language we should talk about it with a typical user.
A typical use (and any non-biggener) shall not need a lot of goto Statement.
I can tell that i use goto only once in every ... 20 programs i do, and this is ONCE in the WHOLE code.
I actually can't remember when i last used goto (although i have been doing a lot of programming lately)
2)
In VB, it does not require one to declare his/her own variables, before they are used. This is a major mistake by Microsoft. Doing this will teach you a very bad habit, and its hard to get out of. When one does create a program using this method, it causes the system's resources to be used alot more than if the variable were declared before hand. Therefore, it is highly recommended, for all VB programmers, to declare their variables before they are used.
Well again, the typical user uses "Option Explicit", when this option is on, every variable has to be declared first.
If you go to any VB comunity, you will hear that they all use "Option Explicit", and they all advise begginers to use it.
3)
VB has so many features, that a person could create a program with just clicking some buttons. This isn't real programming, and it teaches alot of lazyness, which isn't needed within a programmer's attitude. Once again, it is highly recommended for, all VB programmers, to type everything out by hand, and never rely on the easy way out.
Well, it is up to u wether to use the features or not, although i don't know what features the author was reffering to, most VB features are used for debugging, i can only think about the "Menu Editor".
And BTW, in any language, tools can be invented to make programming easier, and less 'programatically'.
4)
VB is not a very good tool to use when involving math. Its mathmatical platform isn't the worst, but it is rather sorry. Alot of the advanced mathmatical features are missing! Fortunatly, Microsoft did address a few of these problems in its newer version VB.net.
Yes, this is right, but you can still import libraries, and you can program what is missing if you need it .
BTW, if you are good enough at VB, you can use it along with assembly (making small functions in assembly and using them in VB), which might make ur work even faster than C.

Staff Emeritus
Gold Member
I strongly recommend against starting with Perl -- it's far too different from other languages, and will fill your mind with a lot of syntactical clutter that doesn't apply in any other language. Perl is, after all, a text-processing and glue language.

You are better off starting with Python, Java, or plain ol' C. You're going to need to focus on learning programming concepts -- flow control and simple algorithms mainly -- not on Perl's wacky syntax.

In addition, Python and Java (along with VB and so on) let you build graphical user interfaces to play with faster than instant mashed potatoes. A lot of students get rather bored with reading and writing files on a command line, which is how Perl is mainly used.

- Warren

Last edited:
Dagenais
Shadow, I am making it my mission for to start Python programming first. If you go with C++ you will give up in frustration of not learning anything and going around in circles, if you learn Perl you won't do as much and will have difficulty learning other languages.

If you take C++ later, you will have no problem if you know Python. Python takes a bit after C++ and can do the same things. Python is powerful and easier to use than C++. Python teaches all the fundamentals of Programming but is known to be powerful enough for the serious user. This is said by many and not just me.

You want to learn Java? Python also takes a bit from Java. There is also a Java version of Python, called Jython.

Python also takes a bit from Perl. It can do more than Perl as well. Many people hate perl though some like it.

Yeah thanks guys, I have decided to go with PERL. And thanks again Grady.

Dagenais
I predict, he'll give-up in less than a month.

HBar
The first language i learned was C and i never gave up.
-HBar

I predict, he'll give-up in less than a month.

You obviously don't know me Kenikov.

Dagenais
First-off, if you wanted to learn programming instead of letting us decide, you would of searched Google to choose the language that met your needs.

You would realize, that Perl cannot do all the things you listed if you researched correctly.

So, in short, I do not have to know you. I simply judge this by the your approach to learning.