7
AleCx04
3y

Situation: I have a love hate relationship with python due to the lack of types as I have in more established languages such as C#, Java and shit even TypeScript

Situation (cont): A rather large codebase that i have developed for multiple processes at work run on Python.

I don't hate it, I just don't absolutely love it, there is a lot of things to like about Python, but man I do have some conflicts with it, I have been facing out to use other solutions that feel scripty, such as the newer versions of C# with .net, but I would say that about 80% of our codebase runs on Python, the rest is PHP.

I am somewhat traditional in the way my programs run, I started with C++ and Java, then for whatever reason (I blame codecademy at the time) switched over to Ruby and Javascript, mostly Javascript. I do not remember how I found Python, I do remember learning it with an online tutorial, shit was easy to get started with.

My codebase running on Python is huge, and they do a lot from automation scripts, to data gathering and database management, never had I been bitten with the "oh noes is so slow" bug since my code is not Google level big, for everything else Python seems rather fast imho

I dunno, big time love hate relationship

Comments
  • 3
    Python code requires a lot of discipline and knowledge on how easily it can go bad to keep it clean
  • 3
    @JKyll just like php and C, the languages are not bad and with discipline you can maintain big projects.

    But they contain some features that either should be avoided today or that require a good code structure to avoid a mess (the good code structure is probably valid for any language).

    And regarding speed, as with most cases its rarely the language that dictates the speed but IO.

    Or in one of the common cases for python, the math and ai libraries, and those are heavily optimized, often written in other languages.

    So the actual python code does not have to be lightning fast as its not doing the heavy lifting.

    And there are very many good libraries for python.

    So its often best to use the tools you know.

    That said, you should always test out alternatives so you do not get stuck with obsolete tech, but what counts in the end is if the job gets done :)
  • 2
    Well you could at least use mandatory (CI) type hinting validation
  • 1
    Static validator and type hinting exists 🤔
    Not the best solution, but can be added to the automated pipeline
  • 1
    well I believe google is still using python at scale so maybe you can use some of their tools like this for strong typing

    https://github.com/google/pytype
  • 0
    If your code is sensitive to white spaces that’s a 🚩
  • 0
    @shitbrains surely the homie means "of your programming language is sensitive to whitespace"
  • 0
    @iiii they do, but to me they be lacking compared to what I see in other languages
  • 0
    @vane thank you homie, i will check it out
Add Comment