Re: Code readability suggestions

new topic     » goto parent     » topic index » view thread      » older message » newer message

Pete Lomax wrote:
> 
> If you found you'd written this, what would you change it to?
> To be honest, I am not all that sure it looked much better before loss
> of syntax colouring and linewrap kicked in...
> }}}
<eucode>
>     if id = MF_sm
>      or (msg = WM_CHAR and wParam=15) then
> -- Ctrl O (Site Manager)
>         SiteManager()
>     elsif id = MFexit then
>         closeWindow(Main)
>     elsif id = MV_rfl
>      or (msg = WM_CHAR and wParam = 12 and rlOK)
> -- Ctrl L (Refresh Local)
>      or (id = M_Crfr and msg = WM_COMMAND and M_Context = LOCAL) then
>         loadDir(0,lpath,0)
>     elsif id = MV_rfr
>      or (msg = WM_CHAR and wParam = 18 and rrOK)
> -- Ctrl R (Refresh Remote)
>      or (id = M_Crfr and msg = WM_COMMAND and M_Context = REMOTE) then
>         loadDir(1,rpath,"")
>     elsif (id = M_Cdel and msg=WM_COMMAND)
> -- Delete
>      or (msg = WM_KEYDOWN and wParam = VK_DELETE and
>          (id = LVL or id = LVR)) then
>         confirmdelete(id)   -- just opens a window
>     elsif (id = CDOK and msg = WM_COMMAND) then
>         delete()
>     elsif (id = CDcncl and msg = WM_COMMAND)
>       or (msg = WM_CHAR and wParam = VK_ESCAPE and
>           (id = CD or id = CDOK or id = CDcncl)) then
>         closeWindow(CD)
>     elsif (id = M_Crn and msg=WM_COMMAND)
> -- Rename (F2)
>      or (msg = WM_KEYDOWN and wParam = VK_F2 and
>          (id = LVL or id = LVR)) then
>         openRN(id,1)    -- just opens a window
>     elsif (id = RNOK and msg = WM_COMMAND)
>        or (msg = WM_CHAR and wParam = VK_RETURN and id = RNas) then
>         rencd()
>     elsif (id = RNcncl and msg = WM_COMMAND)
>       or (msg = WM_CHAR and wParam = VK_ESCAPE and
>           (id = RN or id = RNas or id=RNOK or id = RNcncl)) then
>         closeWindow(RN)
> </eucode>
{{{

> 
> Admittedly, loads of extra whitespace (which I usually treat as the
> poor man's answer) does help quite a bit here, anything else?
> 
> Regards,
> Pete
> 
> 
Hi
Whoawhatdoyoumeanwhitespacesarethepoormansanswer.InmyminditjustaddstotheEnglishlikereadabiltyofthecode.
Itmakesmoresencetoputaspacebetweenanythingandan=thenjustthe=.
Thatlooksveryreadabletome.

Chris

http://euallegro.wikispaces.com
http://members.aol.com/chriscrylex/euphoria.htm
http://uboard.proboards32.com/
http://members.aol.com/chriscrylex/EUSQLite/eusql.html

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu