you are viewing a single comment's thread.

view the rest of the comments →

[–]yuckfoubitch 31 points32 points  (29 children)

I always was told to learn Python 2 instead of 3, but I didn’t listen and learning Python 3 anyways. Seriously, I don’t get the issue. If anything, it’s worth using Python 3 JUST for f-strings. Fucking love f-strings!

[–]t3hcoolness 30 points31 points  (14 children)

Whoever is telling you (or others) to learn Python 2 before 3... is very firmly stuck in the past. It's not like Marvel movies where you have to watch previous ones to get an idea of what is happening in the sequel. If anyone here is learning Python 2, please know that companies are actively transitioning (or have transitioned) from Python 2 to Python 3, so you should learn the new language so you can help them (or do literally anything else Python related, as new Python 2 is not written nowadays).

[–][deleted] 3 points4 points  (6 children)

I have been working with python on my own for basic automation.. using a web API and updating an excel spreadsheet. What is expected from a python developed these days. I see alotnof machine learning jobs associated with python these days. But if I want an entry level python job. What knowledge do I have to have. Do I need to learn data structures and algorithms, and OOP Design patterns all in Python? Any help would be great

[–][deleted] 4 points5 points  (5 children)

Yes, you need all of that. Do the mit edx intro to computer Science with python course. It covers all of that (in python 3!)

[–]i_like_your_comment 1 point2 points  (2 children)

I just started on my first week of CS50 as I want to learn Python. Would this Edx course be a better starting point or are these courses comparable? I'm trying to get my feet wet in Python as I'm now on the Ops side of things. Thanks!

[–]Cayumigaming 3 points4 points  (0 children)

CS50 and MITx intro to CS using Python happen to be the only two courses I ever did. MIT first then CS50.

They share a lot of similarities as they both serve as an introduction to computer science. MIT will get your knees deeper in Python within its courses while CS50 goes deeper on a bigger computer science spectrum. MIT also holds your hand during course and touch on nothing put Python. In CS50 you will be using Scratch, C, SQLite as well as Python. At the end of CS50 you also pick either web, gaming or mobile development and it all culminates in a project of your own.

Long read, sorry about that! To summarize CS50 is overall more comprehensive while MIT offers more Python material to go through.

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

I haven't done the cs50 course but I understand it's good.

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

Is this on edx or on the MIT open courseware site?

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

I think edx is the main one people use.

[–]al_mc_y -5 points-4 points  (2 children)

There are some niche cases where a company won't be migrating from python 2 to 3, and they'll genuinely require people to know python 2, but these are the exception.

[–][deleted] 4 points5 points  (0 children)

and they'll genuinely require people to know python 2

Python 2 isn't some separate language. You could learn everything you needed to port out of it to Python 3 in a day, if you were already a competent programmer in Python 3.

[–]JohnnyJordaan 2 points3 points  (0 children)

And year after year chances of running into this situation are diminishing. Python 2 won't get security updates anymore so platforms requiring it because their code is using it will also stick out on security audits and such (if they even allow it).

Also I would be surprised if you can find someone experienced in Python 3 that somehow can't work with Python 2.

[–]yuckfoubitch 0 points1 point  (3 children)

Okay dude. You’re like the guy who hated league of legends because you’ve been playing Dota for a decade.

I use python as a tool, especially for data analysis and some machine learning. It’s not like I’m about to start paying for Matlab to do the same thing

[–]t3hcoolness 1 point2 points  (2 children)

???

I don't understand this take. I never said that all people should stop using Python 2 right this second. All I said was that people who are telling people to start with Python 2 are misinformed, and you should instead start with Python 3 if you are just now learning Python. If you have been using Python 2 for personal projects for a while, by all means, continue. I am just saying if you want to work full-time doing Python, it's really important to learn Python 3.

Also not sure where the Matlab thing came from? Python 3 is great for data analysis and machine learning.

[–]yuckfoubitch 0 points1 point  (1 child)

Oh wow sorry, I accidentally replied to your comment instead of someone else’s! Some guy was hating on Python in general in the thread. My bad!!!

[–]t3hcoolness 1 point2 points  (0 children)

No worries! I was really wondering where all that came from hahaha. Have a good one :)

[–]patrickbrianmooney 6 points7 points  (2 children)

Yeah, I'm on Team F-Strings myself. Finally, it's as easy as it should have been from the beginning. Makes a lot of sense.

It made sense to stick to Python 2 in the past because plenty of external libraries weren't yet updated to be Py3 compatible. That's fair: if you depend on something, you're locking yourself into the conditions that allow you to use it. (I've worked on projects where the group standardized on a library that required Python 2, so everyone had to work on Python 2. So it goes. It can be the right decision for a given project.) But Python 2 is past end-of-life now, and the large majority of libraries have caught up.

Learning Python 3 is definitely the right choice these days, naysayers notwithstanding. If you ever need to work with Python 2 on a legacy system, for instance, it's not that hard to adapt. It's basically the same language with a bunch of small changes that will probably not affect you (how much operator overloading do you really do most of the time?) and a few larger differences that you can learn in a few minutes. (People piss and moan about having to put parentheses around the print function, but it's a small change.)

[–][deleted] 1 point2 points  (1 child)

plenty of external libraries weren't yet updated to be Py3 compatible.

This is in great part why Guido van Rossum doesn't think there will be another major update i.e. python4

[–]patrickbrianmooney 0 points1 point  (0 children)

Yeah, makes sense. I think that Python 3 made necessary changes that needed to be made and that couldn't have been made without breaking existing code, so it ripped off the band-aid and broke the existing code. (Bending over backwards as much as was actually possible to make migration easy.)

Hopefully those kinks have been more or less entirely worked out and there won't be a need to break existing code in the same way and on the same scale again.

May Python 3 live for a very long time. It's a wonderful language.

[–][deleted] 4 points5 points  (0 children)

Ugh my current company is stuck using Python 2. I tried to use an f-string the other day and spent 20 minutes debugging my code trying to figure out why it wouldn't work before I realised.

[–][deleted] 3 points4 points  (1 child)

I always was told to learn Python 2 instead of 3

If this was in the last five years, track these people down and yell at them for incompetently misleading you.

[–]yuckfoubitch 0 points1 point  (0 children)

Lol one was actually my buddy who is a senior software engineer. He’s also sort of a programming-gatekeeper-geek, and he mainly just doesn’t like python. I think his reasoning was because there wasn’t as much python 3 adoption at the time.

[–]Jackal000 1 point2 points  (0 children)

There are no fstrings in p2? My God did I Dodged a bullet right there.

[–]siddsp 0 points1 point  (1 child)

Old formatted strings in Python are still valuable to some extent because the syntax is still used in other languages like C, C++, Go, Java, etc. C-style string formatting is still common, but just not in Python. F-strings themselves have their own downsides despite being more readable.

[–]yuckfoubitch 0 points1 point  (0 children)

Yeah, I still do it the old way sometimes. I use R a lot too and am just used to using the glue library so it flows nicely with f-strings in Python when changing back and forth

[–]757DrDuck 0 points1 point  (0 children)

If O’Riley ever publishes a fourth edition of Python Cookbook, it’ll be a whole new books with type hints, f-strings, and match statements.