Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

You will mentally read "token" every time you see "tk" anyway.

The same way you "grep", "ls" or "cd" --- it easily becomes as natural as any other language, unless you consciously try to stop yourself from learning.



No, you won't. You'll read "tk", and then do a little mental substitution to "token". It's tiny, but it adds to your mental load.

You could just not do that, and be happier. Why add the extra indirection?


I do agree that `tk` is an unusual abbreviation, but `tok` for `token` is pretty common in language implementations. `ty` for `type` is also usual.

The names are not only read but also being manipulated in your mind. You will see tons of `token`s and `type`s throughout the code and while you can read them fine you will have hard time dealing with them in your mind. For uncommon names that are usually read out of the context, longer names are preferred. For common names or local enough names, short mnemonics that evoke the original name really help. When it is not possible, people usually develop a specialized terminology for them.


I don't have any problem holding properly named variables in my mind, so I don't see what the problem is here?

The only issue is that if you are writing gigantic statements with lots of variables, it gets too long to see properly. And that is a sign that you are writing too large expressions, and need to start cutting them into smaller parts anyway.


You don't always replace X and Y (as in coordinates) to something longer. I know, they can be (and probably should be) replaced with left/right and top/bottom when we are talking about boxes, but not all X and Y can be replaced.


You replace them with abscissa and ordinate actually. And Z will be applicate, it seems, although I already heard azimuth used for this one. I'm not aware of a dedicated terms for higher dimensions, so your beautiful (w,x,y,z) quaternion tuple is a big deal, isn't it.

Anyway, you can always use an array `coordinates` with whatever dimensions you want.


Sure, but those are commonly used names and well established, so they act as actual, proper words in this kind of discussion. There are some widely accepted short names that can still be descriptive.

But arbitrary abbreviations like "tk" don't fall into this category.


You need some basic understanding of 2D graphics to understand what is X and Y. In fact, they are not good names otherwise because it is pretty easy to mix them up---one more reason to prefer left/right/top/bottom whenever possible. I've seen some codes using Column and Row instead of X and Y for that very reason. (Not to say that I like it.)

If you are okay with X and Y, you should probably have to accept that the definition of "commonly used", "well established" and "actual, proper" words is subjective and different areas and projects have different notions of them. I'm okay with `tk` if it is used consistently and doesn't interfere otherwise.


Yes they do. tk, pc, sp, a, etc all fall into the well established category in this context.


The first time you'll read "HN", and then do a little mental substitution to "Hacker News".

Why do humans abbreviate?


Unfortunately, it seems that most of the time it's because they are lazy sheeps who don't even have a clue of what means 90% of the abbreviations they use, but don't want to look like the sole ignorant in the room asking it, and won't take time to look at it by themselves later, even for the 10% they most often encounter.


Bad example. ls and friends are meant to be typed constantly and therefore need to be short.


I read "grep", "ls" and "cd" as "grep", "el ess" and "cee dee". I don't even know what grep and ls stand for.


ls is a shortening of "list", i.e. list directory contents, and grep is apparently Global Regular Expression Print.


grep comes from an amalgamation of commands for a global search applying a regular expression and printing the results I.e., “g/re/p”

ls just simply stands for list


No, we won't; "token" is a function name, not a local variable name. If it was written "token", we'd have to substitute it back to "tok" every time we read it.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: