Profile

Cover photo
Akhyar Amarullah
Works at Onebitmedia
36,305 views
AboutPostsCollections

Stream

Akhyar Amarullah

Shared publicly  - 
 
 
A lesson in shortcuts.

Long ago, as the design of the Unix file system was being worked out, the entries . and .. appeared, to make navigation easier. I'm not sure but I believe .. went in during the Version 2 rewrite, when the file system became hierarchical (it had a very different structure early on).  When one typed ls, however, these files appeared, so either Ken or Dennis added a simple test to the program. It was in assembler then, but the code in question was equivalent to something like this:
   if (name[0] == '.') continue;
This statement was a little shorter than what it should have been, which is
   if (strcmp(name, ".") == 0 || strcmp(name, "..") == 0) continue;
but hey, it was easy.

Two things resulted.

First, a bad precedent was set. A lot of other lazy programmers introduced bugs by making the same simplification. Actual files beginning with periods are often skipped when they should be counted.

Second, and much worse, the idea of a "hidden" or "dot" file was created. As a consequence, more lazy programmers started dropping files into everyone's home directory. I don't have all that much stuff installed on the machine I'm using to type this, but my home directory has about a hundred dot files and I don't even know what most of them are or whether they're still needed. Every file name evaluation that goes through my home directory is slowed down by this accumulated sludge.

I'm pretty sure the concept of a hidden file was an unintended consequence. It was certainly a mistake.

How many bugs and wasted CPU cycles and instances of human frustration (not to mention bad design) have resulted from that one small shortcut about  40 years ago?

Keep that in mind next time you want to cut a corner in your code.

(For those who object that dot files serve a purpose, I don't dispute that but counter that it's the files that serve the purpose, not the convention for their names. They could just as easily be in $HOME/cfg or $HOME/lib, which is what we did in Plan 9, which had no dot files. Lessons can be learned.)
110 comments on original post
1

Akhyar Amarullah

commented on a video on YouTube.
Shared publicly  - 
 
Love the spirit. Everyone is really enjoying themselves while singing this cheerful good-bye song :')
 ·  Translate
3

Akhyar Amarullah

General Discussion  - 
 
Can't I skip the "Setup Wizard - Downloading Components" screen after upgrading to Android Studio RC? It seems to force me to download the SDK (approx 2GB) even tough I already has one in my path.

I am not in a good internet connection and just need to jump straight to code immediately, but this wizard screen is blocking me to get in :(
2
Akhyar Amarullah's profile photo
2 comments
 
The point is that I can't code while upgrading the SDK components. I already have them,  probably just one or two versions older.
Add a comment...

Akhyar Amarullah

commented on a video on YouTube.
Shared publicly  - 
 
Speechless.... >.<
 ·  Translate
1

Akhyar Amarullah

Shared publicly  - 
 
Pretty simple
2
1
donivan setya's profile photo

Akhyar Amarullah

Shared publicly  - 
1

Akhyar Amarullah

Shared publicly  - 
 
Yohan Totting originally shared to Data:
 
Data mining algorithms
Today, I’m going to explain in plain English the top 10 most influential data mining algorithms as voted on by 3 separate panels in this 2007 survey paper.
View original post
1

Akhyar Amarullah

commented on a video on YouTube.
Shared publicly  - 
 
Dimas Aksara ternyata pernah jadi RX :o #bimaX

cc +aulia rakhman
 ·  Translate
5

Akhyar Amarullah

Shared publicly  - 
 
Tried #elementaryOS Luna for a week, unfortunately it's not for me. Found myself switching back to #archlinux
1
1
donivan setya's profile photo

Akhyar Amarullah

Shared publicly  - 
 
Asha 501, FirefoxOS, Ubuntu Touch
1

Akhyar Amarullah

Shared publicly  - 
 
Cool!! But but but, why Kiba Ranger :|
2

Akhyar Amarullah

Shared publicly  - 
1
Akhyar's Collections
Work
Employment
  • Onebitmedia
    Lead Engineer, 2013 - present
    I lead engineering stuffs, sometimes get my hands dirty on some Android development code.
Contact Information
Work
Email
Skype
rulakhy
Story
Tagline
Software Engineer
Introduction
Hello world!
Basic Information
Looking for
Networking
Links