←
John McBride7,792 posts
John McBride avatar

John McBride

@johncodes

🌊 | Co-founder, CTO @papercompute | 🎤 Hosting @opensourceready | 🐹 maintaining spf13/cobra

◷ Joined October 2018▧ 913 Photos and videos
John McBride avatar
⟳ John McBride retweeted
John McBride@johncodes·Nov 16

Here's a fun bit of Go trivia for y'all which I believe perfectly demonstrates how, despite the absolute power of AI, it still codes like a over-eager-junior engineer straight out of CS 201 writing completely unmaintainable code. This was generated with GPT 6.1-sol while working on some experimental flag stuff akin to spf13/pflag: A "Count" type is defined like so: ``` // Count is an integer flag that increments 1 // when used without an argument. // With an argument, increments that amount. type Count int ``` And in the following "Set" method, a "+1" sentinel increments the counter flag (this is basically straight out of spf13/pflag) ``` // Set increments the count for "+1" // or sets it to the parsed integer. func (c *Count) Set(s string) error { if s == "+1" { if *c == Count(int(^uint(0)>>1)) { return fmt.Errorf("count overflows int") } *c++ return nil } value, err := strconv.ParseInt(s, 0, strconv.IntSize) if err == nil { *c = Count(value) } return err } ``` This path guards integer overflow and immediately made me raise an eyebrow: ``` if *c == Count(int(^uint(0)>>1)) ``` Step by step: by taking a zero value uint, flipping all its bits to 1, shifting it to the right by 1 (effectively removing the signing bit), then casting it to a Count, finally checking if it's equal to the current count -- we can effectively check if the count is at the given system's maximum signed int value and should error to prevent an overflow. On a 64 bit system, this is 2^63−1 (a massive number). ... this is all good except the agent completely ignored Go's "math.MaxInt" (I wouldn't even consider this "modern Go" since it's been around since Go 1.17) -- the complexity can be drastically reduced by simply doing: ``` if *c == math.MaxInt ``` This compiles without a "Count(...)" cast since, under the hood, this is an untyped const in the math package (essentially exactly what this std lib const is for). The complexity in understanding a one liner bit shift vs. just using the standard library cannot be over stated: even for agents, I'd argue that this exits the domain of "easy to maintain with agents" and would require lots and lots of resources (on the GPT 5.x tokenizer, the first implementation is 13 tokens and the second is 7 !!! ) Software engineering has always been about correctly combating and harnessing complexity in language, semantics, abstraction, construction, and creative expression. Using LLM tools did not change that and there's a very compelling argument to be made for beautiful, elegant, and correct code that enables BOTH the engineer and the tools to work better.

Heavybit avatar
⟳ John McBride retweeted
Heavybit@heavybit·17h

On episode 46 of @opensourceready, Brian Douglas (@bdougieYO) and John McBride (@johncodes) speak with JT Archie. He introduces Steps, his local-first workflow tool for combining predictable automation with AI agents. They discuss why agents shouldn’t improvise routine operations, where AI fits into software maintenance, and what software factories still need from human engineers. hubs.ly/Q04F3Nh90

0:32
mattn avatar
⟳ John McBride retweeted
mattn@mattn_jp·Nov 16

Go 1.28 では、型が文脈から分かる場合、複合リテラルの型を省略できるようになります。 #golang var p Point = {1, 2} var ptr *Point = {1, 2} 2015年に提案された issue が、11年越しにクローズされました。 github.com/golang/go/issues/…

CMU Kenneth C. Griffin School of Computer Science avatar
⟳ John McBride retweeted
CMU Kenneth C. Griffin School of Computer Science@GriffinCMU·Nov 16

We're proud to announce the launch of CS Learn, a new online learning platform that offers free access to select courses from Carnegie Mellon University’s top-ranked computer science program. Check out the course offerings: bit.ly/4C4770z

John McBride avatar
John McBride@johncodes·Nov 13

Did you know that since Fedora 44, there's a native dnf Nix package and it can very easily be installed? ``` sudo dnf install nix sudo systemctl enable --now nix-daemon ``` and that's it: no nasty community Nix installer, no manual disk tweaking or symlinking, just deterministic, reproducible builds as God intended. Today, I run Fedora with this setup and a ~/.config/ flake that basically builds my whole system. It's the stability of Fedora with the ergonomics/determinism of a Nix flake!

Everything I do after a fresh Fedora 44 install, from DNF tweaks and RPM Fusion to NVIDIA drivers and Docker, plus the release-day gotchas I hit. techhut.tv/fedora-44-post-in…

Post attachment
David Cramer avatar
⟳ John McBride retweeted
David Cramer@zeeg·Nov 11

this is not a kpi people. its not a flex. 7000 PRs that you havent read adds no value, adds risk, and lacks intent like what are you trying to prove? that you dont care about your software?

coderabbit is goated. 👇this engineer hit about 7,000 PRs/month last month 👇

John McBride avatar
John McBride@johncodes·Nov 11

Hard-skills in software engineering are cratering, compacting, and changing: it should come as no surprise that the Google SRE book, which was the bible to many practitioners in the industry, required a complete re-write in the agent era. BUT. I do believe that now, more than ever, first principles thinking matter: the real question is "how do you develop a first principles mindset?" when you're not hands on with code and infrastructure and operations daily

SRE has changed a lot in 10 years. We're kicking off a special 2-part series with the minds behind "Site Reliability Engineering, 2nd Edition"! 📖 Tune into Part 1 (Season 7, Episode 5) now! 🎧 sre.google/prodcast/#season7… google.smh.re/5ikY

Ayaan 🐧 avatar
⟳ John McBride retweeted
Ayaan 🐧@twtayaan·Nov 9

Cloud native is a hell of a drug

Post attachment
John McBride avatar
John McBride@johncodes·Nov 8

Many of you saying the GPL “is anti-open source” need to wake up and take a history lesson: the GPL is maybe the greatest gift Stallman could have bestowed onto a free (as in freedom) society. Copy left prevents entities from taking open and free code, close sourcing it, and building proprietary software ontop of it. Copy left compels those entities selling/distributing products with GPL bits to also open source their code under GPL. Linux has been GPL for 30+ years and has led to an explosion in open and free distros, innovations, and cross-industry collaboration. MIT and Apache are free but have near zero restrictions: one could argue that code that is simple available to lift and shift is not free, it is pillageable. I commend the Asahi maintainers for making the difficult re-licensing decision which aligns their project much closer to how Linux distros are typically licensed. I commend them for standing up to bad actors laundering their code through LLMs, and obfuscating their work.

cody avatar
⟳ John McBride retweeted
cody@codycollier·Nov 6

88x31.gif

0:36