🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #75461

Re: Java needs "goto" (was Re: hi)

#75461
From: pete
Date: Sun, 11 Mar 2007 00:55
92 lines
4868 bytes
In article <eqfj2h$4o8$1@murdoch.hpl.hp.com>, Chris Dollin
<chris.dollin@hp.com> wrote:
>nukleus wrote:
>
>> In article <6uto94-3np.ln1@zoogz.gregorie.org>, Martin Gregorie
>> <martin@no.known.address> wrote:
>>>Lew wrote:
>>>> Gordon Beaton wrote:
>>>>> I'm with you on this. I find that readability is improved if
>>>>> declarations are collected at the start of the method, rather than
>>>>> interspersed with code statements.
>>
>> Plus, and don't forget about this,
>> otherwise you'll end up spending lifetimes
>> to fix your program in case there is error.
>>
>> If variables are declared at the top of the methods,
>> then all the error conditions and variable values
>> could be seen if you set a breakpoint in correct place
>> cause they won't go out of scope.
>
>If your methods are /so/ big
>that this presents a problem to you
>then I respectfully suggest
>that your methods are /too/ big;
>making them smaller

Agreed. But, in case of code I am dealing with,
it is easier said then done.
I did try get get rid of as much stuff,
as I could manage, but there are some more
subtle issues involved.
ANY class is guaranteed to be aware of the
main class and so it can ask from main just
about any information out there. But if your
move some code to their own classes, you simply
add at least one more level of idirection and
a number of get/put methods.

Sure, we can argue about it this way or that,
and if i wrote this code from scratch, i'd
probably use the entirely different approach
and use state machine an fully asynchronous
operation. Unfortunately, to rewrite the code
to do that is just about as good as scrapping
the whole thing and starting from scratch.
Too much work to be done and too lil time to do it.

>will simplify your [1] scope issue
>and allow you to give useful names
>(and a respectable meaning)
>to the segments you extract
>as well as
>making your names properly local.

Agreed.

>[1] I've had an issue with very-local-scoping
>    perhaps once in the past twenty years;
>    that was in C.
>
>    I spotted it
>    the next time I ran my ad-hoc tests
>    and fixed the issue in
>    about twenty seconds.
>
>    Of course anecdotes
>    are not data.

Yep, and I know EXACTLY what I am talking about.
Played with this scope thing in just about
any way imaginable. In some simpliest cases i do
use the most local scope possible, usually at the
point of initial prototyping. But then I look at the
code and try to move all declarations as high up
as I can manage because I know all too well, that
when I have some bug and a breakpoint hit or exception
triggered, about the last thing i want to see
is my variables getting out of scope.




- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
[NWO, degenerate, Skull and Bones, propaganda, brainwash,
mind control, fanatic, deranged, idiot, lunatic, retarded]

"I'm a patient man. And when I say I'm a patient man,
I mean I'm a patient man."

--- Adolph Bush
Technical Details
Message-ID: <CACE4E2E52721E52@209.123.15.56>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!i2pn2.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.20141118.mbox.gz!number1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!novia!newsfeed.gamma.ru!Gamma.RU!image.surnet.ru!news1.lucky.net!carrier.kiev.ua!news.te.net.ua!postnews.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!nx02.iad01.newshosting.com!newshosting.com!130.81.64.211.MISMATCH!cycny01.gnilink.net!spamkiller2.gnilink.net!gnilink.net!trndny04.POSTED!760c3fd9!canada.com!pete
References: <1170226439.643463.93880@j27g2000cwj.googlegroups.com> <1170245478.964647.118450@v45g2000cwv.googlegroups.com> <XLOdneZMhuRVDF3YnZ2dnUVZ_r2onZ2d@comcast.com> <op.tm3trwrjaynfek@laptop32.home.inter-corporate.com> <4ebe94-rrd.ln1@zoogz.gregorie.org> <YcednVZR_pOcdVjYnZ2dnUVZ_sfinZ2d@comcast.com> <g0lj94-jf7.ln1@zoogz.gregorie.org> <45c818de$0$24619$8404b019@news.wineasy.se> <hPWdnbmDpr0GmFTYnZ2dnUVZ_tijnZ2d@comcast.com> <6uto94-3np.ln1@zoogz.gregorie.org> <eqfi9g$1ohn$3@sage.ukr.net> <eqfj2h$4o8$1@murdoch.hpl.hp.com>

Show Full Headers
Complete Article Headers
Message-ID: <CACE4E2E52721E52@209.123.15.56>
Subject: Re: Java needs "goto" (was Re: hi)
Date: Sun, 11 Mar 2007 00:55:11 GMT
From: pete@canada.com
References: <1170226439.643463.93880@j27g2000cwj.googlegroups.com> <1170245478.964647.118450@v45g2000cwv.googlegroups.com> <XLOdneZMhuRVDF3YnZ2dnUVZ_r2onZ2d@comcast.com> <op.tm3trwrjaynfek@laptop32.home.inter-corporate.com> <4ebe94-rrd.ln1@zoogz.gregorie.org> <YcednVZR_pOcdVjYnZ2dnUVZ_sfinZ2d@comcast.com> <g0lj94-jf7.ln1@zoogz.gregorie.org> <45c818de$0$24619$8404b019@news.wineasy.se> <hPWdnbmDpr0GmFTYnZ2dnUVZ_tijnZ2d@comcast.com> <6uto94-3np.ln1@zoogz.gregorie.org> <eqfi9g$1ohn$3@sage.ukr.net> <eqfj2h$4o8$1@murdoch.hpl.hp.com>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!i2pn2.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.20141118.mbox.gz!number1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!novia!newsfeed.gamma.ru!Gamma.RU!image.surnet.ru!news1.lucky.net!carrier.kiev.ua!news.te.net.ua!postnews.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!nx02.iad01.newshosting.com!newshosting.com!130.81.64.211.MISMATCH!cycny01.gnilink.net!spamkiller2.gnilink.net!gnilink.net!trndny04.POSTED!760c3fd9!canada.com!pete
Newsgroups: news.groups, alt.slack, alt.config, news.software.nntp, alt.usenet.kooks
 alt.usenet.kooks
Organization: Bush's Ass Suckers
Lines: 92
NNTP-Posting-Host: d31-75.tenet.odessa.ua
X-Trace: toster.te.net.ua 1173596552 16000 195.138.75.31 (11 Mar 2007 07:02:32
 GMT)
X-Complaints-To: abuse@te.net.ua
NNTP-Posting-Date: Sun, 11 Mar 2007 07:02:32 +0000 (UTC)
X-Newsreader: Microsoft Outlook Express 4.72.3110.1