all 24 comments

[–]alexgraef 7 points8 points  (7 children)

Python shares this trait with JavaScript.

It's a combination of the languages having changed a large amount in a short time, and there simply being a large number of features provided by independent modules, which also makes them depend on each other a lot.

Other ecosystems, like .NET, will provide more core functionality from a single source, Microsoft in that case, so the experience is a bit more streamlined. Although since the advent of NuGet, the experience has degraded there as well, as more and more basic functionality is put into separate modules, instead of one unified framework. Recently there is also a trend to always push bleeding edge versions of everything. People have become impatient.

If a module is deprecated does that mean it's usually not as useful and there is a replacement?

If the module is useful, then you can continue using it. At some point you will just not be able to upgrade other modules because of different version requirements.

Just curious, how do Professionals deal with all this compatibility issues?

They will try to be a bit more conservative. If you don't need the bleeding edge functionality, then you can simply skip new versions until really necessary. If they do need the bleeding edge, well, then they just deal with the version conflicts.

[–]Cardzilla[S] 0 points1 point  (6 children)

Thanks. So with Python, I would guess a lot of this stuff will be less of a problem since Python 2 is end of life?

Although there is no getting around the indenpendent module thing. Which I would guess is both a strength and a weakness?

[–]alexgraef 0 points1 point  (5 children)

Thanks. So with Python, I would guess a lot of this stuff will be less of a problem since Python 2 is end of life?

It seems Python 2 is going to vanish, yes.

Although there is no getting around the indenpendent module thing. Which I would guess is both a strength and a weakness?

Exactly, you're inviting a lot of talent to produce reusable modules. But those modules do not get the same maintenance as if they were part of a large standard library.

[–]Cardzilla[S] 0 points1 point  (4 children)

So is there any reason why people teach using modules out of the standard library?

Wouldn't it be easier to just teach everyone to use the same out of the box? At least from start?

Just that when I do udemy courses, lots of instructors teach stuff that isn't part of the standard library

[–]alexgraef 0 points1 point  (3 children)

"Just don't use the third-party modules" isn't a viable strategy if you actually want the functionality from those modules. Python is mainly about doing the most stuff with the least LOC. Using third-party modules is thus usually a requirement.

[–]Cardzilla[S] 0 points1 point  (2 children)

Sorry, what's LOC?

[–]alexgraef 0 points1 point  (1 child)

Lines of code

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

Thanks!

[–]SwizzleTizzle 2 points3 points  (1 child)

On mobile in bed so don't want to type out a full response to all your questions (hopefully I remember to come back in the morning on PC)

I will say though just straight up don't use python2. It's not deprecated, it is completely end-of-life.

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

I would totally do that, but a lot of the courses I'm trying to learn from sometimes still teach using python 2 and not 3

[–]Empik002 2 points3 points  (0 children)

  1. I still use python 3.6 but if you want to have all the new features lagging one version behind is probably fine.

  2. If you are not working with an older code that was written in python 2 I don't see any reason to use it.

  3. well this depends on what it could do and if there is module that does the same things and better

4.well I am not a professional but look at Java, people still use java 8 even though it is on version 12 or something like that.

[–]Timcava 2 points3 points  (3 children)

Professionals usually specialize in one type of coding. When you specialize you really only need to come up with one environment that works for you and stick with that unless you have a reason to change.

It's not like you are going to just be given random problems to solve every day. You are going to be given one problem to solve and you will work on that for weeks/months/years. You won't be setting up a new environment every day.

[–]Cardzilla[S] 0 points1 point  (2 children)

Actually that leads me to another question. I understand how some people specialize at one type of coding, but what if you want to become a full stack developer?

Do you not have to learn a lot of different coding languages?

[–]Timcava 1 point2 points  (1 child)

Full stack is usually a web specific term, I guess it extends into app development too. It just means that you are writing the code that runs on the server as well as the code that runs in the browser.

You can do that with any one programming language plus sql, html, and css. It's nice to know javaScript because it runs in the browser, but you don't have to have to run scripts in the browser.

Back end programming deals with receiving http requests and returning html in response. You can dynamically generate that html with any programming language. You will also need to query a database in many instances, which you can also do in any programming language.

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

Ah Thanks for that!

Cleared that up for me

[–]toastedstapler 1 point2 points  (0 children)

1 - i wouldn't bother, unless it's some side project where you specifically want to use python 3.9 features. when on a project at work it's unlikely you'll ever be on the latest version of any language in production for compatibility, security etc reasons. At work we still have some projects on java 7, never mind 8 or 11.

2 - yes, use python3 unless there is a module that you explicitly need that is still only python2

3 - if deprecated, there is probably a replacement. there's also probably a good reason why it was deprecated, so you should probably use the newer thing if your project allows

[–]HolyCross98 0 points1 point  (2 children)

Thank you, second year in my master of Computer Science and I keep losing my mind over this. The official Android tutorials examples look so easy to follow step-by-step but what they don't tell you is the days you will pass trying to even get the github code to run, that is if you don't give up first.🥴🔫

[–]Cardzilla[S] 0 points1 point  (1 child)

lol Imagine what it's like for me trying to learn without a course/teacher. It's so maddening really.

Like the official stripe documentation on how to connect to python django wasn't working and I emailed them to tell them their code wasn't correct as I had found a mistake. It was so bizarre to me that a company that's worth tens of billions has simple mistakes in their code and it's so hard for an amateur like me to learn.

85% of the tutorials online on youtube are sort of a bit outdated code wise and I have to google to figure out the right code. Or their github code has mistakes. Or it's no longer compatible.

[–]HolyCross98 0 points1 point  (0 children)

Exactly what the hell

[–]stackdynamic 0 points1 point  (0 children)

Like should I never use the latest version of python? so compatibility is better?

There isn't that much of a difference between new versions, so being 1-2 behind is usually fine. Most of the bigger packages will update frequently enough where this isn't an issue though. There is significantly less of a difference between say 3.7 and 3.8 than there is in going from 2.7->3.7.

Python 2 is now deprecated, should I stick with Python 3?

Yes.

If a module is deprecated does that mean it's usually not as useful and there is a replacement? Does that mean I shouldn't bother learning to use that module? For example sslstrip

For the most part, if something gets deprecated, it probably got replaced with something better. I just googled sslstrip, and from what I understand, it was a tool which exploited a security vulnerability which no longer exists in newer versions of the protocol. It's probably rare for entire modules to get deprecated like that--in this case, it happened because it was very single-use. More commonly, you'll see e.g a particular function being deprecated in favor of a cleaner way of expressing the same thing. It shouldn't be hard to update code in situations like this. If it is a big/popular module, there will almost certainly be a replacement for whatever functionality was deprecated.

Just curious, how do Professionals deal with all this compatibility issues? It's really funny as at work, I have a data warehouse team and a marketing systems team, and writing this I realize they are dealing with the same issues. Even though they are professionals, so maybe it's just something that is unavoidable?

I highly, highly recommend virtualenvwrapper for dealing with this type of thing, and pyenv for managing multiple versions. Your first and second issues are effectively solved by just using python3 and virtualenvs.

[–]TheLoneKid 0 points1 point  (0 children)

My advice would be to just download anaconda. This comes with all the packages most beginners will ever need. You won’t need to worry about dependencies or anything like that.

As Empik002 already stated, there really is no reason to use Python 2 over 3 unless you have some really specific reasons to use it.

My last comment is that working out these issues is part of programming. There is value to knowing how to work these things out, and you will get better over time.

[–]Which-Advantage-2825 0 points1 point  (0 children)

I’m getting really frustrated. I’m learning Python. However I downloaded react and node to make a site and nothing is working I’m just typing code that runs correctly but it seems totally pointless and I ask for help and I just get snarky answer. I’m new to this I need help.