10 Replies - 989 Views - Last Post: 26 June 2014 - 09:20 AM Rate Topic: -----

#1 AGraska   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 6
  • Joined: 23-June 14

Python2 or Python3? (New to programming)

Posted 23 June 2014 - 08:35 PM

Okay, so I'm completely new to programming and I want to start with python. I'm not sure if I should start with Python 2 or python 3. I figured since python2 has been around forever that it would have more online sources to learn it, but again I'm completely new to all of this, so could someone please point me in the right direction? Thanks
Is This A Good Question/Topic? 0
  • +

Replies To: Python2 or Python3? (New to programming)

#2 Atli   User is offline

  • Enhance Your Calm
  • member icon

Reputation: 4241
  • View blog
  • Posts: 7,216
  • Joined: 08-June 10

Re: Python2 or Python3? (New to programming)

Posted 23 June 2014 - 08:38 PM

Generally speaking, unless you've got a very very compelling reason to stick to an outdated version, you'd want to go with the latest version.

Even if Python 2 has more sources to learn from, you are still learning an outdated version. Also, as Python is overall an extremely popular language, I don't really see you having trouble finding good resources on either version. The official Python docs, for example, are great for all versions.
Was This Post Helpful? 0
  • +
  • -

#3 AGraska   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 6
  • Joined: 23-June 14

Re: Python2 or Python3? (New to programming)

Posted 23 June 2014 - 08:43 PM

View PostAtli, on 23 June 2014 - 08:38 PM, said:

Generally speaking, unless you've got a very very compelling reason to stick to an outdated version, you'd want to go with the latest version.

Even if Python 2 has more sources to learn from, you are still learning an outdated version. Also, as Python is overall an extremely popular language, I don't really see you having trouble finding good resources on either version. The official Python docs, for example, are great for all versions.

Okay thanks for the input. I'll go with python 3
Was This Post Helpful? 0
  • +
  • -

#4 jon.kiparsky   User is offline

  • Beginner
  • member icon


Reputation: 11688
  • View blog
  • Posts: 19,857
  • Joined: 19-March 11

Re: Python2 or Python3? (New to programming)

Posted 23 June 2014 - 08:47 PM

Doesn't really matter which you pick. Learn one, either one, then look over the differences and get accustomed to the other.

You're going to need both - python 2 is not "outdated", it's a terminal branch of the language, and there will always be code in python 2. You can't not know it. Python 3 is not necessarily better, but it's going to be supported going forward, so you're going to have to know it as well. The nice thing, however, is that the differences are very minor, and once you know one, you more or less know the other, and it's just a matter of training some reflexes.

Quote

Even if Python 2 has more sources to learn from, you are still learning an outdated version.


Meh. Python 2.latest is hardly outdated. It's just run out of updates. Big difference - it's still a perfectly good language to work in, and people are going to be working in it for a long time to come.


One thing to keep in mind: if you go with 3, you will certainly be tripped up when you search stackexchange and when you look at existing online material. Expect this, and correct for it. 90% of what you find will be python2, and approximately none of it will identify itself as such. (because when the post was written, it was just "python"

This post has been edited by jon.kiparsky: 23 June 2014 - 08:52 PM

Was This Post Helpful? 0
  • +
  • -

#5 AGraska   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 6
  • Joined: 23-June 14

Re: Python2 or Python3? (New to programming)

Posted 23 June 2014 - 08:59 PM

Well I'm getting mixed opinions here. Which was expected lol. So I'm just going to go with Python 2 only because I think I'd be better off knowing it in the long run. Thanks for the opinions though guys. Cleared things up for me.
Was This Post Helpful? 0
  • +
  • -

#6 cfoley   User is offline

  • Cabbage
  • member icon

Reputation: 2392
  • View blog
  • Posts: 5,025
  • Joined: 11-December 07

Re: Python2 or Python3? (New to programming)

Posted 24 June 2014 - 07:53 AM

Learn Python 3.

Deliberately choosing an older version of any language is mistake.

There is always more software written in the previous version.
There are always more learning resources for the previous version.
There are always more Stack Overflow questions for the previous version.
There are always more blogs about the previous version.

But one day another new version will come out.
There will initially be few resources for it.
The current version will become the previous version.
It will have a larger codebase and more tutorials, SO questions and blogs.

When Python 4 comes out nobody will be telling you to learn Python 2, just like nobody is telling you to learn Python 1 right now. There will always be software written in these old versions and that software will need to be maintained. Buy you should learn for the future unless you have a job maintaining old applications. Even if you do have a job like that, you should stay up to date with the developments in the languages you use.

How did the Python 2/3 dilemma come about? The Python developers took a brave stance and took the language in the direction they wanted despite issues with compatibility. An unwillingness to do this has held other languages back and made it difficult to introduce some new features. Unfortunately, this broke a lot of individual lines of Python code. Most famously:

print "Hello World!" # fine in v2, not in v3
print("Hello World!") # required in v3


You can imagine that changing print breaks a lot of code. It's not the only change either. A lot of code has been broken by the change, making it difficult to port existing applications.

Python 2/3 might seem like a special case but it isn't. All new versions of languages break code written for earlier versions. This happens even when the language's developers try to make them compatible. It just happens that Python 3 broke a lot more things than usual. Some applications will never make the change but that's the way in all languages. There is always stuff maintained in earlier versions no matter the language.

However, the important thing for you is that you learn to program, not get bogged down in version differences. Pick a language, pick a version and learn to code.
Was This Post Helpful? 1
  • +
  • -

#7 AGraska   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 6
  • Joined: 23-June 14

Re: Python2 or Python3? (New to programming)

Posted 24 June 2014 - 08:16 AM

Okay, I still haven't officially chosen yet. I am wondering if I should even start with Python now. I might just going with something like C or Java, people say they're harder but I'm up for the task.
Was This Post Helpful? 0
  • +
  • -

#8 cfoley   User is offline

  • Cabbage
  • member icon

Reputation: 2392
  • View blog
  • Posts: 5,025
  • Joined: 11-December 07

Re: Python2 or Python3? (New to programming)

Posted 24 June 2014 - 08:41 AM

In a way, the language is the least important thing. You're learning to program. The language is just a vehicle for that.

The basic concepts are the same in all the languages that you have listed. Of the three, I would avoid C for your first language because it's not object orientated. OO is very important in today's programming.

We were bickering over two versions of Python. In reality if you choose the wrong one (whichever that is) it will matter very little.
Was This Post Helpful? 0
  • +
  • -

#9 jon.kiparsky   User is offline

  • Beginner
  • member icon


Reputation: 11688
  • View blog
  • Posts: 19,857
  • Joined: 19-March 11

Re: Python2 or Python3? (New to programming)

Posted 24 June 2014 - 07:11 PM

Meh again. Don't make life difficult for yourself. I think it's easier to go forwards than backwards, so I say learn 2 first, then take the 15 minutes to learn the things you need to change to work in 3, and you're good. This will be easier because you'll have the same problems that everyone else has had, and you'll be able to find the answers. If you go backwards, you'll run into the opposite problems, and it'll be harder for you.

But really, like I said, and like cfoley says, don't waste any time thinking about this decision. You're not picking your forever language. There's nothing permanent about this choice, it's just what you're going to work on next. The only wrong decision you can make is the decision to dither about this until you have the perfect right answer. Don't do that - pick a direction, and go. If you need to change course later, well, it's a lot easier to change course when the ship is moving.
Was This Post Helpful? 2
  • +
  • -

#10 cfoley   User is offline

  • Cabbage
  • member icon

Reputation: 2392
  • View blog
  • Posts: 5,025
  • Joined: 11-December 07

Re: Python2 or Python3? (New to programming)

Posted 25 June 2014 - 03:29 AM

Quote

This will be easier because you'll have the same problems that everyone else has had, and you'll be able to find the answers. If you go backwards, you'll run into the opposite problems, and it'll be harder for you.


Very good point. I still think learning 3 is the better option but this makes a lot of sense.
Was This Post Helpful? 1
  • +
  • -

#11 atraub   User is offline

  • Pythoneer
  • member icon

Reputation: 833
  • View blog
  • Posts: 2,264
  • Joined: 23-December 08

Re: Python2 or Python3? (New to programming)

Posted 26 June 2014 - 09:20 AM

I'm just gonna point out that DIC does have a handy search bar at the top, and it showed me this old gem which has a link to this page. Which very thoroughly covers this topic on the official python wiki...

This post has been edited by atraub: 26 June 2014 - 09:21 AM

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1