The Lounge is rated PG. If you're about to post something you wouldn't want your
kid sister to read then don't post it. No flame wars, no abusive conduct, no programming
questions and please don't post ads.
As long as it's meaningful, I always prefer a long name for methods, variables, properties... whatever you say. 'GetPersonName()' is preferable than 'GetPN()' or 'GetP()' etc. The most important thing is, you don't have to write self-documentation and the person on the other side still understand what the code works. Just my thoughts...
Vote up or Mark as Answered, if this information helped you. Kind Regards - Kunal Chowdhury | Microsoft MVP (Windows Development), Windows 10 ChampionCheckout my 'Technical blog':http://www.kunal-chowdhury.com
A few years ago, the group set down in our company to revise the coding rules tried to set a maximum source code line lenght of 80 chars. Our project leader immediately declared that our code was not to accept that limit: We had rules for creating C #define symbols that lead to symbols exceeding 80 chars (and every character in UPPERCASE). Actuall, we had several guys praising those rules (the same ones who were complaining about the 260 char file name length in FAT file systems).
Going even further back in time: I was working for a company selling their own Fortran compiler. One customer hit one ceiling: A function could have at most 99 parameters; he had more than that.
Another crazy hit-the-ceiling: A friend of mine had to extend a linker: Each module had an export table that was indexed by a signed 16-bit integer. One customer's project created a module which exported more than 32767 symbols. The quick fix was to double the maximum table size by making the index unsigned. The same project created a struct type definition of roughly 8300 lines of code. (That didn't break any limits, though.)
If noone breaks a limit, that limit serves no real purpose...
Kind of related - many years ago we had someone join our team who was a one finger typist - literally. Used the caps lock key rather than hold down shift whenever he could, that sort of thing.
When we cottoned on to this, method names in our libraries started to "evolve" under the guise of better clarity, so fg() became setDefaultForegroundTextColour() and cp() became setVirtualTextCursorPosition() and so on.
this was before the days of intellisense and auto-completion, of course.
Why do they ask us to tick a box, or type in a couple of words - both jobs that a computer can do pretty easily?
To prove we aren't robots, what we should have to do is harm a human being, or through inaction allow a human being to come to harm.
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!