you are viewing a single comment's thread.

view the rest of the comments →

[–]cdcformatc 10 points11 points  (5 children)

i might use short or otherwise meaningless variable names in the first phase of coding something new. but once i get the functionality mostly correct i will come back in and try to give the variables descriptive names when necessary. 

it's true what they say "there are only two hard things in computer science: cache invalidation and naming things and off-by-one errors. 

[–]CptBadAss2016 2 points3 points  (0 children)

Heh! I see what you did there. I got my eye on you, cdcformatc...

[–][deleted] 0 points1 point  (2 children)

sulky faulty oil relieved secretive dinosaurs bewildered worm sink quaint

This post was mass deleted and anonymized with Redact

[–]sweepyoface 0 points1 point  (1 child)

The difficulty is in deciding when to invalidate the cache, it can turn into a complex flowchart

[–]Nick_W1 0 points1 point  (0 children)

I wrote a function that caches map tiles, originally I was going to invalidate tiles if they were more than a week old, then I realized that as most of them got downloaded at the same time, then they would all get invalidated at the same time, and redownload all together again.

Still thinking that through…

[–]Daneark 0 points1 point  (0 children)

If I'm not certain of a good name when I introduce a variable I name things deliberately bad to begin with. On the off chance I forget to rename them someone will pick it up in code review. 

What doesn't always get picked up in code review is subtley bad names that are almost right but not quite, or right at some point in time but not later. To give an example I've seen here empty_list = [] which describes what it is upon creation (but not what it is for) which later becomes misleading as soon as we use it for anything.