Hacker News new | ask | show | jobs
by ithkuil 727 days ago
Perhaps I wasn't clear.

I also like the use of the file name "pre-extension" to categorize files.

There was a way to have the cake and eat it too which is: forbid _ inside the file name other than the extensions that have a well known meaning and treating the others as reserved.

1 comments

To be honest that seems worse. It feels overly restrictive and surprising. What sort of error do I get? Is the file ignored?

Sometimes perfect is the enemy of good.

Well, if the file got ignored that would be very surprising and a source of frustration indeed

A clear error message that explains that go source files cannot have underscores in them other than the supported suffixes (and a link to a page that documents them).

If you do that since the beginning then it's easy and painless.

The problem is: what do you do when you haven't thought of the consequences of one convention? Do you fix it later?

I'm happy with the current Go trade-off. This detail isn't worth fixing.

But it's nevertheless interesting to use as an excercise to see how it could have been done in a way that preserves all good properties and is also future proof