The world of acronyms
-
Recently a developer in the team decided to prefix all classes in a namespace with a four alphabet acronym (let's call it DSRS, it's pretty close to what it is). I cannot elaborate how many brain cells have gone dead in me in comprehending the code and telling him to remove that prefix or use something more useful. His answer: people will get used to it and so will new devs... Speechless....
Ashish Kaila
-
Recently a developer in the team decided to prefix all classes in a namespace with a four alphabet acronym (let's call it DSRS, it's pretty close to what it is). I cannot elaborate how many brain cells have gone dead in me in comprehending the code and telling him to remove that prefix or use something more useful. His answer: people will get used to it and so will new devs... Speechless....
Ashish Kaila
Being an old-timer, I have made a practice of prefixing a variable name with its type. For example, an integer for tracking the number of actions taken might be named
intActions
and a money variable (logical subclass of decimal) might bemnyCashIn
. Even now, with much smarter compilers, I still do it. This makes my code consistent, whether old or new, compiled or script. It also simplifies porting between weakly typed languages and strongly typed languages. -
There was a guy at my last job who did that. And every one of my coworkers insisted I mark each change I made to a stored procedure with a comment containing my name so they know who made the change (so they could go to that programmer and ask him/her about it). They thought that was a better idea than version control. Even though the code was littered with names of old programmers who no longer worked there.
-
Being an old-timer, I have made a practice of prefixing a variable name with its type. For example, an integer for tracking the number of actions taken might be named
intActions
and a money variable (logical subclass of decimal) might bemnyCashIn
. Even now, with much smarter compilers, I still do it. This makes my code consistent, whether old or new, compiled or script. It also simplifies porting between weakly typed languages and strongly typed languages.It's called Hungarian Notation[^].
- S 50 cups of coffee and you know it's on! Code, follow, or get out of the way.
-
Being an old-timer, I have made a practice of prefixing a variable name with its type. For example, an integer for tracking the number of actions taken might be named
intActions
and a money variable (logical subclass of decimal) might bemnyCashIn
. Even now, with much smarter compilers, I still do it. This makes my code consistent, whether old or new, compiled or script. It also simplifies porting between weakly typed languages and strongly typed languages.Hey Bob, I think it depends on the platform being used. If I am using a not so type safe platform where at coding time type cannot be inferred, then a prefix for denoting object type is perfectly valid. I am not so sure about type safe languages such as C#. Also the problem I described was prefixing of classes which again should be avoided in my opinion regardless of platform. Anyhow happy friday and happy coding ! Ashish
Ashish Kaila
-
Haha... Never thought like that :). But true ! I can write a script and have it do it for me ! In the end, the prefix will only apply to my script: ABCDPrefixRemover.bat :)
Ashish Kaila
-
Recently a developer in the team decided to prefix all classes in a namespace with a four alphabet acronym (let's call it DSRS, it's pretty close to what it is). I cannot elaborate how many brain cells have gone dead in me in comprehending the code and telling him to remove that prefix or use something more useful. His answer: people will get used to it and so will new devs... Speechless....
Ashish Kaila
WTF?
while (e) { Coyote(); }
-
Recently a developer in the team decided to prefix all classes in a namespace with a four alphabet acronym (let's call it DSRS, it's pretty close to what it is). I cannot elaborate how many brain cells have gone dead in me in comprehending the code and telling him to remove that prefix or use something more useful. His answer: people will get used to it and so will new devs... Speechless....
Ashish Kaila
"I hate TLAs." You may quote me.
-
It's called Hungarian Notation[^].
- S 50 cups of coffee and you know it's on! Code, follow, or get out of the way.
.. and it was highly recommended for use in VB6.
-
A very similar thing was done to the main database at my last job. Only took me 1-2 years to "get used to" it. :doh: Though, to be honest, it was actually somewhat useful in the way they did the naming. When they casually used the prefixes in conversation and expected you to know what it meant was when it got confusing.
Draw a red circle whit a slash through it (the classic 'No' symbol), and put TLA in the middle. Karl