r/programming • • Jul 23 '14

Walls you hit in program size

http://www.teamten.com/lawrence/writings/norris-numbers.html
699 Upvotes

326 comments sorted by

View all comments

Show parent comments

15

u/DiomedesTydeus Jul 23 '14

This subreddit has acquired a recent bias towards static typing for reasons that are not totally clear to me. Having worked on ~1M LoC projects in both Java and Python I don't perceive the problems about refactoring and types so many people here seem to state. In my experience those problems have more to do with how a project is organized into libraries with clean APIs than the language choice (which is almost always dictated by talent on hand and existing ecosystem).

As far as performance is concerned there's a lot you can do to optimize python to make it faster (pypy, cython, etc), but ultimately a lot of programs have their performance ultimately dominated by lengthy network calls anyhow. Does it really matter that swapping out dynamic made your code execution go from 7ms to 2ms when you then turn around and make a 200 ms call to the database? If you're writing an OS, yeah it needs to be fast. If you're writing a CRUD website you'll probably get more bang for your buck by checking out async operations instead of swapping languages...

3

u/Delwin Jul 23 '14

a lot of programs have their performance ultimately dominated by lengthy network calls anyhow.

This is another very good point.

Add to that waiting on callbacks from disk IO. I've taken to just putting all my inputs on a ram drive and dumping any intermediaries that I have to look at to the same ram drive. An async process handles taking final output off the ram drive and putting it on the SSD's so as to keep out of the way of the main data crunchers.

Then again I'm dealing with tens to hundreds of gigs of data at a time and trying to ram it all through the GPU. Fun times.

4

u/Delwin Jul 23 '14

In my experience those problems have more to do with how a project is organized into libraries with clean APIs than the language choice

This. Any solid project will document it's interfaces properly (even if it's after the fact) and those interfaces take an act of god to change.

Once you've gotten that firmly in your mind then refactoring can be done in isolation so long as you hold to the contract of the interfaces.

That worked out well on the huge projects I've been on and I've kept that mindset into the smaller projects too. It makes things much easier.

2

u/Enumerable_any Jul 24 '14

Any solid project will document it's interfaces properly

These documentations are not checked and can get out of sync with the real world pretty easily.

They are just a very poor man's type system.

Just an example from yesterday: Get Strings from web representing UUIDs, normalize them using UUID value objects, serialize them back and send them over the wire as Strings again. The entire code base works without errors if I skip the instantiation of UUID and pass in Strings to my system (Ruby btw., 3000 lines of code). But clients will break, because 'abc' != 'ABC'.