Tips for coding with AI

Don’t overload AI with instructions/ context you are still the code owner, you must understand why AI made the changes it did otherwise you cannot spot errors/ over engineering Strive for consistent and sensible patterns that AI can find / reuse use unambiguous language when speaking with the agent and in terms of context do… Continue reading Tips for coding with AI

Published
Categorized as Process

TypeScript best practice guide

1. Introduction TypeScript is not real when compared to the type systems found in languages like C# / Java for example, it has absolutely no power at runtime because it does not exist in the native code we send to the browser, so we must not write development code that skews logical inference as that… Continue reading TypeScript best practice guide

Published
Categorized as Typescript

TypeScript: any vs unknown

Ideally we should never use any, but let’s say we are migrating a legacy project to TypeScript and some degree of pragmatism is in order. Let’s consider this block of code: to get the ball rolling with TypeScript someone probably added an any type here and it seems fairly safe as we never do anything… Continue reading TypeScript: any vs unknown

Published
Categorized as Typescript

react – don’t go crazy with memoization

check out this great article outlining how it can be very easy to misuse things like useCallback and useMemo dynamics in react projects https://kentcdodds.com/blog/usememo-and-usecallback And don’t forget – once React compiler lands we might be able to get rid of even more of these, then again don’t be too hasty….you may need to check a… Continue reading react – don’t go crazy with memoization

Check out Vite

I recently used Vite for a home project and I found it much better “out of the box” than webpack. I also used Vitest instead of Jest as my test runner, and it worked perfectly. https://vitejs.dev

Keep your FE dumb!

Try to keep your client as dumb as possible, to achieve this you should avoid the following: In many cases your service layer can take the heavy lift away from the FE which takes away complexity/ risk and avoids duplicating/ mutating business logic + domain sources of truth.