Programming Leftovers
-
Linux Handbook ☛ Convert String to Bytes in Go
This simple tutorial shows you two ways of converting a string into bytes in golang with practical but simple examples.
-
Barry Hess ☛ Find Bugs Once and the Joy of Bug Fixing
Where does this evolution come from? Experience. The bit starts flipping the first time you see a bug you fixed in the past reappear for a second time. Then you become 80% confident that bug fixes should arrive with tests. You become 90% confident when you see a bug fix someone else committed appear a second time because the fix went through with no tests. You become a rabid 100% adherent when you see a bug fix you reviewed appear a second time because no tests were written even though you insisted there should be tests. It might take years to get to the 100% state, but all good pragmatic practitioners of programming get there eventually.
My advice to a young programmer is to embrace the experience of battle-tested peers. Our craft is relatively young, but remember people have still been doing it a long time. I recently read The Pragmatic Programmer. As a professional programmer for nearly 15 years, it read a bit like Aristotle; almost entirely obvious. It’s not obvious when you first start programming, though! Read this book.
-
Ben Tsai ☛ For Good Measure
A corollary to Goodhart’s law is, when you define a target, folks are going to game the system to meet that target. Usually, it is not with malicious intent. In this bug bounty case, the testers are going to naturally look for and file bugs to maximize the number.
I saw an example of this today while triaging bugs. Someone reported a bug where column resizing in a table was not working. I went to the next bug in my queue—same behavior, but a different table on the same page. We have a lot of tables in our application, and the next dozen bugs were all referencing the same behavior, albeit on different tables.
-
Lewis Dale ☛ Learning Go: Day Three
Over the last two days I’ve learned how to setup and create a Go project, and then how to organise code into packages. I realise I’ve skipped a crucial step there, though, which is learning how to deal with control structures.
By control structures, I’m referring to things like for- loops, if statements, etc. You know, the things that make the software do things beyond just multiplying 2 by 5.
-
Ted Unangst ☛ go module bloat
For some of the software I write, I try to make occasional releases, and for the go software I vendor the dependencies so it’s all there. I was just reminded that I hadn’t made a release of something in five years, so I reran my release script, and ended up with a tarball that was 10x bigger than the previous one. Some terrible choices have been made.
-
Standards/Consortia
-
Dan Q ☛ link rel=”blogroll”
Dave Winer kindly let me know about a proposed standard for linking to OPML blogrolls. Given that I added a page containing my blogroll last year, it was easy enough for me to add a tiny bit of code to the header to add support for automatic detection of my blogroll.
-