Live data from Hacker News

Programs should be Small

mkhadikov.com

71–75 of 75 posts

Re: Programs should be Small

#71
post #17

Earlier quoted context omitted.

Wow, it seems rather arbitrary. Can you elaborate?

Yes, it's arbitrary and there are of course exceptions and perhaps domains where it may not apply at all. It's just a recurring observation that I've made (mostly but not only) in dynamic languages. Pretty much all good code that I've read or written was compartmentalized into units of roughly 500 LOC. A big program may be composed of many such units, but it was almost always a bad sign when a divisible part would ex…

So, you actually mean functions instead of programs?

Re: Programs should be Small

#72
post #71
post #17

Earlier quoted context omitted.

Yes, it's arbitrary and there are of course exceptions and perhaps domains where it may not apply at all. It's just a recurring observation that I've made (mostly but not only) in dynamic languages. Pretty much all good code that I've read or written was compartmentalized into units of roughly 500 LOC. A big program may be composed of many such units, but it was almost always a bad sign when a divisible part would ex…

So, you actually mean functions instead of programs?

No.

I mean an isolated unit that could be ripped out at any time and would be immediately useful on its own.

Anyway, abecedarius (below) has phrased it better than I could.

Re: Programs should be Small

#73
post #72
post #71

Earlier quoted context omitted.

So, you actually mean functions instead of programs?

No. I mean an isolated unit that could be ripped out at any time and would be immediately useful on its own. Anyway, abecedarius (below) has phrased it better than I could.

Those 'isolated units' are commonly called libraries then.

Re: Programs should be Small

#74
post #73
post #72

Earlier quoted context omitted.

No. I mean an isolated unit that could be ripped out at any time and would be immediately useful on its own. Anyway, abecedarius (below) has phrased it better than I could.

Those 'isolated units' are commonly called libraries then.

No. They are called "module".

Re: Programs should be Small

#75
post #74
post #73

Earlier quoted context omitted.

Those 'isolated units' are commonly called libraries then.

No. They are called "module".

Yes, I agree with that name, libraries usually start as modules and some extra work is required to convert a module to a library.

Also, a library can be thought of as a collection of modules.

Post reply on HN