Jump to content
Mike Torrettinni

Prefix unit local variable names

Recommended Posts

27 minutes ago, Mike Torrettinni said:

Now reading comments again it's good to know we all customize to some extent, to fit the purpose. As most of the time I'm the only one on the team, I can customize prefixes as I want to.

 

I think KebabCase ( kebab-case ) wins the naming war 😉

Please when you have some spry time, take a look at this : Parkinson’s Law of Triviality "bike-shedding"

  • Like 2

Share this post


Link to post
1 minute ago, Mahdi Safsafi said:

Please when you have some spry time, take a look at this : Parkinson’s Law of Triviality "bike-shedding"

Thank you!

 

Bikeshedding is a metaphor to illustrate the strange tendency we have to spend excessive time on trivial matters, often glossing over important ones.

 

I need to keep some of my own personal quirks even in coding... if that means my prefixes are trivial and waste of time... if that means I will never be Delphi expert... if that means I annoy someone on the internet... too bad, I like them! 😉

Share this post


Link to post
3 minutes ago, Mike Torrettinni said:

I need to keep some of my own personal quirks even in coding... if that means my prefixes are trivial and waste of time... if that means I will never be Delphi expert... if that means I annoy someone on the internet... too bad, I like them! 😉

No ! I'm sure you'll become a good developer and BTW I don't find your topics annoying. I just don't want you to spend your valuable time on something that doesn't really make difference. You said you're working alone ... so literally you can pick whatever naming you like. In other word, your topic is just a color and you know that there is no color better than other 🙂 

  • Like 1

Share this post


Link to post
1 hour ago, Mike Torrettinni said:

I think KebabCase ( kebab-case ) wins the naming war

SNAKE_CASE is good as well (moreover, it even has upppercase form - using a pretty big snake, maybe anaconda - and lowercase with some compact snake like viper). I wonder what "Snake kebab case" would look like 🙂

  • Haha 1

Share this post


Link to post
3 hours ago, Fr0sT.Brutal said:

T for types, I for Intfs, E for exceptions, F for fields, rarely A for arguments - when the name without prefix clashes with something but is too good to change. That's all. Other things seem to me just a useless visual noise requiring more time to type

I got used to use local variables, to decouple arguments to inject them into anonymous methods.

Thats why I try always to use A...argument  with according L...local

E.g.

procedure MyProc( const AArg : String );
var
    LArg : String;
    
begin
    LArg := AArg;  //<== I make a "copy" of the arguments, to inject them into async anon-procs

    CallAnonymousAsyncStuffHere(
        procedure
        begin
            use LArg;  //<== LArg is injected here, and always referable in the anon proc
        end );
end;

Since I do it like that, I have never encountered any issues with those anon-procs anymore,

and readability is very good (for me).

Thats why I try to use the same scheme now all the time, anon or not anon, as a valid pattern for me.

 

 

 

Edited by Rollo62
  • Like 1

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×