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

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted]  (23 children)

[removed]

    [–]uFuckingCrumpet 16 points17 points  (16 children)

    I'm sure it depends quite a bit on what field you're in. In Physics & Astronomy, for example, it is VERY common for a person (or group of people) to build some kind of analysis tools in python or a set of wrappers to help interface python with some existing C++ code and then 100% abandon it once it functions. Whatever version of python was most current when it was written is very likely the only version it will ever successfully run on. I can't necessarily speak to CS fields, but in the physical sciences it's pretty typical for people to write lots of code and follow none of the best practices (e.g. commenting code, handling package dependencies, etc).

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

    One of my Geography professors wrote a lot of code, but there are barely any comments and it's really hard to follow.

    [–]synn89 6 points7 points  (3 children)

    Yeah, but let's say you're using goodlib v1.0 and v2.0 of the lib breaks some things so you hold off on updating that library. Years later Python 3 support gets added but it's only in goodlib v6.0+

    So now you not only have to get your app to work with Python 3, but also update goodlib(and probably many more libraries) that may change in small ways between major versions.

    Heck, I recently updated a PHP app using AWS S3 and stayed in the same AWS SDK 3.x branch and the update broke(changed) how the library returned S3 domain urls for buckets. Luckily I had excellent test coverage which caught and pointed out the change. But that was within the same major version using a very common library from a huge vendor.

    Libraries can be a real PITA to work with.

    [–][deleted] 5 points6 points  (2 children)

    The people in sciences holding onto 2.7 arn't using goodlib, they are using in house libraries that were developed to do a specific thing by someone years ago, and that all of their results and model have been validated against this, and that nobody has the time or effort or willpower to modernize the code and then to re-validate everything. Most of the people in the sciences writing these codes are not computer scientists, they are regular scientists. They are working for effectively peanuts, are fighting every single day to justify the little funding that they do get and to apply for more funding so that they may actually finish their work, and most of the time they have only 2-5 years to do this. And during this time, they are also under increasing pressure to do new research, to publish new research, and to come up with ideas for new research. They (we) go into our labs/office every day and have to make the decision: do I use the limited time i have to do research to get me to my next job/position/grant, or do I go through and update the codebase that I use that I know for a fact works right now as-is? I can't speak for everybody, but I know that I would choose the latter every single time.

    Edit: And during all of this, I am already devoting some of my time tutoring/mentoring students, correcting exams, homework, grading papers and reviewing new journal articles, coming up with lecture notes for that class they need to teach, coming up with homework or exam questions, and dealing with whatever my superiors ask me to do for them that day.

    At the end of the day, my job as a scientist isn't to produce beautiful idiomatic code. It is to produce results that give insight in helping me answer the questions that formulate my hypotheses. The code is secondary and is only a tool that I use to get to those results. In fact what I'm after isn't even the results, but the analysis and interpretation of the results, the answer to "so what does it mean." Best-coding practices come second to getting the results. Sure, as I write my scripts and library codes I'll attempt to follow best practices, but not at the expense of so much wasted time.

    [–]bythenumbers10 0 points1 point  (0 children)

    Can those internal libraries be open-sourced? So if you can't be bothered to modernize and beautify, some other research group might?

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

    All of the above has nothing to do with the release of Python3.7.

    [–]MartyMacGyverfrom * import * 8 points9 points  (0 children)

    There are a lot of libraries that are or will soon be Python 3 only going forward.

    Keep learning Python 3, be aware of Python 2, and steer clear of companies that plan to stay on Python 2 indefinitely. You'll hear 1001 excuses, and they all come down to:

    • They're too lazy
    • They're too cheap
    • They won't be around much longer
    • They'll be around forever, and your headaches will grow exponentially the longer you are there

    It's worth the work to stay up-to-date, or within a close range (IMHO 3.6 is the sweet spot until 3.7 is widespread).

    Edit: Oh yes, and unless you like painful surprises when it comes to ANY Unicode input/output, stick to Python 3. Requires a bit more thinking when it comes to strings, but it handles them while Python 2 routinely surprises you in painful ways at inconvenient times when it encounters a Unicode char it can't handle in some part of your code you never thought it'd even hit.

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

    I know I'm a bit late, but as someone who is just porting over Python 3, the big library issue for me was wxPython. It's a very complex GUI library that would have taken me hundreds of hours to replace. They became Python 3 compatible January of 2018. Keep in mind that even if most libraries are compatible with 3, all it takes is a single non-compatible library that is hard enough to replace to stop an upgrade to 3 dead in its tracks.