Posts

using Promise.all and Promise.allSettled like a boss (in a semantically correct way)

Sometimes we see this pattern with Promise.all const [api1, api2, api3, api4] = await Promise.all([   getForApiOne(id),   getForApiTwo(id),   getForApiThree(id).catch(() => undefined),   getForApiFour(id).catch(() => undefined), ]); This code works. But its circumventing the meaning of Promise.all().  Promise.all() stops if any promise fails (because Promise.all() assumes there is a strict dependency between promises). But this code catches 2 failed exception and returns undefined, effectively "working around" Promise.all(). Noting: it does retain the "fail fast" behavior of Promise.all() What would be more explicit is to use a mix of Promise.all() for critical and Promise.allSettled() for non critical calls because it's more explicit for what you're trying to achieve.  Use Promise.allSettled() when you want to allow all promises to run to completion, even if some fail, which is what is the intent in original code. note: Promise.allSettled() does ret...

don't become an intellectual tourist

Image
I learned a lot from this Ted talk  "How to stop AI from killing your critical thinking"  With so much AI available at our fingertips it's become clear to me that critical thinking skills are more important than ever. We cannot make the mistake of developing the habit of just accepting what AI tells us and delegating our critical thinking to AI.  So this talk resonated with me. The speaker is polished and in command. He hits us with some home truths: "where the knowledge worker no longer engages with the materials of their craft" "we've become intellectual tourists" we visit, but don't inhabit ideas "we've become middle managers for our own thoughts" Working with AI requires significant metacognitive reasoning (thinking about your own thinking process), about your task goals, decomposing work, applicability of gen-ai nd your ability to evaluate output. Working directly with the material makes you better at these skills and becomes...

chrome overrides is great for testing flows

Image
Chrome overrides is very useful for editing header responses from api calls. When working you can select a request in Network tab. Right click on it and choose "Override headers". Then edit headers (or content) in the right side. Reload the page and it should work. If you have not setup the local folder then when you choose "Override headers" for a request nothing happens. So confirm you have setup a local override folder: in Sources -> Overrides In setup y ou should have chosen a local folder to save overrides in.  

ai usage costs get real

Ok it's starting to happen: ai usage costs getting real. Github copilot announced changes to their pricing models to be more usage based, starting in 1 month. " Instead of counting premium requests, every Copilot plan will include a monthly allotment of GitHub AI Credits, with the option for paid plans to purchase additional usage. Usage will be calculated based on token consumption, including input, output, and cached tokens, using the listed API rates for each model." Uber reportedly spent their whole 2026 budget for Cursor and Claude code in the 1st four months of 2026. Maybe that's good. Maybe not. Its safe to say CFOs across orgs are paying attention. Burning tokens for no valuable outcome (tokenmaxxing) is not the right strategy (despite when ai vendors might tell you). The outcome has to be worth the investment. OpenAI and Anthropic are losing billions. OpenAI internal docs say they will lose $14 billion in 2026 and will lose $44bn until they turn profitable in...

anthropic mythos

Anthropics new model Mythos , scores significantly higher than Opus in a number of benchmarks and has found security bugs which have been present for decades in some os software. How much is hype vs reality, idk, but. Anthropic formed  project glasswing with some big names to manage security vulnerabilities. Theo is worried  (though you'll see some (funny) skepticism in the comments) Having software (browser, devices etc.) be up to date with latest versions is now non negotiable, has to be current. btw I read training cost for Mythos was $10 billion 😮 

From Claude Code to Figma – and Back Again - my notes

From Claude Code to Figma – and Back Again presentation link - presentation by Anthropic Thariq Shihipar from Anthropic and Brett McMillin from Figma - I had (and others) trouble connecting so missed first ~10 mins. But I understand was about installing figma mcp - Brett: roles are blending, workflows are blending, ideas can start from anywhere - Thariq: figma mcp allows Claude Code to go both ways; mcp allows you to get all of you data into agents - Brett introduced useFigma (in beta) which allows create or modify any design in figma   - recommended: load the "figma-use" skill in Claude code - Thariq jumped around a figma design doc - demod building a html web app from a figma   - then made changes in figma and had claude pick it up - Thariq showed how he used Claude code to generate a figma design, "good for starting"   - did they run the prompt in figma? ...it looks like it   - "figma canvas" - prompting playground, free tokens - Brett showed e...

cursor composer 2 model is a lot cheaper than Claude Opus

Image
"tokens are the currency of LLMs", and as usage increases so do costs, and these costs are no longer small change for organizations, t he messaging has definitely shifted to being cost conscious. cursors Composer 2 model is cursors own model available in cursor cursors composer model is cheap, 10x cheaper than Claude Opus 4.6/4.7 per million output tokens $2.5 versus $25 (and is also 10x cheaper for input tokens)  6x cheaper than Sonnet wow! that's really significant and from the chart below, from cursor benchmarks, indications are it performs well compared to Opus 4.6 imo it makes total sense to use cursors Composer 2 model as default  why not "Auto"? I've not used Auto so I can't comment from experience but I have read that it can be unpredictable and costly. Composer 2 works perfectly well for me If in Claude code then use Opus for complex tasks otherwise user Sonnet e.g. "write unit tests for Component Y" use Sonnet

AI maturity levels - understanding the software engineering disruption

Image
The last 2 to 3 years have been a whirlwind of disruption in Software engineering due to the impact of AI. I was seeking about a way to represent an "ai maturity" scale to make sense of the changes and I think this video based on  this article from Dan Shapiro is a good representation. From these I created a graphic which represents visually key points as I understand it. Remember about 2 or 3 years ago when you first used copilot in vscode? the predictive typeahead...pretty cool eh. Then we all moved on to cursor and its much better typeahead. Btw what a great acquisition by cursor to buy Supermaven code completion in 2024 . I believe it more than repaid their investment given cursors since skyrocketed valuation. And then came ai chat for code gen. At the time codegen quality was low e.g. "write tests for function xyz". It used to get maybe 30% and then you finished the rest. Then we added rules to make the codegen better (we added 1000s of lines of rules for diff...

cypress e2e tests: page objects vs application actions vs custom commands

Should you use Application Actions when writing cypress tests? Or is the Page Objects pattern better? Or neither and just write tests and use cypress custom commands to share common selectors and user actions? Page Objects is a well established pattern. Create classes for pages in your app and put selectors in those classes. Then in your test use (and reuse) the page object classes methods to simulate user actions such as fill in a field or submit a form. This centralizes and reuses selector code. Application Actions pattern exposes the applications model as a property on window which can be directly edited in cypress test code. Now test setup to add todos so they can be toggled becomes basically like so: `window.appModel.addToDos([{}, {}])` The author provides examples of how to use Application actions including with async operations. Faster setup results in faster tests. And per the author better organized app code. The Application Actions post link argues that Page Objects are a ...

My learnings from Addy Osmanis article on how good is AI React coding

These are my notes from the article How Good Is AI at Coding React (Really)?  by Addy Osmani. There's a lot of information packed into this presentation Addy says that AI is a force multiplier. "It amplifies everything: good requirements, good architecture, good taste" AI is most useful for scenarios such as building isolated components, scaffolding, implementing explicit requirements. Its less useful for scenarios such as: multi-step integration, design taste, complex state management.  We can generalize this to: the higher the complexity the less useful (productive) is the LLM.  I called this same point out in a presentation I made in October to our tech leaders.  And in fact Addys says this explicity later in the article:  "If you remember nothing else from this article, remember this: AI handles simple tasks well and then falls off a cliff as complexity rises." I like that Addy calls out "Objective benchmarks". We've seen by now that LLM model ...

AI product idea: your teams performance dashboard and continuous review

Ah yes, "Welcome Performance reviews my old friend" as the song goes So I'm using AI to help me write my performance review. I use Glean to pull key data from conversations, documents, tickets and more. I use Gemini to help me write and summarize data. And my manager will use AI when writing their performance review of me. So why not skip all this and build a product around this: a performance dashboard and continuous review for your team Imagine a dashboard of your team viewable by timeframe such as: day, week, month etc. for all activity as well as ability to zero in on specific projects Imagine Agents with specific focus:  Performance review Agent; reviews personnel performance based on custom criteria Career Growth Agent: a coach and mentor for personnel career growth. Feedback tailored to the persons role as well as their next role Career change Agent: want to switch from an IC engineer to Manager role, we have an agent for that Parental Leave Agent: guides you throu...

cursor commands

I'm liking cursors commands : a way to integrate your common ai prompts into cursor using the / command store your prompts (commands) as markdown in the repo folder, then access in cursor chat using slash command I'm storing my commands in a file in the repo but this is a nice enhancement by cursor

conductor - manage claude code instances

Running Claude Code in terminals is ok, but I felt managing it all needed a better user interface to organize and track.   conductor is an example of what such a user interface could be

claude code - technology and usages

Image
claude code npm tech stack:  typescript - claude code is written in ts (pssst: typescript is a must know language imo) react - ui is written in react and uses ink for interactive command line ink - react components for command line! used by a whole list of AI whos who with command line yoga - embeddable flexbox layout engine and  bun  - js runner, runtime, bundler; choose over webpack/vite etc. because bun is faster) npm to distribute claude code Started as a simple project to query what music someone was listening to. Then added capabilities to access the file system and run batch commands. Usage spread rapidly within Claude Code team who dogfooded it. "around 90% of claude code is written with claude code" (not by, with) claude code is a thin wrapper over the claude model, they deliberately want people to experience the raw model, not obstructed by much business logic a guiding principal is: simplicity, choose the simplest approach possible the most complex part of cl...

cursor chat token usage

Have you noticed that cursor chat requests can use a lot more tokens than you'd expect?  Matt Pocock said it well: "tokens are the currency of LLMs". You're charged by the token. A little, but it does add up. So we need to pay attention to token usage. I ran some tests in cursor chat to review token usage and was surprised by how many tokens are used by my chat requests. I ran these tests in a large repo which has a number of cursor rules files defined.  Tests: 1. ask a general tech question in chat, not related to specific code in repo; context used : 19.7k tokens prompt: "how should I choose between useSWR and react-router v6 for data fetching?" to contrast, same question in Claude 4.0 outside of cursor user 28 input tokens and 768 output tokens in response to contrast further, same question in Gemini 2.5 Pro outside of cursor used 19 input tokens and 1060 output tokens in response almost one twentieth the token usage of cursor chat!!! wow 2. ask to write...

stack overflow survey 2025 - links and notes

My notes from the stack overflow survey 2025 Interestingly usage of AI tools is widespread (84%). But  positive sentiment has decreased 10% to 60% since 2024 two thirds of devs are frustrated by AI solutions that are "almost right" and debugging AI generated code is more time consuming (45%) more devs actively distrust (46%) AI tools accuracy than trust it A majority of devs don't use AI Agents, but a majority of those who used say it does increase productivity. But I'll bet that increases significantly by next years survey. There's more details when you drill down into subsections in the survey such as AI Developer tools . e.g. 56% say AI is "bad" or "very poor" or "don't use" AI for complex tasks. And 14% are neutral. Only approx 15% are vibe coding The most popular web frameworks among professionals are nodejs (49%), react (47%), jquery (24%), nextjs (22%), asp.net core (21%) , Express (20%), Angular (20%), vue.js (18%) The mos...

ai engineer roadmap - Matt Pocock

These are my notes to Matt Pococks aihero.dev course "ai engineer roadmap" https://www.aihero.dev/ai-engineer-roadmap What is An AI Engineer Matt said his course is partly based on article from Latent Space: "The rise of the ai engineer" " An AI Engineer is a software developer who builds applications powered by AI" An AI Engineer needs strong software engineering fundamentals ability to build reliable scaleable applications knows modern AI tools and frameworks focuses on user experience and applications AI Engineers - use models, use prompt engineering, pipelines/chains, optimize cost/speed/performance, infra, evaluate systems. Different to an ML engineer who: build and train models, heavy math, phd level skills Yes, web developers can become AI Engineers. And Typescript is growing fast and makes a great fit for AI systems (well Matt would say that, wouldn't he!..but I do think it's true) What can you use LLMs for? 1. Converting unstructured to st...

Notes on interview with Kent Beck about AI and why it's like a "genie"

TDD, AI Agents and coding with Kent Beck https://www.youtube.com/watch?v=aSXaxOdVtAQ This podcast was really fun to learn from and I recommend. Kent is famous in the programming world, so his take on AI is worth learning from. Kent says he's spending 6-10 hours a day programming and in 50 years of programming it's the most fun he's had, "its a blast". Kents using agentic tools where it generates a bunch of code from a single prompt. Kent says nobody knows what works so try it all. So we should be experimenting.  Kents tried a number of different languages as he's experimented. Kent thinks of AI as an "unpredictable genie". Its a genie in that "it grants wishes and you wish for something and you get it, but it's not what you actually wanted: it volunteers features, doesn't care about design, willing to cheat (delete/modify tests) there can be some good things with this, but some bad I love this metaphor. I have experienced these aspects o...

nullish coalescing versus logical or

Is this code ok? customer ?. type || '' Probably, but strictly semantically speaking this should use '??' ( nullish coalescing)  instead of '||' The left side condition uses optional chaining which resolves to a value or undefined, ?? is more strict and only fires for null or undefined. Whereas '||' will execute for more values than null or undefined (also 0, false, NaN, '') So if customer.type was 0 then using '||' will resolve to the right side customer ?. type || 'none' // 'none' whereas if customer.type was 0 then using '||' will resolve to the left side customer ?. type || 'none' // 0

ais: the good, the bad, the ugly - the ugly

There are some things AI coding assistants are not good of assisting at this time. But because AI assistants always want to predict, it will. And ais will sound very confident in the prediction. Sometimes the answer can be completely misleading and just garbage. Which is much worse than no answer at all. We recently upgraded our react version and some cypress tests for the app then started failing. I did some investigation and could see an unexpected failing api call in the tests. Why?  I asked the llm for assistance with some context such as new version of react, some libraries, details on the test failure.  It's prediction was a reasonable guess given the prompt but a wrong guess. It suggested a bunch of code changes such as the following: 1. adding timeouts to every cypress element check e.g.   `cy.contains('button', 'Save', { timeout: 10000 }).should('be.visible').click();` 2. new cypress helper functions to handle a double action and then changed tests ...