5 ms·
10. Requests that begin with, "All you have to do is...". 9. Deadlines fabricated by others. 8. Single character variable names. 7. Being spoonfed require
by edw519 17y ago
10. Requests that begin with, "All you have to do is...".
9. Deadlines fabricated by others.
8. Single character variable names.
7. Being spoonfed requirements on a need-to-know basis.
6. SQL Selects within iterations.
5. Requests that describe how, but not what.
4. Variable names that don't describe what they are.
3. Meetings without beer.
2. Dropping everything for the emergency du jour.
1. Top 10 Lists that infer that all programmers think alike.
- anatoly 17y agoSurely there's nothing wrong with single-character variable names, used appropriately.
- aasarava 17y agoWhat's an example of an appropriate single-char variable name, in your opinion?
- damovisa 17y agopersonally, I find this more than ok: for (int i=0; i<items.length; i++) { //do something small with items[i] }
- cema 17y agoCorrect! However, I should confess that I usually write it as ii: for (int ii = 0; ii < items.length; ii++) ...
- jrockway 17y agoWhy?
- MaMa 17y agoThen it's not a single character variable name anymore
- Silhouette 17y agoIt gives you something you can quickly search for: hit <incremental search keyboard shortcut> followed by "i" twice and you're there. Do the same with a single-character name, and you hit any time that character appears anywhere. I personally find the doubling awkward, and with modern editors I use semantic searching much more than raw text scans so the benefit of doubling is marginal, but there is at least one sensible reason you might choose to do it.
- jrockway 17y agoOr you could just search for "i =" or "int i" or "for"?
- Silhouette 17y agoSure you could, but while you're busy trying to find the exact combination of spacing and punctuation that starts the loop you want, and then manually looking through the loop to find every further reference to the same variable, the guy who called it "ii" and found it with the first four keystrokes is already being productive. As I said before, it's probably not as useful with modern IDEs that have semantic search capabilities, but there is a genuine reason some people prefer the "ii" style.
- jasonkester 17y agoi
- deleted 17y ago[deleted]
- roundsquare 17y agoIf you are working in finance, you might use common single letter variables, for example if you are creating a black-scholes function. E.g. r = interest rate, etc...
- wglb 17y agoBetter to use 'rate' or 'irate'.
- jrockway 17y agox, as in "f x = x + 2". What else are you going to call it? "addend"?
- Xichekolas 17y agof = (+ 2) (I'm not a huge fan of point-free, I'm just being facetious ;)
- anatoly 17y agoi,j, sometimes n. When working with coordinates - x, y, z.
- harshpotatoes 17y agoYou get meetings with beer? What is this? Madison Ave where everybody has a bottle of scotch in their drawer?
- roundsquare 17y agoSurely not, but its still annoying.
- rpledge 17y agoMeetings with beer work well as a time limiter if you don't let people leave to use the washroom. The lenght of the meeting becomes bounded by the participants bladder size.
- binarymax 17y ago0. Non zero-based indexes.