Hacker News new | ask | show | jobs
by unimpressive 4939 days ago
I was talking to someone today, and they commented:

"Good programmers eventually learn to misspell words like void or int so that they can name their variable names what they want to name them."

I of course told him that this was terrible advice, and would mess with the next person who had to maintain the code because you couldn't tell at a glance if a word was a keyword or a keyword mispelled. I asked him what language he was using.

FORTRAN.

Where did he work.

The United States Air Force.

For how long?

Six years.

When?

Before 2000.

Since he had more experience, he claimed I was de facto wrong.

I fought him on it some more.

He told me it was personal preference. I told him you'd have to make me do it.

It was at that moment I figured that someone, somewhere, had probably had to do this as part of a coding guideline.

1 comments

klass for a variable of type Class is totally normal in Java.
Isn't it usually clazz?

But such things are quite annoying for automatic code generators, though, as they have to make sure that they won't ever emit an identifier that clashes with a keyword. The ability to just prepend @ in C# is quite helpful in that regard.

Same for GTK+ C code (where it is used as a gesture toward C++ compatibility, at least for the headers).