Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: Style geekcode

by demerphq (Chancellor)
on Mar 25, 2002 at 14:21 UTC ( #154096=note: print w/ replies, xml ) Need Help??


in reply to Style geekcode

Nice!

Before I give mine I had a couple of minor issues.. (heh you knew that was coming didnt you?)

  • For the indenting im using It(=4c<!>) to mean that I use tabs, but have them set to be displayed as four spaces and that my editor automatically converts leading spaces to such tabs and it automatically truncates trailing spaces. Sorry if I didnt follow the code, hopefully you havent finished your parser for this yet ;-)
  • For parens im using -0.5 because I use the minimum number of parens that keeps my codes meaning clear, but I dont try to explicitly avoid them.
  • For references I used R1.5 because I often call vars "array_ref" or the like, but I dont put "ref" in anything like all variables references.
  • Im using d0 for the dummy name question, assuming that "a" and "b" also includes safer var names like "i","j","x","y"
  • I added the keyword "tidy" to your end block, because I rotuinely run my code through perltidy.
It(=4c<!>)Os1;0S,>.+**<=><&&><and><gt>++<==>B1L1 C2P-0.5N>eR2Vc1a1p(s0h0a0)r1.5d0Hsw1sub-main-tidy
Update:
more compliant with the updated spec. I stand by the tidy bit though.
It=4! Os1 ;0 S,>.+**<=><&&><and><gt>++<==> B1 L1 C2 P-.5 N>e R2 Vl(en)c1a1p(s0h0a0)r1d.5 Hsw1 sub-main-tidy

BTW, two thoughts regarding perltidy, the first is that you might have a look there for even more options for a later version of the perl geek style code, and on the other hand wouldnt it be cool if you could feed this style blcok into perltidy and have it behave accordingly? Now theres a nifty little hack that you could do that would put your style code a touch above some of the other codes (at least in terms of practicality.)

Cheers Juerd, good post!

Yves / DeMerphq
---
Writing a good benchmark isnt as easy as it might look.


Comment on Re: Style geekcode
Select or Download Code
Re: Re: Style geekcode
by knobunc (Pilgrim) on Mar 25, 2002 at 15:21 UTC
Re: Re: Style geekcode
by Juerd (Abbot) on Mar 25, 2002 at 15:22 UTC

    (heh you knew that was coming didnt you?)

    I was afraid of that, yes :)

    * For the indenting im using It(=4c<!>) to mean that I use tabs, but have them set to be displayed as four spaces and that my editor automatically converts leading spaces to such tabs and it automatically truncates trailing spaces.

    I'll use just It=4!, meaning: "Indenting by tabs, but they are displayed as 4 columns of nothingness. I have my editor force (exclamation mark was stolen from vim) existing code to follow my style (convert spaces to tabs, in this case)". :)

    # Sorry if I didnt follow the code, hopefully you havent finished your parser for this yet ;-)

    I don't like parsing/parsed geek codes, so I will leave that up to someone else.

    # For parens im using -0.5 because I use the minimum number of parens that keeps my codes meaning clear, but I dont try to explicitly avoid them. # For references I used R1.5 because I often call vars "array_ref" or the like, but I dont put "ref" in anything like all variables references.

    Unlike with ++++ and ---, you can have floating point numbers. I like that idea. Will add :)

    * I added the keyword "tidy" to your end block, because I rotuinely run my code through perltidy.

    The end stuff was only to indicate order in a file, not programming order.

    It(=4c<!>)Os1;0S,>.+**<=><&&<and><gt>++<==>B1L1 C2P-0.5N>eR2Vc1a1p(s0h0a0)r1.5d0Hsw1sub-main-tidy

    Hmm, I really meant that whitespace to be in between items. But even that is a matter of style ;) Maybe sub-main is going to screw some parsers, but seeing your code, I'm glad I picked uppercased letters just before hitting submit :)

    and on the other hand wouldnt it be cool if you could feed this style blcok into perltidy and have it behave accordingly?

    That's just SICK, but a nice idea :)

    Cheers jured, good post!

    Thanks, but please s/jured/Juerd/ ;)

    U28geW91IGNhbiBhbGwgcm90MTMgY
    W5kIHBhY2soKS4gQnV0IGRvIHlvdS
    ByZWNvZ25pc2UgQmFzZTY0IHdoZW4
    geW91IHNlZSBpdD8gIC0tIEp1ZXJk
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://154096]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (7)
As of 2014-10-01 09:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (391 votes), past polls