Get your brain to the gym!

Photo by KATRIN BOLOVTSOVA on Pexels.
This article was not written using any AI tool - expect grammar errors, incoherent thoughts, and all the stuff that makes me human!
This is the first article of a series aimed at programming. Nothing new here, except, we do it by hand, with our brains, and without LLM’s, or almost..
Specifically, we are gonna tackle Advent of Code 2016 using Typescript, with only one rule: no LLM-generated code allowed
So, why?
Well, it’s not a secret we (engineers) are all losing it a bit. Not our minds, no, but the ability to program by hand with our heads and no AI help. Can you blame us? After all, not using AI these days it’s like trying to outrun a motorbike because we used to run with out legs and that’s what we liked, damn motorbikes stealing our jobs!! 🙄
But jokes aside, you get what I mean, right? Motorbikes are cool, they go real fast and can get me there so quickly when I need to. All they need is money for the fuel, a manufacturer that makes them, and me having a license. I could build my own motorbike if I had the skills, but that’s another story! However, my legs are mine, and I can use them for free whenever I want. I can get better at using them with practice, and if one day my motorbike breaks, or the fuel gets to expensive, I can still use them to get where I need to go. So you see why sitting down on my motorbike all the time, may not be the best choice after all. Even if everyone is doing it. Be different, be smart, use your legs!
Ok enough chit-chat, here’s what’s gonna happen: I am gonna set you up with an easy local development environment to get you started.
Local set up
- First, you need
npmorpnpmorbunor whatever you like. Sincenpmis the first thing that came to mind and very commonly used, let’s use that.
npm --version -> to see which version you have, if you have it. If not, use your brain and Google to find out how to install it on your machine/OS.
You also need Node:
node --version -> install if you don’t have it
- Go or create a folder for your projects. Mines live in
~/Codeand if you don’t know~is the sign for$HOME. My folder is calledAOC-TSto make sure I remember a few hours from now what the heck that folder is about. Call yours what you like.
cd into this folder, and run:
npm init -y -> it will create a package.json and the -y will say yes to all the questions that command would normally ask with a yes or a no
-
Install the development tools In the same folder, run:
npm install -D typescript @types/node tsx vitest eslint @eslint/js typescript-eslintThe
-Dflag records these packages underdevDependencies:Package Purpose typescriptChecks TypeScript types @types/nodeProvides type definitions for Node.js APIs tsxRuns TypeScript files vitestRuns automated tests eslintChecks code against lint rules @eslint/jsProvides standard JavaScript lint configurations typescript-eslintAdds TypeScript support and lint rules -
Lastly, set up version control: You can use a tool I have created called
. You don’t have to install it, just run it via
npx:npx gig-ignite list-> and in the list, chose Typescript. The tool will create a complete.gitignorefor your project.
If you want to do it by hand, while in the root of your project (this means while inside the main folder):
touch .gitignore and add, at the very minimum:
/node_modules
/coverage
/dist
We want to keep package.json and package-lock.json as version-controlled files, so anyone (including you in a couple of months or years) who uses the project have the right dependencies.
- Configure TypeScript
We create tsconfig.json with touch tsconfig.json and we fill it with:
{
"compilerOptions": {
"target": "ES2023",
"module": "NodeNext",
"strict": true,
"noUncheckedIndexedAccess": true,
"noEmit": true,
"types": ["node"]
},
"include": ["src/**/*.ts"]
}
This sets up strict type checking for our source files, accounts for potentially missing indexed values, and disables generated JavaScript output. TypeScript configuration reference (https://www.typescriptlang.org/tsconfig/)
- Ran our first program
Create a file hello.ts inside src/hello.ts:
Fill the file with this code:
const message: string = "Ready for Advent of Code!";
console.log(message);
Then run:
npx tsx src/hello.ts
npx tsc
If you did everything correctly, the first command prints “Ready for Advent of Code” and the second completed without errors, confirming that the program passed type checking.
Bonus
Let’s say that you did your best, and triple checked everything, did some searching around and gave some thoughts, but still the damn thing does not run or keeps giving errors..well, it may be ok now to point your favourite LLM at your directory and ask for help. This is, IMO, the wisest way of using AI at this point in time.
End of part 0
This is it! Now we can start !
Come back for part 1!