Is python a bad choice?

Discuss how to write good code, break bad code, your current pet projects, or the best way to approach novel problems

Is python a bad choice?

Post by ampakine on Mon Jun 27, 2011 5:20 pm
([msg=59084]see Is python a bad choice?[/msg])

I decided to dive into learning a programming language (for programming applications not just web applications) so I chose python as a first language since you don't need to compile programs and Ubuntu comes with a built in interpreter. I've started learning the language but I really don't like the syntax. I'm used to PHP and javascript and I don't mind learning a language with alien (alien to someone thats used to PHP) syntax but python syntax bothers me for some reason. I don't like the way variables aren't explicitly declared and the way statements aren't closed with semicolons etc. One thing I do like though is the way indentation is used as a delimiter for functions/if statements etc. instead of { } brackets. That makes things a whole lot simpler and probably saves python programmers loads of time that would be wasted trying to find where you put in an extra { or left out a } bracket.

Anyhow would I be better learning C or java as a first language instead since both these languages have the kinda syntax I'm used to? Is linux a good OS to learn C/C++ on?
ampakine
Experienced User
Experienced User
 
Posts: 65
Joined: Tue May 31, 2011 5:21 pm
Blog: View Blog (0)


Re: Is python a bad choice?

Post by fashizzlepop on Mon Jun 27, 2011 6:43 pm
([msg=59088]see Re: Is python a bad choice?[/msg])

Python is a great choice especially as it will force you to think slightly differently.

If you are interested in something as simple as Python but with more PHP like syntax, look up Perl. ;)
The glass is neither half-full nor half-empty; it's merely twice as big as it needs to be.
User avatar
fashizzlepop
Developer
Developer
 
Posts: 2304
Joined: Sat May 24, 2008 1:20 pm
Blog: View Blog (0)


Re: Is python a bad choice?

Post by mShred on Mon Jun 27, 2011 10:30 pm
([msg=59111]see Re: Is python a bad choice?[/msg])

I too would suggest Perl for your needs. Faz pretty much summed it up.
ampakine wrote:Anyhow would I be better learning C or java as a first language instead since both these languages have the kinda syntax I'm used to? Is linux a good OS to learn C/C++ on?

To answer your last question, you can learn languages on any OS. But most people tend to think Linux is easier. Most distros come with Python, Perl, C compilers and whatnot already installed. With Windows, you'll have to download them and blah blah. It just seems simpler with Linux.
Image

For those about to rock.
User avatar
mShred
Administrator
Administrator
 
Posts: 1613
Joined: Tue Jun 22, 2010 4:22 pm
Blog: View Blog (2)


Re: Is python a bad choice?

Post by fashizzlepop on Mon Jun 27, 2011 10:37 pm
([msg=59114]see Re: Is python a bad choice?[/msg])

Linux's terminal is so much easier when developing small stuff especially. All I use is nano to edit most files. On windows you need to use notepad or something nasty.

Perl on Windows still works alright using Strawberry Perl.
The glass is neither half-full nor half-empty; it's merely twice as big as it needs to be.
User avatar
fashizzlepop
Developer
Developer
 
Posts: 2304
Joined: Sat May 24, 2008 1:20 pm
Blog: View Blog (0)


Re: Is python a bad choice?

Post by ampakine on Tue Jun 28, 2011 7:10 am
([msg=59126]see Re: Is python a bad choice?[/msg])

fashizzlepop wrote:Python is a great choice especially as it will force you to think slightly differently.

If you are interested in something as simple as Python but with more PHP like syntax, look up Perl. ;)

I've got the urge to start with C++ cuz I like the syntax but I think I'd better just stick to python because if its too complicated I'll abandon it since I have many things I wanna learn but limited time to learn them. Would you say learning to shell script would prepare me for learning how to program in python and other other languages? I've got the urge to learn that too because in the process I'll be learning how to use the command line better but I don't wanna side track too much from learning a programming language. If it'll teach me lots of things I'll need to learn anyway for programming then I'll start with shell scripting though.

-- Tue Jun 28, 2011 7:10 am --

fashizzlepop wrote:Python is a great choice especially as it will force you to think slightly differently.

If you are interested in something as simple as Python but with more PHP like syntax, look up Perl. ;)

I've got the urge to start with C++ cuz I like the syntax but I think I'd better just stick to python because if its too complicated I'll abandon it since I have many things I wanna learn but limited time to learn them. Would you say learning to shell script would prepare me for learning how to program in python and other other languages? I've got the urge to learn that too because in the process I'll be learning how to use the command line better but I don't wanna side track too much from learning a programming language. If it'll teach me lots of things I'll need to learn anyway for programming then I'll start with shell scripting though.
ampakine
Experienced User
Experienced User
 
Posts: 65
Joined: Tue May 31, 2011 5:21 pm
Blog: View Blog (0)


Re: Is python a bad choice?

Post by jpmut on Tue Jun 28, 2011 10:23 am
([msg=59132]see Re: Is python a bad choice?[/msg])

If you really like C++'s syntax but are intimidate by it's complexity then try Java. The syntax is nearly identical but Java is much simpler.

Would you say learning to shell script would prepare me for learning how to program in python and other other languages?

They're complementary. It doesn't really matter which you learn first. In fact, in my opinion, the hardest thing is learning the first language... Once you understand programming, learning other languages becomes easier. For instance, I've only learnt Java but I can now read most (unobfuscated) C++, Python, or php code, so when the time comes to learn these I don't think it'll be the same as when I started with Java.
The philosopher and mathematician Bertrand Russell was asked, "If a false premise can imply any conclusion, use 1 = 2 to prove you're the Pope!" Russell replied, "The Pope and I are two, so we are one."
User avatar
jpmut
New User
New User
 
Posts: 22
Joined: Fri Jul 03, 2009 1:13 pm
Blog: View Blog (0)


Re: Is python a bad choice?

Post by fashizzlepop on Tue Jun 28, 2011 6:38 pm
([msg=59145]see Re: Is python a bad choice?[/msg])

I'd say learn BASH second because it's such an ugly language. Perl and PHP are really similar and Java and C++ are pretty close. You can dip a little in all of them and choose your favorite.
The glass is neither half-full nor half-empty; it's merely twice as big as it needs to be.
User avatar
fashizzlepop
Developer
Developer
 
Posts: 2304
Joined: Sat May 24, 2008 1:20 pm
Blog: View Blog (0)


Re: Is python a bad choice?

Post by ampakine on Fri Jul 01, 2011 10:27 am
([msg=59287]see Re: Is python a bad choice?[/msg])

jpmut wrote:They're complementary. It doesn't really matter which you learn first. In fact, in my opinion, the hardest thing is learning the first language... Once you understand programming, learning other languages becomes easier. For instance, I've only learnt Java but I can now read most (unobfuscated) C++, Python, or php code, so when the time comes to learn these I don't think it'll be the same as when I started with Java.

I'm gonna go with either C or java. I had trouble with java runtime environment in the past so I'm gonna install it and if I can get it up and running easily enough I'm gonna start learning java, otherwise I'll stick to shell scripting then learn C in the future.


fashizzlepop wrote:I'd say learn BASH second because it's such an ugly language. Perl and PHP are really similar and Java and C++ are pretty close. You can dip a little in all of them and choose your favorite.

Yeah I agree, being used to PHP syntax, I feel sick just looking at BASH syntax. I started learning shell scripting anyway though cuz by doing so I'm forcing myself to learn the commands and get good with the terminal. It seems to be a convenient way to add little custom features to your linux installation. For example I used to always go to dictionary.com when I needed to look up a word but now I made an application launcher that calls a shell script like this:
Code: Select all
gnome-terminal --execute sh /home/ampakine/ss/dictionary.sh

heres the shell script:
Code: Select all
echo "Define:"
read dword
curl dict://dict.org/d:$dword

echo "Press any key to exit"
read stall

not much of a script, I could fit all that into a single line but I'm fairly proud of myself lol.
ampakine
Experienced User
Experienced User
 
Posts: 65
Joined: Tue May 31, 2011 5:21 pm
Blog: View Blog (0)


Re: Is python a bad choice?

Post by jpmut on Sat Jul 02, 2011 8:35 pm
([msg=59335]see Re: Is python a bad choice?[/msg])

To program in Java, you need Java Development Kit (JDK) not the Runtime Environment (JRE). Download the JDK and it comes with JRE as well. For someone who hadn't used the command line before, I was confused on how to get the "javac" command working, but it was as simple as adding it to the PATH variable in the System environment. Google "Changing PATH variable in {Insert your OS}" if the command isn't working.
The philosopher and mathematician Bertrand Russell was asked, "If a false premise can imply any conclusion, use 1 = 2 to prove you're the Pope!" Russell replied, "The Pope and I are two, so we are one."
User avatar
jpmut
New User
New User
 
Posts: 22
Joined: Fri Jul 03, 2009 1:13 pm
Blog: View Blog (0)


Re: Is python a bad choice?

Post by tgoe on Mon Jul 04, 2011 10:52 am
([msg=59405]see Re: Is python a bad choice?[/msg])

Skip bash entirely and learn sh. Notice your script doesn't actually use bash.

https://wiki.ubuntu.com/DashAsBinSh
User avatar
tgoe
Contributor
Contributor
 
Posts: 621
Joined: Sun Sep 28, 2008 2:33 pm
Location: q3dm7
Blog: View Blog (0)


Next

Return to Programming

Who is online

Users browsing this forum: No registered users and 0 guests