It's not a w, it's an omega. If you have a background in engineering like me, you are familiar with the Greek alphabet. Learning how to pronounce these letters while reading a book helps your studies: you don't have to wonder what this symbol is every time you encounter it, nor you have issues in explaining to other people what you mean (the angular velocity w... wait, what?).
Fortunately Greek letters aren't used in programming due to lack of ubiquitous Unicode support and difficulty of entering them with a standard keyboard. Yet when it comes the time to variable names, I find $pwd and $stdGrpType everywhere.
These names are difficult to read, understand and must be spelled out for discussion, leading to phrases such as pea double v dee and es tee dee gee ar pea type. Let's do a favor to the psychopatics who will end up maintaining our code and choose $password and $standardGroupType instead.
A journey in web development, [computer] science, engineering:
getting to know what lies under the hood -- Giorgio Sironi
Subscribe to:
Post Comments (Atom)
Featured post
A map metaphor for architectural diagrams
It is a (two-dimension) representation of a pipe. The map is not the territory , but in software engineering terms they are models of it....
Popular posts
-
Download now Practical Php Testing , my ebook on testing php applications, is finally here as promised, in the first days of December. Ho...
-
This is the errata page of the Practical Php Testing ebook, where typos and other errors will be listed and corrected. This page is linked ...
-
Mathematics is a part of a programmer's life. Other than the basic concepts implemented in programming languages, there are particular t...
3 comments:
The shorter - the better. I prefer variable names like $a, $x, $n. Everybody knows how to spell pwd, inet, id, stmt, db - I do not see any problem here. If it is not so clear - use comments :)
Well, $a or $x are pronounceable in my opinion. For $stmt, probably the standard usage has made it pronounceable without ambiguities; but when I see $dcmnt_grp_id...
Short variable names were a necessary practice in the prehistoric times of computing, when memory was costlier than gold. We are describing the world in our programs, so let's use words to make them more communicative. I have come to realize that a few people are able anyhow to follow an algorithm with $a etc., but that's a minority. And besides, comments are the root of all evil.
Post a Comment