5 ms·
Why does the desktop client have one million lines of code?
by jsilence 8y ago
Why does the desktop client have one million lines of code?
- danpalmer 8y agoNot to be facetious, but why wouldn't it? It has to find and diff files, coordinate a very reliable file upload of many files, as fast as possible. It has to understand enough about the content of those files to be able to do useful things with them. It has to reliably update itself again and again, from possibly very old versions, it has to communicate with an ever changing API. It has to have enough analytics in it to support product development, error reporting, understanding how users use it, how the product needs to evolve over time. It needs to integrate deeply with all major OSes. ...I'm sure I've missed some things. 1 million lines of code sounds like the right ballpark to me though.
- sametmax 8y agoPlus the UI, the file manager intagration, the daemon, the authentification, the cache... All that cross platform.
- saagarjha 8y agoNone of those should be written in Python, except for perhaps the cache handling code. The rest should be platform-specific.
- rmdashrfstar 8y agoWhy?
- saagarjha 8y agoBecause they're platform specific. For example, on macOS, the UI and file manager integration should be done in Swift or Objective-C(++), the authentication in some C-compatible language to match the security frameworks, and the daemon in some language that isn't single threaded or garbage collected.
- chrisseaton 8y agoYou’re talking about that it uses platform specific APIs. You can use these APIs from Python, and then there is all the logic which decides how to use the APIs and that can be in Python as well.
- saagarjha 8y ago> You can use these APIs from Python You can do it hand-written assembly too, but usually it's more trouble than it's worth.
- chrisseaton 8y agoI think what we've worked out what you mean is just that if you were doing it you'd chose to do it in Objective C etc. That's not quite the same as anyone else 'should' do it.
- sametmax 8y agoNot only you can do all that confortably and productively in python, but you should. It's crossplatform, the task has not bottleneck for this vm, and it takes complexity down to one language. One language that as the very specific characteristic of being the best at nothing, but pretty good at everything, which in such an heterogenous software is what you want.
- saagarjha 8y ago> the task has not bottleneck for this vm Which is why Dropbox uses 100% of the CPU while syncing? It's pretty clear that trying to handle thousands of files is not a trivial operation. Sure, Python can do the job, but something native will probably do the job faster. > in such an heterogenous software is what you want No, not really. I'd rather the software work well, and I'd rate Dropbox as "passable" rather than "great".
- sametmax 8y ago
- deleted 8y ago[deleted]
- barkingcat 8y agoPython is platform specific.
- saagarjha 8y ago…no?
- chrisseaton 8y agoYou can write platform specific code in Python. You can get the current operating system and you can write an if statement comparing against operating systems you want to write specific code for.
- saagarjha 8y ago> You can write platform specific code in Python. It's clearly not designed for doing anything advanced, though: it's not like you can get access to platform-specific APIs outside of the basics without doing a lot of work.
- DrJosiah 8y agoctypes is a thing, and gives you access to the world of runtime-loadable libraries on your platform. Beyond that, C modules for Python by hand, SWIG, Cython (can take Python 3.x annotations now), etc., are not bad at all. Can you explain how platform-specific stuff takes "a lot of work" with Python, and wouldn't with some other language that is not Python?
- saagarjha 8y ago> Can you explain how platform-specific stuff takes "a lot of work" with Python, and wouldn't with some other language that is not Python? Sure, just look at a modern Cocoa app written in Swift, or Android one in Java, and compare it to the amount of work you'd have to do to shoehorn Python in there.
- bdcravens 8y agoI wonder if their code is over 1M, or if they're doing what you see in a lot of marketing, which is count all the lines from included packages.
- rhizome 8y agoWho markets on the basis of LOC?
- chillydawg 8y agoDropbox, right now. These blogs are always with an eye to recruitment.
- chrisseaton 8y agoWhy would a massive legacy codebase be a recruitment turn-on?
- pmoriarty 8y agoBecause then you can put on your resume that you have experience working on a massive codebase.
- deleted 8y ago[deleted]
- barkingcat 8y agomillion lines isn't really that much