Here I want to talk about what a team should do when they start a new project. I’ve had the privilege to architect a large project and to come into several existing projects that have a fair amount of girth. These just a few thoughts about things that need to be established sooner rather than later.
This is good for new comers to the project, getting their head around jargon. Create a place, or even in the README of every repo.
There are 2 hard problems in computer science: cache invalidation, naming things, and off-by-1 errors.
- - many people on the internet
Yeah, naming things. Seems easy, but a bad name can be confusing, or worse yet, having two or more names for a single idea. I project I was on had this, for example, to reference a “Movie” (e.g. Star Wars), the words title, feature, movie, program, could all mean a Movie. (╯°□°）╯︵ ┻━┻
Once I was troubleshooting an issue that worked fine locally, but would totally fail on the server. It was a filename case issue. On the Mac,
MyFile.js, worked fine, but on linux it failed, because the code was looking for
myfile.js. Do youself a favor with files. Follow these simple rules
- lower case
- use hyphens (also known as kebab-case)
- letters and numbers
- No spaces what-so-ever
// BAD MyFiles.js This Really Bad Name For A File.js lame_looking_files.js // Good my-files.js this-really-good-name-for-a-long-file.js better-looking.js
Developers have opinions, I’m no different, and if you’re honest, you have opinions too. The problem comes when we have opinions on things that have little actual value. It’s called Bike Shedding, the technical stuff that matters usually receives little argument, but the color of the shed, or tabs versus spaces, or to semi-colon or not-semi-colon ;) .
Developers like to get opinionated about such things as where
Free yourself, leave all that stuff behind. Let go of your opinions. Just rely on one, of the many already well established style guides. Just as a note, a pretty greenhorn move is committing a bunch of changes your editor made automatically.
If you editor is making updates to the code automatically, then fix your editor or get a new one.
So put linting at the first thing that’s done by your CI when a PR is opened. If it doesn’t pass linting, then fail it immediately.