[Tutor] Re: Request for code critique ['break' vs control flag]

Alan Gauld alan.gauld at blueyonder.co.uk
Thu Oct 23 01:00:22 EDT 2003


> > whence into many other languages) which breaks the rules of
structured
> > programming and by so doing makes code more difficult to read
reliably.

> But I've also met a lot of respected programmers who insist on the
"one
> entry point, and one exit point" viewpoint. 'break' drives them
crazy.
>
> So, like many style guidelines, it's a controversial issue. *grin*

I think the issue is that this is NOT a style thing. It's
one of the basic tenets of structured programming and based
on actual hard data. Having multiple exit points makes code
harder to comprehend and hence more prone to error.

Sometimes people forget the reasons behind some of these
early discoveries in Computer Science. In fact I just finished
reviewing a book by Robert Glass: "Facts and Fallacies of
Software Engineering" which is based entirely on the concept
that the faddy world of SE regularly forgets (and subsequently
rediscovers) some of the basic truths of our trade...

It falls into the same category as indentation style for
begin/end or {} block markers. People treat it as a personal
choice but hard evidence exists which shows that some styles
are significantly more comprehensible than others.

Alan G.




More information about the Tutor mailing list