Here I want to talk about what a team should do when they start a new project. I’ve had the privilege to architect several large projects and to come into several existing projects having a fair amount of girth. These are just a few thoughts about things teams needs to establish 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.md of every repo.
Just a sample of the many terms people use interchangeably to mean different things. Just the other day, I was on the phone talking to someone trying to sell me some advertising, our terms were not aligned so I was baffled when he quoted me some rates. As soon as we agreed that a
property was X and a
unit was Y, it all made much more sense.
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. A project I was on had, 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, it 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 yourself 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 having little actual value. It’s called Bike Shedding, the technical, meaty items receive 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 it all 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 without your knowledge, then fix your editor or get a new one.
So put linting at the first thing to do by your CI when a PR is opened. If it doesn’t pass linting, then fail it immediately.
If you’ve been on this blog for any length of time you will see I’m a huge fan of Gitlab 😍. When you start your project, get it deployed quickly. I mean, get your code running the CI / CD pipeline with every push up to your git server.
This is wrong thinking. Do this immediately, it will be more difficult later. Right now it’s simple to take a fresh greenfield project lint it, test it, package it, and deploy it. If you wait until later I guarantee there will be more hurdles to overcome and circles to run to get your app working correctly through your pipeline.
Begin as you mean to go on…
– Charles H. Spurgeon, All of Grace
By putting your new app through this exercise, it will correctly influence how your app will evolve and shape the direction it takes as it grows and develops.
Did this help you out? It took me a few days to piece together all this information together, I hope this saves you some time (who knows, maybe the future me will be thankful I wrote this down). Let me know your thoughts. firstname.lastname@example.org