Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   C Programming (http://www.velocityreviews.com/forums/f42-c-programming.html)
-   -   Re: Code Review requested: Postscript Interpreter (http://www.velocityreviews.com/forums/t740524-re-code-review-requested-postscript-interpreter.html)

Gene 12-20-2010 11:25 PM

Re: Code Review requested: Postscript Interpreter
 
On Monday, December 20, 2010 7:48:09 AM UTC-5, Bart wrote:
> But the 200-300 lines per source file rule sounds nonsense to me, if you
> have to know yourself where everything lives (Unix -- or is it Linux --
> source code is supposed to be 4Mloc, which would make it some 16,000 files
> according to that rule; a tad unmanageable.)


Yes, the 200-300 was common advice circa mid-80's when compilers were much slower and editors didn't have features (bookmarks, source navigation, etc.) to deal with longer files. These days 2,000-3,000 lines is perfectly fine and 20,000-30,000 occasionally if the code content has boilerplate similarity.

Ben Pfaff 12-21-2010 12:08 AM

Re: Code Review requested: Postscript Interpreter
 
Gene <gene.ressler@gmail.com> writes:

> Yes, the 200-300 was common advice circa mid-80's when
> compilers were much slower and editors didn't have features
> (bookmarks, source navigation, etc.) to deal with longer files.
> These days 2,000-3,000 lines is perfectly fine and
> 20,000-30,000 occasionally if the code content has boilerplate
> similarity.


I'd be really uncomfortable with 20,000-30,000 lines of
boilerplate, unless it was automatically generated and maintained
by modifying the generator, not by modifying the generated code.
--
A competent C programmer knows how to write C programs correctly,
a C expert knows enough to argue with Dan Pop, and a C expert
expert knows not to bother.

luser- -droog 12-21-2010 01:47 AM

Re: Code Review requested: Postscript Interpreter
 
On Dec 20, 6:08*pm, b...@cs.stanford.edu (Ben Pfaff) wrote:
> Gene <gene.ress...@gmail.com> writes:
> > Yes, the 200-300 was common advice circa mid-80's when
> > compilers were much slower and editors didn't have features
> > (bookmarks, source navigation, etc.) to deal with longer files.
> > These days 2,000-3,000 lines is perfectly fine and
> > 20,000-30,000 occasionally if the code content has boilerplate
> > similarity.

>
> I'd be really uncomfortable with 20,000-30,000 lines of
> boilerplate, unless it was automatically generated and maintained
> by modifying the generator, not by modifying the generated code.


I'm just using vim. It's probably got some crazy navigation tools
but I haven't explored them. I'm afraid of emacs.

And since my olpc xo-1 laptop has a quirk of deactivating the mouse
if you happen to be touching it during a recalibration, I'm afraid
of gui tools in general. Once the mouse is off, you have to reboot
to turn it back on.

So for my own purposes, I'm quite pleased with the small file
sizes. To me it suggests that the code is concise. Perhaps Strunk
and White isn't the best style guide for coding.

Ian Collins 12-21-2010 02:43 AM

Re: Code Review requested: Postscript Interpreter
 
On 12/21/10 02:47 PM, luser- -droog wrote:
> On Dec 20, 6:08 pm, b...@cs.stanford.edu (Ben Pfaff) wrote:
>> Gene<gene.ress...@gmail.com> writes:
>>> Yes, the 200-300 was common advice circa mid-80's when
>>> compilers were much slower and editors didn't have features
>>> (bookmarks, source navigation, etc.) to deal with longer files.
>>> These days 2,000-3,000 lines is perfectly fine and
>>> 20,000-30,000 occasionally if the code content has boilerplate
>>> similarity.

>>

<snip>
>
> So for my own purposes, I'm quite pleased with the small file
> sizes. To me it suggests that the code is concise. Perhaps Strunk
> and White isn't the best style guide for coding.


Small file sizes is good - it's easier to read multiple files side by
side than to be a several place in one file and if you ever use a
parallel or distributed build system, things go faster.

--
Ian Collins

Nick Keighley 12-30-2010 07:17 AM

Re: Code Review requested: Postscript Interpreter
 
On Dec 21, 12:08*am, b...@cs.stanford.edu (Ben Pfaff) wrote:
> Gene <gene.ress...@gmail.com> writes:
> > Yes, the 200-300 was common advice circa mid-80's when
> > compilers were much slower and editors didn't have features
> > (bookmarks, source navigation, etc.) to deal with longer files.
> > These days 2,000-3,000 lines is perfectly fine and
> > 20,000-30,000 occasionally if the code content has boilerplate
> > similarity.

>
> I'd be really uncomfortable with 20,000-30,000 lines of
> boilerplate, unless it was automatically generated and maintained
> by modifying the generator, not by modifying the generated code.


I have trouble imagining that much "boiler plate similarity". I'm
actually not even sure what it means...


All times are GMT. The time now is 11:12 PM.

Powered by vBulletin®. Copyright ©2000 - 2013, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57