In Windows, you're not allowed to name a file "CON". Why? Because of namespace pollution. There are 25 reserved names that show up in the context of file names, but that aren't really file names because they're special.
This writes "hello" into a file called "conn":
echo hello >connThis doesn't create a file at all. I have no idea what it does:
echo hello >conThe only difference is that "con" (case insensitive) is a special name. I'm calling this namespace pollution because there are a set of names (file names) and a set of names (reserved names) that are mixed together.
In Git it's a lot clearer what I mean by namespace pollution.
git checkout thingWhat does this do? Can't tell. It might revert a file called "thing" to it's state at the last commit. It might switch the entire working directory to another branch called "thing". Which of these happens depends on whether there's a file called "thing" or a branch called "thing". If both exist, I'm sure one of them happens, but I don't know which without doing an experiment or reading through documentation. I'm not going to do that. Why can't there be different syntax for the two? Like
git switchtobranch thingand
git revertfile thingI'm going to say it. SVN's syntax is much more understandable.
No comments:
Post a Comment