What Should I Learn First: Python, PERL, or C++?

  • Thread starter Shadow
  • Start date
  • Tags
    Python
In summary, C++ is a powerful and robust language, but it is not as beginner-friendly as Python.Python would be a nice starter language. Unfortunately it's not used a lot in industry. However, it is growing in popularity and should be able to handle most tasks a programmer may encounter.
  • #1
Shadow
19
0
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?
 
Technology news on Phys.org
  • #2
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. :smile:
 
Last edited:
  • #3
Python would be a nice starter language. Unfortunately it's not used a lot 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.
 
  • #4
Python would be a nice starter language. Unfortunately it's not used a lot 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.
 
  • #5
Doth quoth Shadow
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.
 
  • #6
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.
 
  • #7
Python would be a nice starter language. Unfortunately it's not used a lot in industry.

Yes, that is antoher thing I heard. Well, I don't want anything too easy because if all Python is that simple, I won't 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 isn't 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.
 
  • #8
#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 language.
-HBar
note: I'm not sure how coherent this post will be, it is 2:16 in the morning after all ;).
 
  • #9
If you want to do web stuff then C and C++ aren't what you want.
 
  • #10
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. :smile:

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

Shadow: you could try Java. It is a bit difficult at start but you can do everything you want in it...
 
  • #11
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.
 
  • #12
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 a lot 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 a lot 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
 
  • #13
Yes, that is antoher thing I heard. Well, I don't want anything too easy because if all Python is that simple, I won't 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 isn't 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:
  • #14
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 language.

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.
 
  • #15
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 tendency 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
 
  • #16
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.

It isn't bad syntax
 
  • #17
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
I suggest you give the author of "How to think like a Computer Scientist" an email.
-HBar
 
Last edited by a moderator:
  • #18
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.
 
  • #19
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
 
  • #20
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.
 
  • #21
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 language.

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:
  • #22
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
 
  • #24
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 a lot 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 a lot 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 :smile:.
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.
 
  • #25
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:
  • #26
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.
 
  • #27
Yeah thanks guys, I have decided to go with PERL. And thanks again Grady.
 
  • #28
I predict, he'll give-up in less than a month.
 
  • #29
The first language i learned was C and i never gave up.
-HBar
 
  • #30
I predict, he'll give-up in less than a month.

You obviously don't know me Kenikov.
 
  • #31
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.

Instead, you took a short-cut and simply asked. Something hackers hate.

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.
 
  • #32
I wanted to ask people who knew what they were talking about and for your information if I hadn't done research on them I wouldn't have had a hard time deciding which language to do. I have seen what PERL and Python can do first hand (from the programmers I mentioned way back) so I couldn't decide which one to chose. Is that okay with you or should I run all my decisions by you? and by the way, it was an accident that I typed I decided PERL, I really had decided Python I was looking at a link that someone sent me and at the moment I had been comparing PERL and Python. I had just read a little on PERL so it came out as PERL. If you don't believe me here is what I was using to check out a little more on each. http://cgibin.erols.com/ziring/cgi-bin/cep/cep.pl
 
  • #33
All I am saying is that if you did do research you would see that Python was clearly the language to choose.

http://www.hprog.org
 
Last edited by a moderator:
  • #34
and uh as I made clear in my last post i did chose it.
 

1. What are the main differences between Python, PERL, and C++?

Python, PERL, and C++ are all programming languages, but they have different purposes and syntax. Python is a high-level language that is known for its readability and simplicity, making it a great choice for beginners. PERL is a scripting language that is commonly used for text manipulation and system administration. C++ is a low-level language that is used for developing applications and system software.

2. Which language is the easiest to learn?

Python is generally considered the easiest language to learn, especially for beginners. Its simple syntax and high-level abstractions make it easier to understand and write code in compared to PERL and C++.

3. Which language is the most versatile?

All three languages have their own strengths and can be used for a variety of purposes. However, Python is often considered the most versatile due to its wide range of libraries and frameworks that can be used for web development, data analysis, machine learning, and more.

4. Which language is the most in-demand in the job market?

All three languages are in high demand in the job market, but the demand for Python has been steadily increasing in recent years. It is widely used in various industries such as web development, data science, and artificial intelligence, making it a valuable skill to have.

5. Can I learn more than one language at a time?

Yes, it is possible to learn multiple languages at the same time. However, it is recommended to focus on one language at a time to avoid confusion and ensure a solid understanding of each language. Once you have a good grasp on one language, it may be easier to learn another one.

Similar threads

  • Programming and Computer Science
Replies
3
Views
1K
  • Programming and Computer Science
Replies
10
Views
2K
  • Programming and Computer Science
4
Replies
107
Views
5K
  • Programming and Computer Science
Replies
6
Views
2K
  • Programming and Computer Science
Replies
7
Views
438
  • Programming and Computer Science
Replies
8
Views
867
  • Programming and Computer Science
Replies
17
Views
1K
  • Programming and Computer Science
Replies
1
Views
723
  • Programming and Computer Science
2
Replies
55
Views
4K
  • Programming and Computer Science
Replies
7
Views
867
Back
Top