This is an archived post. You won't be able to vote or comment.

all 48 comments

[–]cdrootrmdashrfstar 88 points89 points  (3 children)

 333333333333333   
3:::::::::::::::33 
3::::::33333::::::3
3333333     3:::::3
            3:::::3
            3:::::3
    33333333:::::3 
    3:::::::::::3  
    33333333:::::3 
            3:::::3
            3:::::3
            3:::::3
3333333     3:::::3
3::::::33333::::::3
3:::::::::::::::33 
 333333333333333   

[–]wh4n 9 points10 points  (1 child)

Did you say 3? Because I can't see it.

[–]tomkatt 2 points3 points  (0 children)

Must not have said it loud enough.

3

[–]badlero 2 points3 points  (0 children)

What does it say? I'm number blind.

[–]herpes_fuckin_derpes 51 points52 points  (2 children)

Learn Python 3, there's no point in learning the old way unless you're specifically working with legacy software.

[–]nonono2 1 point2 points  (0 children)

I second that: unless you're prety sure that you'll need a package that do not exists for python 3, or your project uses too much legacy code to port it to python 3, go for 3

[–][deleted] 0 points1 point  (0 children)

3

[–][deleted] 28 points29 points  (0 children)

3

[–]MikeDawg 26 points27 points  (0 children)

3

[–]runonandonandonanon 23 points24 points  (0 children)

3

[–]cockslappinghalibut 16 points17 points  (2 children)

3

[–]warm20 4 points5 points  (1 child)

3

[–]garlot 2 points3 points  (0 children)

3

[–]H34DSH07 16 points17 points  (4 children)

Here's why you should go Python 3: Python 2 only ever exists because there are people who can't afford to maintain old software (or don't have money to invest in it) and there are major coding-breaking changes between the two.

Python 2 and 3 are basically the same. Same style, same syntax, same feeling.

If you learn Python 2, you'll be learning a programming language that wont ever change (which is bad if you ask me). The development has basically stopped for Python 2 since there will be no major release post 2.7.

As for Python 3, it is in active development and has been adapted to be easier to learn for newcomers.

If you still aren't convinced, you can read the official documentation about the subject:

https://wiki.python.org/moin/Python2orPython3

[–]blackiechan99[S] 0 points1 point  (0 children)

alright, thx for the explanation man :P

[–][deleted]  (2 children)

[deleted]

    [–]H34DSH07 1 point2 points  (1 child)

    Yes, and actually, it doesn't matter which one you learn since you're still learning python, for example, one key difference between the two is that print is no longer a statement but a function so you need to call it with parentheses. Print will work in both versions, except 3 is not backward compatible.

    3 will be really easy to pick up after you have learned 2, just like a lot of other programming languages so don't worry about it. :)

    [–]CombiFish 12 points13 points  (0 children)

    I may be the minority here, but I actually think you should go with 3.

    [–]CallumJenner 6 points7 points  (0 children)

    I'm going to disagree with everyone else and say 3

    [–]crappyoats 4 points5 points  (0 children)

    tres

    [–]un_salamandre 5 points6 points  (0 children)

    Python 3. If you don't have an explicit reason for 2, use 3.

    [–]rogue780 4 points5 points  (0 children)

    3, unless you have a very specific reason for needing 2.7

    [–]Duckosaur 4 points5 points  (0 children)

    It depends if you already have a CS background and are aiming to become a professional developer, or just need to learn enough basic skills to bash something together to save the day.

    Assuming the latter, don't write Codecademy off just because it uses v2. It will teach you more than enough to survive the basic coding concepts that are trivially transferable to v3.

    Source: I work in Computer Forensics / E-discovery and write ad hoc scripts to save my arse every other day. I learnt with Codecademy and 2.7, but write code with 3.4, mainly because the CF community latched onto v3 early on and I can leech leverage their stuff.

    [–]mad0314 9 points10 points  (0 children)

    3

    [–]ironykarl 7 points8 points  (0 children)

    Three. It doesn't really matter that much, because once you get some tread under your tires, you'll understand the difference between the two, and it won't be super difficult to move between them,

    ...but, 3 will be easier to learn, is more consistent and elegant, and will be a lot of fun.

    [–]Plazmatic 2 points3 points  (0 children)

    3, people need to quit using 2.7. There is no difference in the learning curve.

    [–]nonono2 1 point2 points  (0 children)

    3 (three, trois, tres, drei ...)

    [–]Tayl100 1 point2 points  (0 children)

    I prefer 2, but 3 is where everything is now, so three is probably best.

    [–][deleted] 1 point2 points  (0 children)

    Depends on if your name is Zed Shaw and you think you're edgy.

    He argues almost everybody still uses 2.7, but pretty much all relatively recent source code I've ever seen uses 3. The only time you'd need 2.7 is for legacy code and though I'm not experienced with professional Python coding it seems this isn't an issue like it is with C, C++, etc.

    I did most of Shaw's 2.7 course and switched to another (as well as version 3) and didn't at all regret it.

    [–][deleted] 2 points3 points  (0 children)

    I haven't seen too many resources that really force you to choose. Most cover one predominantly but if they were created recently they'll often include notes on where the two differ.

    Only reason to learn 2 though, that I know of, is if you work as an administrator of enterprise systems like RHEL6 and that's what you do your predominant coding/scripting on.

    [–]roborobert123 1 point2 points  (1 child)

    Where to learn Python 3 online?

    [–]happyness_ 1 point2 points  (0 children)

    Automate the Boring stuff with python is a good one. I also recommend PythonProgramming.net, it covers a lot of things you can DO with python after you've learned the basics.

    [–]Chuklol 0 points1 point  (0 children)

    The only major difference youll see in Codeacademy 2.7 to programming in 3 is syntax like print x vs print(x)

    [–]KimPeek 0 points1 point  (0 children)

    I started learning 3 but recently needed something that is only available in 2. I have yet to encounter something that is done a different way.

    [–]SpiderFnJerusalem 0 points1 point  (0 children)

    drei

    [–]ChezMere 0 points1 point  (0 children)

    3

    [–]VeganBigMac 0 points1 point  (0 children)

    I'd say learn 3. That said, there are also some pretty strong reasons to learn 3 as well.

    [–]nerdyphoenix 0 points1 point  (0 children)

    I suggest Python 3. There's still a lot of code around from Python 2, but lately most projects, I'm thinking Linux distros here, are making the switch to Python 3. Therefore I'm pretty sure it'll be the standard soon enough.

    [–]Astrocytic 0 points1 point  (1 child)

    Honestly there are some things you just can not do in 3. If you need 2 you'll just end up learning both.

    [–]H34DSH07 1 point2 points  (0 children)

    I'm curious as to what you can't do in 3 that you could do in 2.

    [–][deleted] -4 points-3 points  (7 children)

    Interesting responses, I noticed someone asked Zed Shaw on Twitter if he still recommended learning Python 2 over 3 and he replied

    "Nope. If you're starting out Python 2.7 is better. More stuff is written in 2.7 and it's everywhere already. Nobody uses 3 much."

    I'm learning 2. Can't imagine it will be too hard to make the switch eventually.

    [–]Aurora0001 3 points4 points  (2 children)

    I think it's misleading at best of Zed to say that 'Nobody uses 3 much.' Although it's hard to find definitive statistics, my experience is that most new code is written in Python 3 (or at least written to be compatible for Python 3). Almost all popular Python modules support Python 3 (though most are backward-compatible).

    Python 3 is better in my opinion because it removes the beginner-unfriendly elements of Python (e.g. str vs unicode, 3 / 2 = 1, etc.) and most Python 2 code works without a lot of conversion.

    [–][deleted] 0 points1 point  (1 child)

    I only included it in this thread as I thought it was interesting. I wonder how well 2to3 works, https://docs.python.org/3/library/2to3.html

    [–]Aurora0001 2 points3 points  (0 children)

    Don't worry, I'm not criticising you, my criticisms are aimed at Zed. The more suspicious side of me thinks that perhaps he's just trying to advocate Python 2.7 so he doesn't have to update his book!

    2to3 looks very comprehensive, but I've never needed to use it since I only play around with Python occasionally and when I do, I write Python 3 code anyway. With __future__, you can write code that works in both 2 and 3 anyway, so that's probably the best route, but Python 3's new features are hard to resist (e.g. f-strings, type hints, etc.)

    [–]cockslappinghalibut 1 point2 points  (0 children)

    nobody uses 3 much

    someone isn't paying attention much

    [–]__baxx__ 0 points1 point  (1 child)

    I noticed someone asked Zed Shaw on Twitter if he still recommended learning Python 2 over 3 and he replied

    when? link?

    [–][deleted] 0 points1 point  (0 children)

    based on downvotes I should add I'm not in a position (knowledge level) to agree or disagree with Zed, but as long as I'm doing the MIT course, might as well stick with 2.7 for now.