5 ms·
Nor will python. Python is dynamically typed. It may not be impossible to write big functioning python apps, but it's damn hard. And specifically, it's a lot h
by waps 12y ago
Nor will python. Python is dynamically typed. It may not be impossible to write big functioning python apps, but it's damn hard.
And specifically, it's a lot harder than doing it in java or C++. I've seen C++ codebases that exceed 8 million lines of code and held together (not without friction, that I guarantee). I've seen java codebases with about half that that held together a lot better than the C++ ones.
Even accounting for the fact that python easily lets you achieve 5 times as much in the same amount of lines (at the cost, imho, of more surprises when wrong types get passed to your functions). I'm not sure "normal python" is more than a little bit more succint than (good) C++ though. Easier to read, sure, if you're allowed to make assumptions about types. But not that much shorter.
I've yet to see the first million line python codebase. And python has certainly had sufficient time to develop such codebases. Why aren't they here already ? Those C++ codebases were almost operating systems though (with extremely tricky threading support libraries, every project it's own of course), something you fundamentally can't do in python. The java codebases were financial stuff though, something that could easily be done in python, and they certainly have the money to absorb the increased hardware cost, and looking to have faster development turnaround. That's another discussion I can guarantee you will have with your boss if your app really grows, the hardware cost. When it comes right down to it, a programmer is worth (rule of thumb) about 15 servers. If python means one less programmer, but 50 extra servers, you will lose that discussion with your boss.
Dynamic typing is certainly a massive advantage for small codebases. It becomes more and more of a disaster on larger ones though. So an IDE for python ... it merely lets you lose the battle with your code that much faster.
- markbnj 12y agoWell, yes, I agree. I don't know what the largest python code bases are, but I would not expect them to get to the size of some of the really big systems written in strongly-typed system-level programming languages like C or C++. However, I would also suggest that the need for huge code bases like that is diminishing. Much of what we build now consists of smaller bodies of code, sitting at the end of a service pipeline, or collaborating in a distributed system. Python works very well in scenarios such as implementing API endpoints which are really glue between layers anyway. And it's certainly been shown that significant applications can be written in it. But if you're facing something that is Department of Defense-sized, maybe it's not the right choice.
- falcolas 12y agoI have personally worked on a 7 man team on a 2.5m LOC codebase in Python (Python 2.4, to be precise). It wasn't public, though. Working on the code base with dynamic typing wasn't _that_ hard. Certainly not as hard as people make it out to be.
- waps 12y agoI'd be interested in hearing more about this codebase. What was it's function ? Are you including libraries ? What is taking up so many lines of python ?
- collyw 12y agoDo you include all libraries when you measure the size of a codebase? One of the main benefits of using Python for me, is that there is usually a (decent quality) library written. If you are having to re-implement everything from scratch and are not including the libraries. The last thing close to a million lines of code I worked on was horrendous. Legacy banking app in VB6 (after MS had stopped support). I would write a method to do something, then a month later I would find another method somewhere else in the code doing the same thing . At the time I had a lot of Perl experience and could see looking at it the code size could be halved using a more powerful language, and in my opinion, that would have reduced the chance of repeating code (though to be fair the management practices were a far bigger offender).
- nick_dm 12y agoPython is currently making inroads in finance, both Bank of America and JP Morgan have large projects involving it. I've worked on one of them, and like you I'm unusure if it's a good long-term plan, though I don't have experience with large codebases in other languages. Performance is an issue and navigating a large Python codebase is tricky. One thing that doesn't help is that many of the developers come from Java/C#/C++ and pick up Python quickly but with "unpythonic" habits, the code ends up being almost as verbose as Java but with none of the type safety.