null How I Built a 47-Signal Website Audit Tool That Runs in 15 Seconds on SitePoint.
#programming
367 posts (showing latest 300 - use search for the rest)
8 Jun
31 May
Having used Claude Code for a few months now, I have noticed how software development has changed for me. I write a lot less code, but I spend more time understanding and testing the code Claude has written. The proportions … Continue reading →
30 May
Comprehensive guide covering this topic with practical implementation details. How to Route DeepSeek-V4 Through Claude Code for Local Agentic Coding on SitePoint.
Comprehensive guide covering this topic with practical implementation details. Claude Code Plan Mode: The Read-First Workflow for Complex Refactors on SitePoint.
28 May
Comprehensive guide covering this topic with practical implementation details. DeepSeek R2: What Developers Need to Know Before August on SitePoint.
Comprehensive guide covering this topic with practical implementation details. Automating Code Review with DeepSeek in GitHub Actions on SitePoint.
Comprehensive guide covering this topic with practical implementation details. Local LLM Deployment: Ollama vs vLLM vs LM Studio Compared on SitePoint.
24 May
Comprehensive guide covering this topic with practical implementation details. Vibe Coding 2026: The Structured Guide to AI-First Development on SitePoint.
Learn how ArvoWorks uses Kanban boards as a collaboration plane between humans and multi-agent AI systems — with agents that pause mid-task to ask for input, request approvals, and delegate work to specialised sub-agents. Build a Human-AI Collaborative Workflow with ArvoWorks and Kanban on SitePoint.
Comprehensive guide covering Vitest 4 Browser Mode: Component Testing Without Playwright with practical implementation details. Vitest 4 Browser Mode: Component Testing Without Playwright on SitePoint.
Comprehensive guide covering this topic with practical implementation details. OpenAI Codex CLI: Terminal-First Coding Agent Tutorial (2026) on SitePoint.
Comprehensive guide covering LM Studio 0.4 Headless Deployment: Local LLM APIs Without the GUI with practical implementation details. LM Studio 0.4 Headless Deployment: Local LLM APIs Without the GUI on SitePoint.
ECC supercharges Anthropic's Claude Code with 60 specialized agents, 232 skills, 75 commands, and a security scanner running 1,282 tests — plus multi-harness support across Codex, Cursor, OpenCode, and GitHub Copilot. Everything Claude Code: Turn Your AI Coding Agent Into a Production Engineering Platform on SitePoint.
Learn how AI agent memory works, the 5 failure modes that break production agents, and practical fixes, including a local LLM implementation. The New Reality of Agent Memory: The Complete Guide (2026) on SitePoint.
19 May
Comprehensive guide covering TypeScript 6.0 Migration: What Changed and How to Adapt Your tsconfig with practical implementation details. TypeScript 6.0 Migration: What Changed and How to Adapt Your tsconfig on SitePoint.
Comprehensive guide covering React useOptimistic: Production Patterns for Instant UI Updates with practical implementation details. React useOptimistic: Production Patterns for Instant UI Updates on SitePoint.
18 May
HTML images just got better, with the subtlest change to your codebase Photo by Adi Suyatno I know what you’re thinking. Scott, I landed on Medium on a small but not mobile-small display and the download chunk related to images in my home feed was like 7% smaller. First of all, thank you for noticing. Second, what if I told…
12 May
Building a Google Drive Sync Engine that Survives MV3 Service Workers
Stack Overflow10 May
Maxim AI vs DeepEval vs LangSmith vs QA Wolf: Which AI Agent Testing Framework Should You Trust With Production in 2026?
SitePointComprehensive guide covering Maxim AI vs DeepEval vs LangSmith vs QA Wolf: Which AI Agent Testing Framework Should You Trust With Production in 2026? with practical implementation details. Maxim AI vs DeepEval vs LangSmith vs QA Wolf: Which AI Agent Testing Framework Should You Trust With Production in 2026? on SitePoint.
Comprehensive guide covering Continue.dev for Developers: The Complete Local AI Coding Assistant Setup with practical implementation details. Continue.dev for Developers: The Complete Local AI Coding Assistant Setup on SitePoint.
Comprehensive guide covering Qwen3-Coder-Next Local Deployment: A Complete Developer Guide (2026) with practical implementation details. Qwen3-Coder-Next Local Deployment: A Complete Developer Guide (2026) on SitePoint.
Comprehensive guide covering TypeScript 5.8 Erasable Syntax: Running TS Directly in Node.js with practical implementation details. TypeScript 5.8 Erasable Syntax: Running TS Directly in Node.js on SitePoint.
Comprehensive guide covering Gemma 3 Local LLM Deployment: Google's AI for Developers (2026) with practical implementation details. Gemma 3 Local LLM Deployment: Google's AI for Developers (2026) on SitePoint.
Comprehensive guide covering React 19 use() Hook: Data Fetching Patterns That Actually Work with practical implementation details. React 19 use() Hook: Data Fetching Patterns That Actually Work on SitePoint.
24 Apr
Single AI queries are dead ends for large-scale code changes. Here's how to build multi-step AI pipelines where each model specializes — and hands off cleanly to the next. The Model Handshake: How to Chain AI Agents for Complex Refactors on SitePoint.
Comprehensive guide covering AI Agent Testing Automation: Developer Workflows for 2026 with practical implementation details. AI Agent Testing Automation: Developer Workflows for 2026 on SitePoint.
Comprehensive guide covering Claude Code vs Cursor vs Copilot: The 2026 Developer Comparison with practical implementation details. Claude Code vs Cursor vs Copilot: The 2026 Developer Comparison on SitePoint.
Comprehensive guide covering MCP Model Context Protocol: Complete Developer Integration Guide with practical implementation details. MCP Model Context Protocol: Complete Developer Integration Guide on SitePoint.
22 Apr
Mac-specific deployment guide covering Ollama MLX setup, model quantization by Mac tier, and performance optimization Llama 4 Scout on MLX: The Complete Apple Silicon Guide (2026) on SitePoint.
Architecture guide covering routing logic, gateway setup, cost-benefit analysis, and production deployment patterns for hybrid LLM systems Hybrid Cloud-Local LLM: The Complete Architecture Guide (2026) on SitePoint.
Deep-dive tutorial covering xhigh effort configuration, auto-verification workflows, cost optimization, and production patterns Claude Code 2.1: The Complete xHigh and Auto-Verification Guide (2026) on SitePoint.
20 Apr
Comprehensive TCO analysis comparing Llama 3, Mistral 8x7B, and other open-source models against Claude and GPT-4. Includes compute costs, licensing, deployment infrastructure, and performance benchmarks. Helps teams make data-driven decisions on their LLM strategy for 2026. Open-Source vs Commercial LLMs: The Complete Guide (2026) on SitePoint.
Technical deep-dive covering V3.2's new features, API patterns, benchmark performance, and migration from V3 DeepSeek V3.2: The Complete Developer Guide (2026) on SitePoint.
Step-by-step guide to deploying DeepSeek R1 on your local machine or private servers. Covers hardware requirements, environment setup, Docker containerization, inference optimization, and integration with Python apps. Perfect for developers wanting privacy-first reasoning model access. Running DeepSeek R1 Locally: Your Complete Setup Guide (2026) on SitePoint.
Advanced guide to deploying Claude Code as a fully autonomous agent for software engineering tasks. Covers agent scaffolding, multi-turn reasoning loops, error recovery, and integration with existing CI/CD pipelines. Includes real-world examples of agents handling full feature development cycles. Claude Code as an Autonomous Agent: Advanced Workflows (2026) on SitePoint.
DeepSeek R1 is the reasoning model that's revolutionizing how developers approach coding. This comprehensive guide covers understanding the R1 architecture, implementing it in production workloads, optimizing for performance, and integrating with existing tools. DeepSeek R1 Complete Developer Guide (2026) on SitePoint.
Anthropic shipped Claude Opus 4.7 with major improvements in coding, vision, and agentic workflows. Here's what developers actually get with the new model. Claude Opus 4.7 Is Here: What Developers Actually Get on SitePoint.
17 Apr
Taylor Pearson's Claude.md workflow uses a single Markdown file as a persistent source of truth for iterative AI coding. Here's how it works and why it's changed how indie hackers build software. The Claude.md Trick: How to Build Full-Stack Apps 5x Faster with One File on SitePoint.
Make.com and n8n are expensive and complex. Claude Code routines offer a powerful, cost-effective alternative for developers who want to automate workflows using AI. Here's how to migrate. Replace Make.com and n8n with Claude Code Routines: The 2026 Workflow Revolution on SitePoint.
Simon Last (Notion co-founder) shared a method enabling AI coding agents to run continuously for 13 days—far exceeding typical agent limits of about an hour. Here's how to build resilient long-running coding agents that don't lose context or lose the plot. How to Run AI Coding Agents Continuously for Days Without Losing the Plot on SitePoint.
Comprehensive comparison between DeepSeek R1 and Claude Code for developers choosing between reasoning AI assistants. DeepSeek R1 vs Claude Code: The Complete Showdown (2026) on SitePoint.
Practical solutions to common problems when working with DeepSeek R1 in production. DeepSeek R1 Troubleshooting Guide: Common Issues and Solutions (2026) on SitePoint.
14 Apr
Step-by-step workflow for long-running sessions, context discipline, failure recovery, and prompt hygiene Claude Code in Production: How to Keep Long Runs Stable on SitePoint.
31 Jan
For the last few months, I have been developing a new reporting application. Early on, I decided to add a –dry-run option to the run command. This turned out to be quite useful – I have used it many times … Continue reading →
25 Aug 2025
Cross-Digest diversification In this part 4, we’ll see how we went from investigating a few complaints from digest power users to improving our digest recommendations across the board. Intro : This is a 4-part series breaking down improvements to the algorithm behind the Medium’s Daily Digest over the past year. When we started this work, the Digest was suboptimal —…
15 Jun 2025
Since 2002, I have been keeping track of all the tricky bugs I have come across. Nine years ago, I wrote a blog post with the lessons learned from the bugs up till then. Now I have reviewed all the … Continue reading →
2 Mar 2025
Here are more good programming quotes I have found since my last post. Programming “Configuration is coding in a poorly designed programming language without tests, version control, or documentation.”Gregor Hohpe “It’s the developers misunderstanding, not the expert knowledge, that gets … Continue reading →
8 Feb 2025
This week I attended the Jfokus software development conference in Stockholm, Sweden. I first went in 2011, and I have been back many times through the years. The conference has a Java focus (duh!), but many talks cover general topics … Continue reading →
20 Dec 2024
Forms are everywhere online, from signing up for newsletters to making purchases. But let’s be honest — nothing’s more frustrating than a form that’s hard to fill out or riddled with unclear error messages. In this post, we’ll dive into practical tips and tricks to make your form validation seamless, user-friendly, and maybe even enjoyable! We’ll walk through tips for…
1 Oct 2024
The Two Billion Claps Bug TL;DR A user was able to exploit a race condition in our backend system to manipulate clap counts on posts. Users are supposed to only be able to clap between 0 and 50 times for a given post, but this hack allowed them to go outside those bounds (both above and below). Our fix leverages…
25 Aug 2024
Using ChatGPT when I code has been a real productivity boost for me. Instead of reading an example on Stack Overflow and figuring out how to adapt it to my particular case, I immediately get code tailored to my specific … Continue reading →
11 Feb 2024
For the first time ever, I was laid off, and had to find a new software developer job. I managed to find a new one, but it took longer than I thought, and it was a lot of work. I … Continue reading →
18 Jan 2024
Strava challenges offer a fun way for athletes to compete against themselves and others! Back in 2020, our legacy challenge leaderboard system was running into bottlenecks and scalability problems on a regular basis, and we often found ourselves putting out fires to keep the system stable. In late 2020 and early 2021, I worked on a project to replace the…
10 Jan 2024
“Software design is preparation for change; change of behavior” Tidy First? is a new book by Kent Beck. It is a short little book, only about 100 pages (and lots of white space on them), but it contains some deep … Continue reading →
24 Oct 2023
Accepting online payments is now a universal must-have, catering to everyone from solo entrepreneurs to massive global corporations. PayPal’s Standard Checkout allows for seamless integration of PayPal’s Payment Buttons component into your e-commerce app, granting you the power to accept online payments. In this guide, I am going to show how to add Standard Checkout to a simple shopping app,…
10 Sept 2023
I really like this quote from Jeff Bezos: “Anybody who doesn’t change their mind a lot is dramatically underestimating the complexity of the world we live in.” Lately I have been thinking about what I have changed my mind about … Continue reading →
12 Jun 2023
Your First Steps with SudoLang If you want to build chat bots, games, or applications using AI models like ChatGPT, you’ve come to the right place. In this article, we’re going to dive into the basics of SudoLang, a powerful natural language pseudocode programming language designed to instruct advanced language models like OpenAI’s GPT-4, Anthropic’s Claude, and others. SudoLang was…
23 Apr 2023
Two months ago, I was a guest on the Maintainable podcast. The first question the host Robby Russell asks is “What are a few characteristics of well-maintained software?”. This is such a great question, and I thought I would expand … Continue reading →
7 Jan 2023
Every time I hear about software maintenance as a distinct activity, I cringe. That’s because it is based on the outdated notion that first software is developed, then it is maintained. But that is not how software development works today. … Continue reading →
11 Dec 2022
A few months ago I switched to working in Go. Before that, my main language was Python for many years. The change to Go has been very smooth, without any major surprises or stumbling blocks. This may partly be because … Continue reading →
19 Jun 2022
I recently finished Effective Software Testing – A Developer’s Guide by Maurício Aniche, and I really liked it. I have been coding for a long time and I think I have been writing pretty good tests for the features I … Continue reading →
13 Dec 2021
There seems to be an established truth in programming that code reviews find a lot of bugs. An example is chapter 18 (Modern Code Review) in the book Making Software. This is however not my experience – I rarely find … Continue reading →
12 Jul 2021
I really liked A Philosophy of Software Design by John Ousterhout. It is compact and short, only 170 pages, so it is a quick read, but it contains many good ideas. The focus is on how to structure systems to … Continue reading →
15 Jun 2021
I used to think that I didn’t need comments if I wrote self-documenting code. However, I have realized that I do write comments, and that I find them really useful. To see how many comments I write, and what kind … Continue reading →
24 May 2021
Microservices have gone through a complete hype cycle. From being hailed as the one true way to build systems, to a backlash where they are often considered too difficult and complex. In a way though, they are like most technology … Continue reading →
7 May 2021
By: Wayne Pichotta Hackathons are a powerful tool to accelerate innovation by requiring usable and useful code in just a matter of days, these events prioritize substantive progress over lofty perfection. We’ve hosted several of these Hackathons internally at Truecar in the past few years, with a surprising number of groundbreaking ideas finding themselves refined and productionized after the Hackathon…
19 Apr 2021
For the past few months, I have been interviewing with several companies. In all cases, one or more coding tests were included. I have also been on the interviewing side, evaluating a coding test. Here are my thoughts on the … Continue reading →
16 Apr 2021
Here are more good programming quotes I have found since my last post. Programming “It has been said that the great scientific disciplines are examples of giants standing on the shoulders of other giants. It has also been said that … Continue reading →
5 Jan 2021
Today’s post comes from a recent Go pop quiz. Consider this benchmark fragment. A convenience wrapper around sort.Sort(sort.StringSlice(s)), sort.Strings sorts the input in place, so it isn’t expected to allocate (or at least that’s what 43% of the tweeps who responded thought). However it turns out that, at least in recent versions of Go, each […]
15 Dec 2020
Picture yourself, an engineer working at the hottest distributed microservices de jour, assigned to fix a bug. You jump into an unfamiliar codebase and quickly locate the line where the problem occurred. The fix is simple, just return early or substitute a default value in the case that one cannot be determined from your input. […]
30 Aug 2020
You have developed a new feature. The code has been reviewed, and all the tests pass. You have just deployed this new feature to production. So on to the next task, right? Wrong. Most of the time, you should check … Continue reading →
23 Jul 2020
To check if a program is doing what it should, you can inspect the output from a given input. But as the system grows, you also need logging to help you understand what is happening. Good log messages are crucial … Continue reading →
19 Jun 2020
The Go compiler’s SSA backend contains a facility to produce HTML debugging output of the compilation phases. This post covers how to print the SSA output for function and methods. Let’s start with a sample program which contains a function, a value method, and a pointer method: Control of the SSA debugging output is via […]
24 May 2020
Per the overlapping interfaces proposal, Go 1.14 now permits embedding of interfaces with overlapping method sets. This is a brief post explain what this change means: Let’s start with the definition of the three key interfaces from the io package; io.Reader, io.Writer, and io.Closer: Just as embedding a type inside a struct allows the embedded type’s […]
16 May 2020
A few days ago Fatih posted this question on twitter. I’m going to attempt to give my answer, however to do that I need to apply some simplifications as my previous attempts to answer it involved a lot of phrases like a pointer to a pointer, and other unhelpful waffling. Hopefully my simplified answer can […]
9 May 2020
Conventional wisdom dictates that the larger the number of types declared in a Go program, the larger the resulting binary. Intuitively this makes sense, after all, what’s the point in defining a bunch of types if you’re not going to write code that operates on them. However, part of the job of a linker is […]
2 May 2020
In the previous post I discussed how leaf inlining allows the Go compiler to reduce the overhead of function calls and extend optimisation opportunities across function boundaries. In this post I’ll discuss the limits of inlining and leaf vs mid-stack inlining. The limits of inlining Inlining a function into its caller removes the call’s overhead […]
27 Apr 2020
In the fall of 1999 I got the biggest productivity boost of my entire career as a software developer. In the October issue of IEEE Computer magazine, there was an article by Kent Beck called “Embracing change with extreme programming”. … Continue reading →
25 Apr 2020
This is a post about how the Go compiler implements inlining and how this optimisation affects your Go code. n.b. This article focuses on gc, the de facto Go compiler from golang.org. The concepts discussed apply broadly to other Go compilers like gccgo and tinygo but may differ in implementation and efficacy. What is inlining? […]
3 Apr 2020
So, I just watched Michał Muskała ’s talk at CodeBEAMSF, and I have something to say… https://medium.com/media/111e462a24f172ad0b245a48d12b0a27/href As you might know, I’m also working with Juan Bono , Diego Calero , Facundo Olano , and others on our own formatter for Erlang (just like Daniel Tipping is working on steamroller ). I could write an article on how our formatter…
22 Mar 2020
I really like Secure by Design. The key idea is that there is a big overlap between secure code and good software design. Code that is strict, clear and focused will be easier to reason about, and will have fewer … Continue reading →
10 Mar 2020
The testing package is one of my favourite packages in the Go standard library, not just because of its low noise approach to unit testing, but, over the lifetime of Go, it has received a steady stream of quality of life improvements driven by real world usage. The most recent example of this is, in […]
20 Jan 2020
Here are more good programming quotes I have found since my last post. Microservices “Microservices are just dynamic linking over HTTP” via @mononcqc “kubernetes – turning things off and on again, at scale” @decimalator Full stack “A full stack developer … Continue reading →
4 Jan 2020
In the book club at work, I just finished reading Grokking Deep Learning by Andrew Trask. It is an introduction to deep learning, but there are some problems. It spends a lot of pages on the basics, and in the … Continue reading →
20 Dec 2019
Roses are red Violets are blue I have stuck in vim And so have you. Vim ain't for newbies But I'm a curious soul So I went down That shell rabbit hole. I tried to edit hosts Everything went wrong The file remained open For two hours long. When I found the magic Semicolon double-u q The file was readonly…
12 Dec 2019
[others]: Variable names must be descriptive. [me]: $help-help-help: #F1F1F1;
4 Dec 2019
Me: $ git commit -m "Closes issue #13" * Remove obsolete reference to core entity * Refactor module generating values * Log every ac... Colleague: “Hey, the pizza is heeeere” Me: * backspaces * $ git commit -m "Fixes"
3 Dec 2019
I am talking to my code but according to my cat, this is the least worrying.
22 Nov 2019
Roses are red Violets are blue I was looping forever And then I found you. i was your name I think j was next to you Born inside a for Died in there too. I saw you getting bigger Loop over loop over loop And j was getting smaller You were a great group. And then you just vanished You…
27 Oct 2019
I really enjoyed Classic Computer Science Problems in Python by David Kopec. It covers many different problems I hadn’t read detailed explanations of before. For example: neural networks, constraint-satisfaction problems, genetic algorithms and the minimax algorithm. Unlike many other books … Continue reading →
6 Oct 2019
In the beginning, before the go tool, before Go 1.0, the Go distribution stored the standard library in a subdirectory called pkg/ and the commands which built upon it in cmd/. This wasn’t so much a deliberate taxonomy but a by product of the original make based build system. In September 2014, the Go distribution […]
29 Sept 2019
I like to use Test-Driven Development (TDD) when coding. However, in some circumstances, TDD is more of a hinderance than a help. This happens when how to solve the problem is not clear. Then it is better to first write … Continue reading →
24 Sept 2019
APIs should be easy to use and hard to misuse. — Josh Bloch A good example of a simple looking, but hard to use correctly, API is one which takes two or more parameters of the same type. Let’s compare two function signatures: What’s the difference between these functions? Obviously one returns the maximum of […]
5 Sept 2019
This is a post about performance. Most of the time when worrying about the performance of a piece of code the overwhelming advice should be (with apologies to Brendan Gregg) don’t worry about it, yet. However there is one area where I counsel developers to think about the performance implications of a design, and that […]
8 Jul 2019
This article is based on my GopherCon Singapore 2019 presentation. In the presentation I referenced material from my post on declaring variables and my GolangUK 2017 presentation on SOLID design. For brevity those parts of the talk have been elided from this article. If you prefer, you can watch the recording of the talk. Readability […]
10 Jun 2019
This essay is a derived from my dotGo 2019 presentation about my favourite feature in Go. Many years ago Rob Pike remarked, “Numbers are just numbers, you’ll never see 0x80ULL in a .go source file”. —Rob Pike, The Go Programming Language Beyond this pithy observation lies the fascinating world of Go’s constants. Something that is […]
26 May 2019
The book Accelerate details the findings of four years of research on how DevOps affects various outcomes, such as software delivery tempo and stability, as well as the organizations’ profitability and market share. DevOps in this context means things like … Continue reading →
14 May 2019
In previous posts and presentations I talked about how to test, and when to test. To conclude this series of I’m going to ask the question, why test at all? Even if you don’t, someone will test your software I’m sure no-one reading this post thinks that software should be delivered without being tested first. […]
7 May 2019
I’m a big fan of testing, specifically unit testing and TDD (done correctly, of course). A practice that has grown around Go projects is the idea of a table driven test. This post explores the how and why of writing a table driven test. Let’s say we have a function that splits strings: // Split […]
3 Apr 2019
I like good programming quotes. Here are some new ones I have found since my last posts. Complexity “Why do people find DNS so difficult? It’s just cache invalidation and naming things.” – @jdub “Your code doesn’t work!” “It works … Continue reading →
30 Mar 2019
Is programming like math, or is it like writing? I think there are elements of both in it, even though programming is a discipline of its own. Nevertheless, it is interesting to think about what aspects are like math, and … Continue reading →
17 Feb 2019
The open source projects that I contribute to follow a philosophy which I describe as talk, then code. I think this is generally a good way to develop software and I want to spend a little time talking about the benefits of this methodology. Avoiding hurt feelings The most important reason for discussing the change you want […]
8 Oct 2018
In Ruby, objects have a handy method called method_missing which allows one to handle method calls for methods that have not been defined. Most examples out there explain how to implement this in Python using __getattr__, however, none of them (honestly, none) explain how to intercept class method (@classmethod) invocations using __metaclass__. And this is […]
3 Sept 2018
This is a short response to the recently announced Go 2 generics draft proposals Update: This proposal is incomplete. It cannot replace two common use cases. The first is ensuring that several formal parameters are of the same type: contract comparable(t T) { t > t}func max(type T comparable)(a, b T) T Here a, and […]
16 Jul 2018
In my previous post I converted httpstat to use Go 1.11’s upcoming module support. In this post I continue to explore integrating Go modules into a continuous integration workflow via Travis CI. Life in mixed mode The first scenario is probably the most likely for existing Go projects, a library or application targeting Go 1.10 […]
14 Jul 2018
Update: Since this post was written, Go 1.11beta2 has been released. I’ve updated the setup section to reflect this. Russ Cox kindly wrote to me to explain the reasoning behind storing the Go module cache in $GOPATH. I’ve included his response inline. This weekend I wanted to play with Ubuntu 18.04 on a spare machine. […]
12 Jul 2018
This blog post was inspired by a conversation with a co-worker about using a slice as a stack. The conversation turned into a wider discussion on the way slices work in Go, so I thought it would be useful to write it up. Arrays Every discussion of Go’s slice type starts by talking about something […]
25 Jun 2018
When I switched jobs four years ago, I went from using subversion (svn) to using git as the version control system. Even though I am a pretty quick learner, it took me a quite a while to really understand git. … Continue reading →
29 May 2018
This post discusses how maps are implemented in Go. It is based on a presentation I gave at the GoCon Spring 2018 conference in Tokyo, Japan. What is a map function? To understand how a map works, let’s first talk about the idea of the map function. A map function maps one value to another. Given […]
25 May 2018
30 Apr 2018
Testing with Laravel is very easy, but it can be a nightmare when the tests depend on Events and Listeners. In this post I’m gonna show you how you can simplify and improve those tests. Laravel is one of the most popular PHP frameworks nowadays, and I’d say its Event handler is one of the … Continue reading Solitary or…
2 Apr 2018
Working remotely is the dream job of most developers I know. It’s a hard process but it’s totally possible. Now you got the best job you could . Enjoy your new life! The beginning. The dream. Do you remember yourself some weeks/months ago? The first interview you did (maybe you’re not a native English speaker like … Continue reading Congratulations!…
26 Mar 2018
Maintaining an open source project – even a small one – is not an easy task. The open source ecosystem is about sharing and contributing, about giving and receiving. You scratch my back and I will scratch yours. Open-source is not only a free and open software, it’s a lifestyle. Working with open-source is working … Continue reading Open-source is…
19 Mar 2018
One of the most discussed topics in the technology field is about having degrees and how important they are. Do you really need one to be a good engineer? When is it really important for you? Writing a post like this is a big responsibility. I’m not here to say if you should attend to … Continue reading Degree or…
13 Mar 2018
In the book club at work, we recently finished reading Exercises in Programming Style by Cristina Videira Lopes. The book consists of a simple program implemented in 33 different programming styles. It is a great way of showing the different … Continue reading →
16 Jan 2018
What does a distro provide? The most popular docker base container image is either busybox, or scratch. This is driven by a movement that is equal parts puritanical and pragmatic. The puritan asks “Why do I need to run init(1) just to run my process?” The pragmatist asks “Why do I need a 700 meg […]
8 Jan 2018
This is an article about compiler directives; or as they are commonly known, pragmas. It’s derived from a talk of a similar name that I gave last year at GopherChina in Shanghai. But first, a history lesson Before we talk about Go, let’s talk a little about pragmas, and their history. Many languages have the notion […]
6 Jan 2018
This is a post inspired by a question on the Go Forum. The question, paraphrased, was “If properly aligned writes are guaranteed to be atomic by the processor, why does the race detector complain?” The answer is, there are two uses of the word atomic in play here. The first, the one the OP references, […]
17 Dec 2017
For the past two months, I have been helping my son’s grade 8 class to learn to program. All students wrote Python programs and got a feel for what programming is. This post has details on how we organized the … Continue reading →
30 Nov 2017
At a recent RubyConf, Chad Fowler presented his ideas for writing software systems that mirror the process of continual replacement observed in biological systems. The first principal of this approach is, unsurprisingly, to keep the components of the software system small–just as complex organisms like human beings are constituted from billions of tiny cells which […]
1 Nov 2017
If you want to make Swift programmer shudder, just whisper the words “associated types.” They’re one of the few Swift language typing features you’re unlikely to find in other programming languages, so they can take some getting used to. Last week I tried to write a seemingly simple function, and ended up spending most of my day diving down the…
18 Oct 2017
One of the challenges in developing an API for mobile apps is that there is not both a pleasant and reliable way of forcing them to upgrade. This means that in some cases your API needs to support apps that are several years old. The mobile API for RetailMeNot is no exception. This post walks through one of the ways…
16 Sept 2017
A good programming quote captures an insight about programming, often in a funny way. Many quotes are quite famous, but I like ones that are a bit less well-know. A while ago, I listed some favorites. Here are more good … Continue reading →
14 Sept 2017
Recently I started a gig where I was handed a laptop and told I should take it home with me at night. Now this isn't the worst thing ever but I was already carrying one laptop with me (my personal/work laptop as opposed to the one given to me
23 Aug 2017
In September i’ll be speaking about Go at events in Russia and Taiwan. DevFest Siberia 2017, September 23rd and 24th I’ve been accepted to give two presentations at the GDG Novosibirsk DevFest Siberia 2017 event in Russia. High performance servers without the event loop Conventional wisdom suggests that the key to high performance servers are native threads, […]
20 Aug 2017
I recently found out about the book Developer Testing – Building Quality Into Software by Alexander Tarlinder, and I immediately wanted to read it. Even though I am a developer at heart, I have always been interested in software testing … Continue reading →
This is an experience report about the use of, and difficulties with, the context.Context facility in Go. Many authors, including myself, have written about the use of, misuse of, and how they would change, context.Context in a future iteration of Go. While opinions differs on many aspects of context.Context, one thing is clear–there is almost unanimous agreement that […]
9 Aug 2017
This is an experience report about a gotcha in Go that catches every Go programmer at least once. The following program is extracted from a larger version that caused my co-workers to lose several hours today. package mainimport "fmt"type T struct{}func (t T) F() {}type P interface { F()}func newT() *T { return new(T) }type […]
22 Jul 2017
A long time ago, someone–I normally attribute this to David Symonds, but I can’t be sure he was the first to say it–said that the reason for adding generics to Go would be the reason for calling it Go 2.0. That is to say, adding generics to the language would be half baked if they […]
10 Jul 2017
Last week I attended a software development conference, QCon in New York. Here are my impressions of it, as well as some thoughts on programming conferences in general. For me, there are several reasons to attend developer conferences. You have … Continue reading →
8 Jul 2017
Some time ago I was faced with a task of testing a bash script. At first I decided to use Python unit-tests, however, I was reluctant to bring external technologies to the project. Therefore I had to go with the testing framework written in the notorious bash. Overview of the existing solutions After googling available solutions, I was presented with…
20 Jun 2017
This is a short post describing the procedure for discovering which version of Go was used to compile a Go binary. This procedure relies on the fact that each Go program includes a copy of the version string reported by runtime.Version() . Linker magic ensures that this value will be present in the final binary irrespective […]
18 Jun 2017
In my previous post I discussed my concerns the additional complexity adding generics or immutability would bring to a future Go 2.0. As it was an opinion piece, I tried to keep it around 500 words. This post is an exploration of the most important (and possibly overlooked) point of that post. Indeed, the addition of […]
14 Jun 2017
Fifteen years ago Python’s GIL wasn’t a big issue. Concurrency was something dismissed as probably unnecessary. What people really was needed was a faster interpreter, after all, who had more than one CPU? But, slowly, as the requirement for concurrency increased, the problems with the GIL increased. By the time this decade rolled around, Node.js and […]
11 Jun 2017
This is a thought experiment, what would Go look like if we could no longer declare variables at the package level? What would be the impact of removing package scoped variable declarations, and what could we learn about the design of Go programs? I’m only talking about expunging var, the other five top level declarations would […]
9 May 2017
I was recently asked in an interview about my opinion on how to be a great programmer. That’s an interesting question, and I think we can all be great programmers, regardless of our talent, if we follow a couple of rules that – I believe – should be common sense. In fact, these rules don’t … Continue reading 10 Tips…
30 Apr 2017
In my previous post I showed that Go maps are not reference variables, and are not passed by reference. This leaves the question, if maps are not references variables, what are they? For the impatient, the answer is: A map value is a pointer to a runtime.hmap structure. If you’re not satisfied with this explanation, read on. What […]
29 Apr 2017
My post on pointers provoked a lot of debate about maps and pass by reference semantics. This post is a response to those debates. To be clear, Go does not have reference variables, so Go does not have pass-by-reference function call semantics. What is a reference variable? In languages like C++ you can declare an alias, […]
28 Apr 2017
In my experience, code can rot in two distinct ways. The first case is code that hasn’t been used in a long time, but where the environment has changed so it is no longer possible to run the code. In … Continue reading →
26 Apr 2017
This post is for programmers coming to Go who are unfamiliar with the idea of pointers or a pointer type in Go. What is a pointer? Simply put, a pointer is a value which points to the address of another. This is the textbook explanation, but if you’re coming from a language that doesn’t let […]
11 Apr 2017
Full disclosure: my employer makes a Slack alternative. All my concerns about the use of Slack type chat services apply equally to its competitors, including my employer’s. I’ve tweeted a few times about my frustration with the movement of open source projects from open, asynchronous, communication tools like forums, mailing lists, and issue trackers, to […]
1 Apr 2017
Organize Django settings into multiple files and directories. Easily override and modify settings. Use wildcards and optional settings files. Managing Django’s settings might be tricky. There are severals issues which are encountered by any Django developer along the way. First one is caused by the default project structure. Django clearly offers us a single settings.py file. It seams reasonable at…
20 Mar 2017
A few weeks ago I was asked by a friend, “why should I care about Go”? They knew that I was passionate about Go, but wanted to know why I thought other people should care. This article contains three salient reasons why I think Go is an important programming language. Safety As individuals, you and I may be […]
14 Mar 2017
This post is another one brought to you by the good people at InRhythm. If you're an engineer that likes writing and building strong, happy culture focused on learning and growth you should apply! I like working with smart, passionate people :). Lots of companies embrace pair programming as a way
9 Feb 2017
In April and May I’ll be speaking at GopherChina and GopherCon Singapore, respectively. This post is a teaser for the talks that were selected by the organisers. If you’re in the area, I hope you’ll come and hear me speak. GopherChina GopherChina is the third event in this conference series and this year will return to Shanghai. I was […]
25 Jan 2017
In my previous post I suggested that the best way to break the compile time coupling between the logger and the loggee was passing in a logger interface when constructing each major type in your program. The suggestion has been floated several times that logging is context specific, so maybe a logger can be passed around via […]
23 Jan 2017
This post is a spin-off from various conversations around improving (I’m trying not to say standardising, otherwise I’ll have to link to XKCD) the way logging is performed in Go projects. Consider this familiar pattern for establishing a package level log variable. package foo import “mylogger” var log = mylogger.GetLogger(“github.com/project/foo”) What’s wrong with this pattern? The first problem […]
22 Jan 2017
These days it is common to hear arguments that software development is becoming gig based. In other words, companies will not hire programmers for permanent positions. Instead, they will put together temporary teams of independent contractors from anywhere in the world to complete … Continue reading →
15 Jan 2017
Last month we finished reading “The Effective Engineer” by Edmond Lau in the book club at work. It is a great book full of practical advice on how to get more done as a software developer. In fact, it is one … Continue reading →
22 Dec 2016
In Go, goroutines are cheap to create and efficient to schedule. The Go runtime has been written for programs with tens of thousands of goroutines as the norm, hundreds of thousands are not unexpected. But goroutines do have a finite cost in terms of memory footprint; you cannot create an infinite number of them. Every time you […]
20 Dec 2016
This is a short blog post about my thoughts on using Go in anger through several workplaces, as a developer and an advocate. What is $GOPATH? Back when Go was first announced we used Makefiles to compile Go code. These Makefiles referenced some shared logic stored in the Go distribution. This is where $GOROOT comes from. […]
15 Dec 2016
This post is about declaration scopes and shadowing in Go. package main import "fmt" func f(x int) { for x := 0; x < 10; x++ { fmt.Println(x) } } var x int func main() { var x = 200 f(x) } This program declares x four times. All four are different variables because they exist […]
3 Dec 2016
This is a short blog post to reference the slides from my builderscon 2016 presentation. I had a great time at buildercon, the talks were varied and engaging from a wide selection of Japanese makers. I’m grateful to the builderscon organisers for accepting my talk and inviting me to present at the inaugural builderscon conference in […]
24 Nov 2016
Recently @ThePracticalDev asked people on Twitter for typical things programmers say: Request — what are some examples of funny idioms/phrases software devs use a lot? Things like "It works on my machine" etc. — DEV Community (@ThePracticalDev) November 16, 2016 … Continue reading →
19 Nov 2016
This is a progress report on the Go toolchain improvements during the 1.8 development cycle. Now we’re well into November, the 1.8 development window is closing fast on the few remaining in fly change lists, with the remainder being told to wait until the 1.9 development season opens when Go 1.8 ships in February 2017. […]
5 Nov 2016
Environment variables are declared with the ENV statement and are notated in the Dockerfile either with $VARIABLE_NAME or ${VARIABLE_NAME}. Passing variables at build-time The ENV instruction sets the environment variable to the value. The environment variables set using ENV will persist when a container is run from the resulting image. For example: The Dockerfile allows you to specify arguments […]
27 Oct 2016
In the book club at work, we recently finished reading Release It! by Michael T. Nygard. It is a book I have been meaning to read for a long time, but somehow I never got around to it until now. … Continue reading →
24 Oct 2016
Just so we’re clear, this post is a thought experiment, not any form of commitment to deliver Go 2.0 in any time frame. While I personally believe there will be a Go 2.0 in the future, I’m in no position to influence its creation; hence, this post is mere speculation. Why introduce a new major version […]
17 Sept 2016
Sunday September the 18th marks a month since the Go 1.8 cycle opened officially. I’m passionate about the performance of Go programs, and of the compiler itself. This post is a brief look at the state of play, roughly 1/2 way into the development cycle for Go 1.81. Note: these results are of course preliminary […]
20 Aug 2016
This post is based on the text of my GolangUK keynote delivered on the 18th of August 2016. A recording of the talk is available on YouTube. This post has been translated into Simplified Chinese by Haohao Tian. Thanks Haohao! This post has been translated to Russian by Artem Zinoviev. Thanks Artem! How many Go programmers […]
18 Jul 2016
The package mock-require is useful if you want to mock require statements in Node.js. It has a simple API that allows you to mock anything, from a single exported function to a standard library. Here’s an example: app/config.js app/services/content.js test/services/content_spec.js
26 Jun 2016
gb has been in development for just over a year now. Since the announcement in May 2015 the project has received over 1,600 stars, produced 16 releases, and attracted 41 contributors. Thanks to a committed band of early adopters, gb has grown to be a usable day to day replacement for the go tool. But, there is […]
24 Jun 2016
What do we want? Version management for Go packages! When do we want it? Yesterday! What does everyone want? We want our Go build tool of choice to fetch the latest stable version when you start using the package in your project. We want them to grab security updates and bug fixes automatically, but not upgrade […]
21 Jun 2016
This is a short post to illustrate how I use the inotifywait command as a cheap and cheerful way to run my tests automatically on save. Note: inotify is only available on linux, sorry OS X users. Step 1. Install inotify-tools On Debian/Ubuntu, inotifywait and friends live in the inotify-tools package. % sudo apt-get install […]
16 Jun 2016
In Learning From Your Bugs, I wrote about how I have been keeping track of the most interesting bugs I have come across. I recently reviewed all 194 entries (going back 13 years), to see what lessons I have learned from them. … Continue reading →
12 Jun 2016
A few months ago I gave a presentation on my philosophy for error handling. In the talk I introduced a small errors package designed to support the ideas presented in the talk. This post is an update to my previous blog post which reflects the changes in the errors package as I’ve put it into service […]
18 May 2016
If that title left you feeling a bit indignant, this post is just for you. After consulting with my Nth company running a content site and watching them struggle to design, develop, and maintain their own CMS, I think it's time to admit this: I'm not better than WordPress. None
13 May 2016
or "How I learned to stop worrying and love all browsers the same as long as they came out kinda recently" Time and time again I've seen companies ignore smaller audiences that use their product because those audiences are not the main/target/primary audience. At a recent job they
10 May 2016
This is a quick post to describe how you can use test fixtures, data files on disk, with the Go testing package. Using fixtures with the Go testing package is quite straight forward because of two convenience features built into the go tool. First, when you run go test, for each package in scope, the […]
28 Apr 2016
Bugs are great learning opportunities. So how do we make sure we learn as much as possible from the bugs we fix? A method I have used for more than 13 years now is to write down a short description of … Continue reading →
26 Apr 2016
This post is an extract from my presentation at the recent GoCon spring conference in Tokyo, Japan. Errors are just values I’ve spent a lot of time thinking about the best way to handle errors in Go programs. I really wanted there to be a single way to do error handling, something that we could teach all […]
17 Apr 2016
In my previous post, The Wisdom of Programming Quotes, I called out some quotes that look good on the surface, but turn out to promote the wrong ideas about software development. I have also posted some of my favorite programming qoutes … Continue reading →
16 Apr 2016
This is the first set mixed in nearly 12 years. Working in an open office space means many hours of my day are spent listening to music with headphones on, cranking away at software code. For me, this means listening to music that doesn’t distract from the task of writing and problem solving. This set was designed in the spirit…
11 Apr 2016
What is the value of test driven development? Is the value writing tests at the same time as you write the code? Sure, I like that property. It means that at any time you’re one control-Z away from your tests passing; either revert your test change, or fix the code so the test pass. The nice property of this method…
I love good programming quotes. The best ones say something true about the craft of programming, usually both concisely and humorously. Recently I started following Programming Wisdom on Twitter. It’s been a source of many great quotes, but occasionally I … Continue reading →
7 Apr 2016
This is a thought experiment about sentinel error values in Go. Sentinel errors are bad, they introduce strong source and run time coupling, but are sometimes necessary. io.EOF is one of these sentinel values. Ideally a sentinel value should behave as a constant, that is it should be immutable and fungible. The first problem is […]
2 Apr 2016
This is a progress report on the Go toolchain improvements during the 1.7 development cycle. All measurements were taken using a Thinkpad x220, Core i5-2520M, running Ubuntu 14.04 linux. Faster compilation Since Go 1.5, when the compiler itself was translated from C to Go, compile times are slower than they used to be. Everyone knows it, nobody […]
30 Mar 2016
When you think about it, threads are a strange abstraction. From the programmer’s point of view, threads are great. It’s as if you can create virtual CPUs, on the fly, and the operating system will take care of simulating these virtual CPUs on top of real ones. But on an implementation level, what is a […]
18 Mar 2016
This post is a continuation of a suggestion I made on twitter a few days ago. In Go, for any type T, there exists a type *T which is the result of an expression that takes the address of a variable of type T1. For example: type T struct { a int; b bool } […]
12 Mar 2016
Occasionally I am asked for advice on how to get started contributing to an Open Source project. I thought it may be useful to write down my suggestions. These points were written in the context of the Go programming language, but I think this advice is applicable to the majority of modern Open Source projects. […]
7 Mar 2016
When I graduated from university with a degree in Computer Science, I wanted to continue and get a Ph.D. But I also wanted to work as a software developer, so I worked for five years in industry before going back … Continue reading →
29 Feb 2016
At $DAYJOB I work on a very large Go application; hundreds and hundreds of packages. Recently I’ve been trying to untangle some code that has inadvertently grown huge trunks of dependencies. I suspect this is what is causing the time taken to link our tests to become the subject of ridicule. I’ve tried previously to […]
6 Feb 2016
Sandi Metz’s post on abstraction struck a chord with me recently. I was working with a piece of code which looked like this (in pseudo code): func Start() { const filename = "..." createOuputFile(filename) go run(filename) } It turned out that createOutputFile was written in an obscure way which first caused me to look at […]
18 Jan 2016
To steal a quote from JWZ, Some people, when confronted with a problem, think “I know, I’ll use cgo.” Now they have two problems. Recently the use of cgo came up on the Gophers’ slack channel and I voiced my concerns that using cgo, especially on a project that is intended to showcase Go inside […]
7 Dec 2015
Panic messages from unexpected program crashes are often reported on the Go issue tracker. An overwhelming number of these panics are caused by data races, and an overwhelming number of those reports centre around Go’s built in map type. unexpected fault address 0x0 fatal error: fault [signal 0x7 code=0x80 addr=0x0 pc=0x40873b] goroutine 97699 [running]: runtime.throw(0x17f5cc0, 0x5) […]
What does the computing landscape look like in a decade ? In a word, bifurcated. At the individual level there will be range of battery powered devices; watches, mobile phones, tablets with removable keyboards, and those without. They will be numerous, at a wide range of price points, allowing them to be dedicated to the […]
29 Nov 2015
Introduction The Go runtime, in addition to providing the usual services of garbage collection, goroutine scheduling, timers, network polling and so forth, contains facilities to enable extra debugging output and even alter the behaviour of the runtime itself. These facilities are controlled by environment variables passed to the Go program. This post describes the function of […]
18 Nov 2015
The following program contains a data race package main import ( "fmt" "time" ) type RPC struct { result int done chan struct{} } func (rpc *RPC) compute() { time.Sleep(time.Second) // strenuous computation intensifies rpc.result = 42 close(rpc.done) } func (RPC) version() int { return 1 // never going to need to change this } […]
5 Nov 2015
This is a post inspired by a thread that Nate Finch started on the Go Forum. This post focuses on Go, but if you can see your way past that, I think the ideas presented here are widely applicable. Why no love ? Go’s log package doesn’t have leveled logs, you have to manually add prefixes like […]
29 Oct 2015
Last night at the Sydney Go Users’ meetup, Jason Buberel, product manager for the Go project, gave an excellent presentation on a product manager’s perspective on the Go project. As part of his presentation, Buberel broke down the marketplace for a programming language into seven segments. As a thought experiment, I’ve taken Buberel’s market segments […]
22 Oct 2015
Mention is a real-time monitoring application used to track and analyze trends and e-reputation in a very complete and intuitive way. Co-founded in 2010, it now counts 400,000 users across the world. This impressive growth rate not only implies great marketing talent but also impressive technical achievements. Arnaud le Blanc , Mention’s co-founder and CTO, tells us about how he…
20 Oct 2015
I just finished taking the course Software Security from the University of Maryland via Coursera. It was a relatively easy course (at least if you know C) that gave an overview of the following areas: buffer overflows and other memory attacks, … Continue reading →
15 Oct 2015
This post is a continuation of my previous post on bootstrapping Go 1.5 on the Raspberry Pi. Now that Go 1.5 is written entirely in Go there is a bootstrapping problem — you need Go to build Go. For most people running Windows, Mac or Linux, this isn’t a big issue as the Go project […]
9 Oct 2015
We all know that the empty struct consumes no storage, right ? Here is a curious case where this turns out to not be true. This is a story about trying to speed up the Go compiler. Since Go 1.5 we’ve had the great concurrent GC, which reduces the cost of garbage collection, but no […]
4 Sept 2015
This is a short post to describe my recommended method for building Go on the Raspberry Pi. This method has been tested on the Raspberry Pi 2 Model B (900Mhz, 1Gb ram) and the older Raspberry Pi 1 Model B+ (700Mhz, 512Mb ram). This method will build Go 1.5 into you home directory, $HOME/go. As […]
22 Aug 2015
Now that Go 1.5 is out, lots of gophers are excited to try the much improved cross compilation support. For some background on the changes to the cross compilation story you can read my previous post, or Rakyll’s excellent follow up piece. I’ll assume that you are using the binary version of Go 1.5, as distributed from […]
19 Aug 2015
For the longest time I had this alias in my .bashrc alias gb='go install -v' as an homage to John Asmuth’s gb tool which I was very fond of way back before we had the go tool. Once gb was written, I had to remove that alias and live in a world where I used […]
8 Aug 2015
This article is also available in Japanese, イベントループなしでのハイパフォーマンス – C10K問題へのGoの回答 This article is based on a presentation I gave earlier this year at OSCON. It has been edited for brevity and to address some of the points of feedback I received after the talk. A common refrain when talking about Go is it’s a language […]
2 Jul 2015
This is a short blog post explaining why I believe that Go and Rust are not competitors. Why people think Rust and Go are competitors To explain why I think Rust and Go are not competitors, I want to to lay out the reasons why I think the question is being asked in the first place. Rust […]
8 Jun 2015
A few months ago I introduced gb as a proof of concept to the audience at GDG Berlin. Since then, together with a small band of contributors and an enthusiastic cabal of early adopters, gb has moved from proof of concept, written mostly on trains during a trip through Europe, to something approaching a usable […]
5 Jun 2015
bytes.Buffer is a tremendously useful type, but it’s a bit large1. % sizeof -p bytes Buffer Buffer 112 … and that is just the overhead, we haven’t put any data into the buffer yet. This Friday’s2 challenge is to write a replacement for bytes.Buffer that implements io.ReadWriter and allows the caller to discover the length and capacity of the […]
30 May 2015
I’m going to be speaking at OSCON this year about Go performance. The title of the talk is High performance servers without the event loop and will focus on the features of the language and its runtime that transparently let Go programmers write high performance network servers without resorting to event loops and callback spaghetti. As the […]
22 May 2015
This is a quick Friday blog post to talk about a recent experience I had working on a piece Juju code that needed to capture the data being sent over a net.Conn. Most Gophers know that the net package provides a net.Pipe function which returns a pair of net.Conns representing an in memory network connection. net.Pipe […]
11 May 2015
In April 2015 I gave a presentation to the GDG Berlin meetup group (slides, video) discussing my views on reproducible builds using the Go programming language. As part of that presentation I demonstrated a replacement build tool that I had been developing, gb. From the feedback I received after the meetup it was clear that […]
16 Apr 2015
Here is my list of heuristics and rules of thumb for software development that I have found useful over the years: Development 1. Start small, then extend. Whether creating a new system, or adding a feature to an existing system, I … Continue reading →
7 Mar 2015
This is the text of my closing keynote from Gophercon India. It has been slightly altered for readability from my original speaking notes. I am indebted to the organisers of Gophercon India for inviting me to speak, and to Canonical for giving me the time off to attend the conference. If you want to see me […]
2 Mar 2015
Introduction Cross compilation is one of Go’s headline features. I’ve written about it a few times, and others have taken this work and built better tooling around it. This morning Russ Cox committed this change which resolved the last issue in making cross compilation simpler and more accessible for all Gophers. When Go 1.5 ships […]
26 Feb 2015
I have updated my unofficial ARM tarball distributions page with prebuilt Go 1.4.2 tarballs. You can find them by following the link in the main header of this page. As these were the first tarballs produced since the move to git, please let me know if you encounter any issues.
25 Feb 2015
Over the last year I have had the privilege of travelling to meet Go communities in Japan, Korea and India. In every instance I have met experienced, passionate, pragmatic programmers ready to accept Go for what it can do for them. At the same time the message from each of these communities was the same; […]
25 Jan 2015
In my previous post, I doubled down on my claim that Go’s error handling strategy is, on balance, the best. In this post, I wanted to take this a bit further, and prove that multiple returns and error values are the best, When I say best, I obviously mean, of the set of choices available […]
3 Jan 2015
I finally got around to reading Clean Code by Robert C. Martin (Uncle Bob). It is often high on lists of the best books for software development, and for good reason. Clean Code is an excellent book that all programmers … Continue reading →
1 Jan 2015
I recently finished the Coursera course Computational Investing Part 1 by professor Tucker Balch at Georgia Tech. The focus of the course is on portfolio analysis and selection. Almost all the analysis uses the daily closing prices of stocks as the … Continue reading →
23 Dec 2014
The common contract for functions which return a value of the interface type error, is the caller should not presume anything about the state of the other values returned from that call without first checking the error. In the majority of cases, error values returned from functions should be opaque to the caller. That is […]
15 Dec 2014
What is the half-life of programmer knowledge? It is quite common with claims that the half-life is something like 5 years. In other words, half of what you know about programming will be obsolete in 5 years. A similar sentiment … Continue reading →
13 Dec 2014
I have updated my unofficial ARM tarball distributions page with prebuilt Go 1.4 tarballs. You can find them by following the link in the main header of this page.
11 Dec 2014
In this program, the size of variables of type x and y in memory varies by platform. package main func main() { const n = 4 type x [n]uint type y [n]int } By changing only one line can you ensure that variables of type x, and y always consume 16 bytes on all platforms […]
8 Dec 2014
I’m working on a project that requires Geo proximity search. Basically, what I’m doing is plotting a radius around a point on a map, which is defined by the distance between two points on the map given their latitudes and longitudes. To achieve this I’m using the Haversine formula (spherical trigonometry). This equation is important […]
This week I will give a presentation at a local high school on what it is like to work as a programmer. I am volunteering (through the organization Transfer) to come to schools and talk about what I work with. … Continue reading →
30 Nov 2014
The question of how to set up a new Go project appears commonly on the golang-nuts mailing list. Normally the advice for how to structure Go code centres around “read the standard library”, but the standard library is not a great deal of use to newcomers in the respect as: You don’t go get packages […]
21 Nov 2014
Juju is a pretty large project. Some of our core packages have large complex dependency graphs and this is undesirable because the packages which import those core packages inherit these dependencies raising the spectre of an inadvertent import loop. Reducing the coupling between our core packages has been a side project for some time for me. […]
3 Nov 2014
Revisiting my post about error handling and exceptions, written well before Go hit 1.0, I’m pleased that it stands the test of time. Java has comprehensively demonstrated that checked exceptions (actually having both checked and unchecked exceptions) has been a disaster for the evolution of the language. Checked exceptions have placed a suffocating yoke of backward compatibility on […]
26 Oct 2014
A topic that has weighed on my mind recently is the dichotomy of frameworks vs. libraries in the Go community. Is the prevailing stance against complex frameworks a rejection of this purported labour saving automation, or an enlightened position that has weighed the pro’s and cons and found the costs of a framework based approached outweighs the benefits ? […]
22 Oct 2014
As part of preparing for my dotGo talk I updated a few of my packages to use the functional options pattern. I only had time to show one of those packages on stage, pkg/term. This is a post about one that was left on the cutting room floor. Last year I wrote a simple package […]
16 Oct 2014
What follows is the text of my presentation, Functional options for friendly APIs that I gave at dotGo this year. It has been edited slightly for readability. I want to thank Kelsey Hightower, Bill Kennedy, Jeremy Saenz, and Brian Ketelsen, for their assistance in preparing this talk. I want to begin my talk with a […]
3 Oct 2014
When initialising a variable with a composite literal, Go requires that each line of the composite literal end with a comma, even the last line of your declaration. This is the result of the semicolon rule. Although possibly an unintended consequence, this means that when proposing a one line change, it really is a one line change. The […]
I have updated my unofficial ARM tarball distributions page with prebuilt Go 1.3.3 tarballs. You can find them by following the link in the main header of this page.
28 Sept 2014
Build tags are part of the conditional compilation system provided by the go tool. This is a quick post to discuss using build tags to selectively enable debug printing in a package. This afternoon I merged a contribution to pkg/sftp which improved the packet encoding performance but introduced a bug where some packet types were incorrectly encoded. % […]
4 Sept 2014
A few months ago I came across the article Why Most Unit Testing is Waste by James O Coplien. The title is an accurate description of the contents – James considers most unit tests to be useless. He expands his arguments … Continue reading →
26 Aug 2014
Ruby Version Manager (RVM) is a tool that allows you to install multiple versions of Ruby and have multiple versions of the same interpreter. Very handy for those who have to maintain different applications using different versions of Ruby. To start, download RVM and install the latest stable version of Ruby: $ echo insecure >> […]
17 Aug 2014
This is a post about Go’s built in make and new functions. As Rob Pike noted at Gophercon this year, Go has many ways of initialising variables. Among them is the ability to take the address of a struct literal which leads to serveral ways to do the same thing. s := &SomeStruct{} v := SomeStruct{} […]
3 Aug 2014
This post is about Tinyterm, a silly hack that I presented as a lightning talk at last month’s Sydney Go User group 1. You can find the original slides online at talks.golang.org. This talk is about a experiment to see if I could drive I2C devices from Go through my laptop’s VGA port. It was […]
11 Jul 2014
Update this post is also available in Japanese. This is a post about an experimental tool that I have been working on. gcvis is a simple way of visualising the operation of the garbage collector within a Go process. Here is a screenshot of it in operation. The rest of this article explores how gcvis […]
8 Jul 2014
I have updated my unofficial ARM tarball distributions page with prebuilt Go 1.3 tarballs. You can find them by following the link in the main header of this page.
30 Jun 2014
What makes a good programmer? It’s an interesting question to ask yourself. It makes you reflect on the craft of software development. It is also a good question to ask your colleagues. It can trigger some interesting discussions on how you work … Continue reading →
27 Jun 2014
This is a post about data races. The code for this post lives on Github, github.com/davecheney/benandjerry. The example program simulates two Ice cream makers, Ben and Jerry, who greet their customers randomly. package main import "fmt" type IceCreamMaker interface { // Hello greets a customer Hello() } type Ben struct { name string } func (b *Ben) […]
22 Jun 2014
Three months ago I changed jobs, and in the process switched from Java to Python. Here are the differences that have stood out for me since making the switch. I have previously worked a bit in Ruby, but I had no … Continue reading →
8 Jun 2014
Is software antifragile? I think so. I recently finished the book Antifragile – Things that Gain from Disorder by Nassim Nicholas Taleb. I liked it a lot, and I think the ideas in it are quite useful when examining various systems and … Continue reading →
7 Jun 2014
Anthony Starks has remixed my original Google Present based slides using his fantastic Deck presentation tool. You can check out his remix over on his blog, mindchunk.blogspot.com.au/2014/06/remixing-with-deck. I was recently invited to give a talk at Gocon, a fantastic Go conference held semi-annually in Tokyo, Japan. Gocon 2014 was an entirely community-run one day event combining […]
4 Jun 2014
For packages go build builds your package then discards the results. go install builds then installs the package in your $GOPATH/pkg directory. For commands go build builds the command and leaves the result the current working directory. go install builds the command in a temporary directory then moves it to $GOPATH/bin. If you liked this […]
24 May 2014
Go has several ways to declare a variable. Possibly there are more ways than are strictly required but with the Go 1 contract in effect it’s not going to change. This short post gives examples of how I decide which variable declaration syntax to use. These are just suggestions, they make sense to me, but […]
22 May 2014
Go obtains much of its compilation speed from the Plan 9 compiler, of which it is a direct descendant. The Plan 9 toolchain deferred much of the work traditionally performed by a compiler to the linking stage and its performance was summarised in section 8 of this paper The new compilers compile quickly, load slowly, […]
19 May 2014
This is a quick post to discuss an interesting bug that was recently unearthed by go vet. The following code is a simplified reduction of a larger piece of code. In the original code the if statement was much larger, encompassing several complicated conditions, making the bug hard to spot visually. package main import "fmt" […]
9 May 2014
I have updated my unofficial ARM tarball distributions page with prebuilt Go 1.2.2 and Go 1.3beta1 tarballs. You can find them by following the link in the main header of this page.
7 May 2014
I have several projects on the hop at the moment which require control over a serial port, actually a serial port emulated over USB. So for the last few days I’ve let myself be distracted by writing yet another serial package for Go. github.com/pkg/term term is built on a lower level package, called termios which provides […]
4 May 2014
Now that go1.3beta1 has been released I’ve updated the autobench-next branch to track Go 1.2 vs tip (go1.3beta1). Using autobench is very simple, clone the repository and run make to produce a benchmark on your machine. % cd devel % git clone -b autobench-next https://github.com/davecheney/autobench.git % cd autobench % make You can stay up to date with […]
20 Apr 2014
Introduction This post presents one technique for installing and using multiple versions of Go on a machine. This is a technique I use often as we have standardised on Go 1.2.1 for developing Juju, but develop on the tip of Go itself. You may find this technique useful for do comparisons between various Go versions for […]
29 Mar 2014
This post is a follow up to Friday’s post on comments in Go. Keith Rarick and Nate Finch pointed out that I had neglected to include two important practical use cases. Build tags I’ve previously written about how to use // +build tags to perform conditional compilation. In light of the previous post it’s probably […]
28 Mar 2014
This is a quick post to discuss the rules of comments in Go. To quickly recap, Go comments come in two forms // everything from the double slash to the end of line is a comment /* everything from the opening slash star, to the closing one is a comment */ As the first form […]
24 Mar 2014
Introduction This post explores the properties of my favourite Go data type, the empty struct. The empty struct is a struct type that has no fields. Here are a few examples in named and anonymous forms type Q struct{} var q struct{} So, if an empty struct contains no fields, contains no data, what use […]
22 Mar 2014
It has been roughly six months since I wrote about the problems I saw with package management in Go. In the intervening months there has been lots of discussion; the issue continues to be one of the two most continually and hotly debated on the golang-nuts and go-pm mailing lists. No prizes for guessing what […]
19 Mar 2014
Most new Go programmers quickly grasp the idea of a channel as a queue of values and are comfortable with the notion that channel operations may block when full or empty. This post explores four of the less common properties of channels: A send to a nil channel blocks forever A receive from a nil […]
16 Mar 2014
This blog post was originally a comment on a Google Plus page, but apparently one cannot create a href to a comment so it was suggested I rewrite it as a blog post. Go pointers, like C pointers, are values that, uh, point to other values. This is a tremendously important concept and shouldn’t be […]
12 Mar 2014
Patterns 34:29 As Turing descended from Mount Compute – with the two iPads of the testimony in his hands as he descended the mountain – he did not realize that the skin of his blog shone as a result of his Compiling the Code. Patterns 35:1 Turing assembled the entire Geek community and said to … Continue reading The 10…
8 Mar 2014
In addition to developing avr11, a software simulation of a PDP-11/40, I also wrote a Go version of the simulator. I recently had an opportunity to talk about the Go based version at the Sydney and Melbourne Go meetups. The link to the slides are Sydney Melbourne The code itself is not really ready for […]
30 Jan 2014
This is a post about the performance of my avr11 simulator. Specifically about the performance improvements I’ve made since my first post, and the surprises I’ve encountered during the process. Old school profiling Because avr11 runs directly on the Atmega 2560 microcontroller, there is no simple way to measure the performance of various pieces of […]
25 Jan 2014
In my previous post I had figured out that I could capture memory accesses in my simulator and send them elsewhere. In version 1 of the design I (ab)used the onboard mini SD card to simulate the entire address space. This was a very 1950’s solution and came with matching performance. Still, it did give […]
24 Jan 2014
18 bits of core memory In Schmidt’s original javascript simulator, and my port to Go, the 128 kilowords (256 kilobytes) of memory connected to the PDP-11 is modeled using an array. This is a very common technique as most simulators execute on machines that have many more resources than the machines they impersonate. However, when I […]
23 Jan 2014
Introduction It all started with Javascript. In April of 2011 Julius Schmidt wrote a PDP-11 emulator that ran in a browser. I thought that this was one of the most amazing thing I had ever seen. Late last year I ran across the link again in my Pocket backlog and spent a little time poking […]
21 Jan 2014
With one exception, the go command takes arguments in the form of packages. You can pass the package name(s) explicitly, eg. go test github.com/hoisie/mustache or implicitly cd $GOPATH/src/github.com/hoisie/mustache go test . By default, if no arguments are provided go test treats the current directory as a package, so in the second example, go test . […]
28 Dec 2013
I have updated my unofficial ARM tarball distributions page with prebuilt Go 1.2 tarballs. You can find them by following the link in the main header of this page. If you are interested in the potential performance improvements in Go 1.2, I wrote a post about it on the Gopher Academy blog as part of this year’s Go Advent […]
8 Dec 2013
Many programmers have a hard time writing good unit-tests for code that involves time. For example, how do you test time-outs, or periodic clean-up jobs? I have seen many tests that create elaborate set-ups with lots of dependencies, or introduce … Continue reading →
2 Dec 2013
If you’re interested in the performance improvements delivered in Go 1.2, I’ve written about it as part of this years Go Advent project. You can find the post on the Gopher Academy blog, blog.gopheracademy.com/day-02-go-1.2-performance-improvements.
20 Nov 2013
Over the last few weeks I had the opportunity of working with the Joyent folks on the port of Go to Solaris1. As part of this work I noted that the Joyeurs were using their rather spiffy Manta service for sharing code snippets and build logs. This made the rest of us using Pastebin services […]
19 Nov 2013
I’ve been doing a lot of work with gccgo recently and with the upcoming release of Go 1.2 I’ve also been collecting benchmark results for that release. Presented below, using a very unscientific method, are the results of comparing the go1 benchmark results for the two compilers. Buried among that see of red are a few […]
15 Nov 2013
At Canonical we’re increasingly invested in gccgo. While testing various packages built with gccgo we ran across test failures which we traced to an innocent looking piece of code. package main import "fmt" type T struct { i int } func (t *T) readInt32() int32 { t.i += 4 return 42 // not important } […]
14 Nov 2013
In a previous post I blogged about the cover tool coming in Go 1.2 and a bash helper function I use to make the tool a little easier to use. Since then I’ve extended these helpers so I wanted to blog about the improvements. Passing arguments to the testing tool cover () { t=$(tempfile) go […]
13 Nov 2013
This is a brief post highlighting a curious aspect of the declaration syntax in Go. Most Go programmers know that the following of import declarations are equivalent import "fmt" import "math/big" // same as import ( "fmt" "math/big" ) The same applies to const declarations const FORTYTWO = 42 const TRUE = 1 // same […]
7 Nov 2013
A few days ago I was working on an example program for the sftp package and found I needed to implement subcommand handling. https://twitter.com/davecheney/status/397686194462396416 The response was fantastic, no less than 12 different packages. I haven’t had the chance to review any of the packages in detail, but I wanted to list them here as […]
4 Nov 2013
With the release of go1.2rc3 last week I have now merged the autobench-next branch into master in the autobench repository. Go 1.2 is not expected to bring performance improvements of the same magnitude of Go 1.1, but moderate improvements are expected due to improvements in code generation, the runtime, the garbage collector, and the standard […]
15 Oct 2013
This post explains how the Go build process works using examples from Go’s standard library. The gc toolchain This article focuses on the gc toolchain. The gc toolchain takes its name for the Go compiler frontend, cmd/gc, and is mainly used to distinguish it from the gccgo toolchain. When people talk about the Go compilers, they […]
10 Oct 2013
One of the stated goals of Go was to provide a language which could be built without Makefiles or other kinds of external configuration. This was realised with the release of Go 1, and the go tool which incorporated an earlier tool, goinstall, as the go get subcommand. go get uses a cute convention of embedding the […]
7 Oct 2013
Did you know that Go 1.2 will ship with a built in test coverage tool ? The tool is integrated into go test and works similarly to the profiling tool, producing an output file which is interpreted by a second command. If you have Go 1.2rc2 or tip installed, you can use this short shell […]
21 Sept 2013
Go 1.2 is on target for a December release and the Go team have just cut their first release candidate. You can find the draft (no twitterverse, Go 1.2 isn’t released yet) release notes for Go 1.2 online here. I have updated my unofficial ARM tarball distributions page with prebuilt go1.2rc1 tarballs. You can find them by following the link…
18 Sept 2013
I have updated my unofficial ARM tarball distributions to Go version 1.1.2. You can find them by following the link in the main header of this page.
9 Sept 2013
The port of Juju to Go is a project I’ve been involved in at Canonical for some time now. The power behind Juju is charms, which are part configuration management and part reliable workflow engine. One non-conventional use of Juju is something I cooked up a while ago when traveling, a Juju charm that compiles […]
7 Sept 2013
It looks like Go 1.4 will remove support for Go packages containing C code (as described below, don’t confuse this with CGO), so enjoy it while it lasts. This is a short post designed to illustrate how Go package authors can write package level functions in C and call them from Go code without using […]
4 Sept 2013
A few days ago a post entitled Autoworkers of Our Generation floated across my radar. In his post, Greg Baugues argues that as developers, we have a short term advantage, and would do well to view our lot as a temporary anomaly. In this article I’d like to engage with his post, and respond. The key […]
31 Aug 2013
A lot of code I come across consists of relatively few, but long, methods. The code does what it is supposed to do. However, it could be improved a lot. Refactoring to use more methods can produce better structured programs … Continue reading →
26 Aug 2013
Earlier this year I wrote a small harness to compare the relative performance of Go 1.0 and the then just released Go 1.1. You can read the posts about the Go 1.1 performance improvements: amd64, 386 and arm. As the Go 1.2 cycle is entering feature freeze next week, I’ve taken the opportunity to create a […]
16 Aug 2013
Regardless of the development process that you use, a description of the software architecture can be essential for any project, big or small. If software architecture is about the structure of a system and is the vehicle for satisfying the requirements, then the software architecture document is a written description of this. The Software Architecture […]
8 Jul 2013
This post is a compliment to one I wrote in August of last year, updating it for Go 1.1. Since last year tools such as goxc have appeared which go a beyond a simple shell wrapper to provide a complete build and distribution solution. Introduction Go provides excellent support for producing binaries for foreign platforms […]
7 Jul 2013
This package has been superseded. Please read this blog post for more details. Introduction The Go runtime has built in support for several types of profiling that can be used to inspect the performance of your programs. A common way to leverage this support is via the testing package, but if you want to profile […]
2 Jul 2013
This evening I rebuilt my unofficial ARM tarball distributions to Go version 1.1.1. You can find them by following the link in the main header of this page.
30 Jun 2013
This post continues a series on the testing package I started a few weeks back. You can read the previous article on writing table driven tests here. You can find the code mentioned below in the https://github.com/davecheney/fib repository. Introduction The Go testing package contains a benchmarking facility that can be used to examine the performance […]
5 May 2013
All programs need some form of logging built in to them, so we can observe what it is doing. This is especially important when things go wrong. One of the differences between a great programmer and a bad programmer is … Continue reading →
26 Mar 2013
I got an e-mail last week from three students at Halmstad University doing a three month project on what programmers want in a job, and how companies can attract talented programmers. Here are my answers to their questions, in order … Continue reading →
18 Feb 2013
I recently finished the Coursera course Algorithms: Design and Analysis, Part 2 by Professor Tim Roughgarden of Stanford. I’ve already reviewed part 1, and here are my thoughts on the second part. The main theme of part 1 was the divide … Continue reading →
12 Dec 2012
I recently gave a presentation on what it is like to work as a software developer to first-year engineering students at KTH taking an introductory programming course. I wanted to give my view on the main differences between professional software … Continue reading →
21 Oct 2012
Every once in a while I read something along the lines of: “most developers just want to write new features, they don’t want to work with maintenance and bug-fixing”. If that’s true, then most developers are missing out on the fun … Continue reading →
22 Aug 2012
Even though more than 20 years have passed, I still remember wondering what it would be like to finish university and start working. Up until that point, I had pretty much spent my whole life in school, with only a … Continue reading →
17 Jun 2012
For seven years I coded in C++ using Emacs. Four years ago, when I changed jobs, I switched to Java development using IntelliJ IDEA. Without a doubt, I am much more productive writing code in IntelliJ IDEA compared to using … Continue reading →
2 Jun 2012
I love coding. Ever since I bought my first computer (a VIC-20), I’ve been fascinated by computer programming. For many years I never thought of why I enjoyed it so much – I just knew I did. But that changed when … Continue reading →
8 May 2012
I recently finnished the Coursera course Design and Analysis of Algorithms I, given by Professor Tim Roughgarden of Stanford. This was my second on-line course from Coursera (last fall I took Introduction to Databases, which I wrote about here), and … Continue reading →
25 Feb 2012
Here are a few programming quotes I like: “A complex system that works is invariably found to have evolved from a simple system that worked.” John Gall “Enlightened trial and error outperforms the planning of flawless intellects.” David Kelley “It’s … Continue reading →
30 Sept 2011
The tabulated simulation results. Total games played=10000000, total rounds=259722851, took 7204 seconds. Games that never needed 15 cards on the table: 3124823 (31.2 percent of all games). Games where no cards remain on the table at the end: 118583 (1.2 … Continue reading →
The tabulated simulation results. Total games played=10000000, total rounds=259703553, took 6916 seconds. Games that never needed 15 cards on the table: 3141851 (31.4 percent of all games). Games where no cards remain on the table at the end: 121973 (1.2 … Continue reading →
The tabulated simulation results. Total games played=10000000, total rounds=259143969, took 6919 seconds. Games that never needed 15 cards on the table: 3301418 (33.0 percent of all games). Games where no cards remain on the table at the end: 151438 (1.5 … Continue reading →
In Peter Norvig’s interesting post The Odds of Finding a Set in The Card Game SET, he concludes that the odds against there being no set in 12 cards, during a game, is 16:1. This is an average value, but it … Continue reading →
22 Mar 2010
Most ORMs support the concept of dynamic finders. A dynamic finder looks like a normal method invocation, but the method itself doesn’t exist, instead, it’s generated dynamically and processed via another method at runtime. A good example of this is Ruby. When you invoke a method that doesn’t exist, it raises a NoMethodError exception, unless […]