5 ms·
>Is this done by purpose, or did they end up with a million lines of Python code and are looking for ways to make the maintenance easier? Definitely the latter
by nawgszy 9y ago
>Is this done by purpose, or did they end up with a million lines of Python code and are looking for ways to make the maintenance easier?
Definitely the latter. I've seen this discussion a few times before, and it's always the same. Your initial developers are not looking down the road to the million lines of code milestone, they're just trying to make a product that might actually make some money here and now.
I'm sure Instagram was exactly that. They needed to handle images and some guy knew how to do it in Python. They wrote Python code, and then people liked Instagram. They eventually became a billion dollar company with millions of lines of code and no where along the road was there time to say "hey we need to refactor this whole thing". Or if that was said, management laughed and said "we need this feature".
So here is where you end up. The developers need to clean things up but they don't have time to clean it up by using a language, realistically, they probably don't know as well as the Python they wrote the millions of lines of code in.
Re: your last comment, navigating a million lines of any codebase is daunting, and especially more so if you aren't a developer in that language. I'm not sure what exactly "Python" has to do with that, besides that you're not a Python dev.
- rusk 9y agoI'm not sure what exactly "Python" has to do with that Well as he said, a statically typed language is better in that kind of situation because it enables a better class of tooling and the typing system enforces certain style constraints, that enables better quality of code analysis en mass. Python specifically is very lightweight in this regards with little in the way of naming constraints (vs for instance Ruby having different formatting rules for different types) So yeah, it’s not “just like any other language” - horses for courses
- imiric 9y agoTo add to this, note that type hinting is quite a new feature in Python (introduced in v3.5, released in 2015), and this functionality simply wasn't available before. So any company heavily invested in Python today obviously wants to improve their runtime reliability, without having to rewrite parts of their stack. Stricter typing goes a long way to achieve this, and gradual typing allows you to upgrade the code base at your own pace, which is great. Consider this study[0] about TypeScript and Flow, which use the same approach for JavaScript, which found both able to detect ~15% of runtime bugs. So no wonder companies with large Python code bases would be the first to invest in this space. Personally I feel this is a great addition to the language, and hope type checking becomes a first class citizen too, instead of being delegated to external tools like mypy[1] or pytype[2]. [0]: http://ttendency.cs.ucl.ac.uk/projects/type_study/ http://ttendency.cs.ucl.ac.uk/projects/type_study/ [1]: http://mypy-lang.org/ http://mypy-lang.org/ [2]: https://github.com/google/pytype https://github.com/google/pytype
- miohtama 9y agoDropbox is very heavily invested in Python. I am under impression they hired Guido van Rossum to do exactly this, among other things. First 100% statically type the old codebase, then port it to Python 3. You can statically type Python 2 codebases, but the language does not offer native support for it. Thus, all needs to go to docstrings or comments.
- deleted 9y ago[deleted]
- jw- 9y agoI'd consider those languages optionally typed, rather than gradually typed, as they don't insert run-time type checks. Regardless, I still think it's all interesting and valuable work.
- IshKebab 9y agoNavigating a large code base that is dynamically typed like Python is far more tedious than something like C++ or C#. First you can't read what the types passed into and out of functions are. You have to find their usages to work it out. Second, you can't reliable do things like "find usages" or "go to definition" because of the dynamic typing.
- toast0 9y agoMost of the c++ and c# code I see lately has so many things declared as auto, it's hard for me to figure things out too.
- klipt 9y agoWould be nice if IDEs had a key combo to fill in the actual type for "auto"s!
- maxxxxx 9y agoThat would be nice!
- tigershark 9y agoAre you using notepad to write c#? If you hover on the var you will see the tooltip with the type.
- toast0 9y agoWhen I was writing c#, I did use visual studio, but since I'm used to developing in a terminal editor, all these tooltips and things are a little tricky -- sometimes they disappear, and then I can't get them back, etc. But more often, when I'm looking at c# or c++, it's not code I wrote, it's not code I intend to change, it's code that's interacting with my code (written in another language) that I'm trying to see why it's misbehaving, so I can get the owner to fix it. I could be reading the code on GitHub or some other web view, I might have checked it out, but I have no interest in setting up a (probably new) IDE to look at it as the author would; I dig into too many projects to learn that many tools -- and deal with the upgrade cycle for them. Sure, it would be useful to hover and get more information, but I'm used to loosely typed languages, so it's not awful. It's just jarring to see that the type information is apparently not important enough to write down the name in c++ or c# anymore.
- forgotpassagan 9y agoI can picture these poor souls vividly. Millions of lines of python, flowing like the mightiest of rivers. Nobody really knowing whence it cometh and goeth. A hero arises, offering a sacred herb to calm the torrent and light the golden path. The hero is elevated, yet they continue to pray
- btown 9y agoThey say there is a holy land called Haskell, but it is only revealed to the truest of believers without the weight of the chaotic-neutral entity “Shareholder” weighing ever so heavily on their shoulders. For those in Shareholder’s clutches, one must forgive their prayer. ‘Tis the best they can do.
- forgotpassagan 9y agoThere is something else, in the darkest reaches. It has many incantations, but the non-believers have a singular name. Lisp.
- arbie 9y agoWith it's comforting, reassuring warmth, Perl shines on as a luminous sun, lighting the way for youngling languages to learn from. Hushed whispers foretell the sunset, but none truly believe them...
- vgy7ujm 9y agoBack to Perl folks.. The freedom, the happiness !!
- jsjohnst 9y ago> forgotpassagan They have password managers you know and also spell checkrs too. :P
- tim333 9y agoLooking it up, it seems pretty much that: Kevin Systrom " thought of combining location check-ins and popular social games. He made the prototype of what later became Burbn and pitched it to Baseline Ventures and Andreessen Horowitz at a party. He came up with the idea while on a vacation in Mexico when his girlfriend was unwilling to post her photos because they did not look good enough when taken by the iPhone 4 camera." (Wikipedia) He used Django because I guess that was an easy way for one guy to do it fairly quickly. The app was Burbn which then pivoted into Instagram. By the way I kind of surveyed the "what framework should I use" stuff on HN over the last year and Django still seems the most popular, probably followed by Rails and Phoenix.