Skip to content
EN

Back to the catalog

blog.carlana.net
jsonAmerican English

The Ethically-Trained Programmer

blog.carlana.net · American English

“It should be noted that no ethically-trained software engineer would ever consent to write a `DestroyBaghdad` procedure. Basic professional ethics would instead require him to write a `DestroyCity` procedure, to which Baghdad could be given as a parameter.” — [Nathaniel Borenstein](http://www.guppylake.com/pithy.html), 1992

json

Open the feed

https://blog.carlana.net/feed.json

Last post
Feb 24, 2025
Posts in 24 h · 7 days · 30 days
0 · 0 · 0
Our last check
Answering
Served from
Brazil
Text score at discovery
9,940
Format
json

Posts

What our queue read from this feed. Open one to read it here, or go to the site that published it.

  1. What’s New in Go 1.24?
    Feb 24, 2025 · original
    I was on episode 6 of the new Fallthrough podcast , talking about What s New in Go 1.24. Check it out !
  2. What’s new in Go 1.23? Podcast
    Jul 31, 2024 · original
    I was on episode 325 of the Go Time podcast , talking about What s New in Go 1.23. Check it out !
  3. What’s New in Go 1.23: Iterators and reflect.Value.Seq
    Jul 29, 2024 · original
    The Go 1.23 release candidates are out. That means it s time for another entry in the What s New in Go series where I talk about my contribution to this release. For Go 1.23, I proposed (but did not implement) four new methods: reflect.Value.Seq , reflect.Value.Seq2 , reflect.Type.CanSeq , and reflect.Type.CanSeq2 . So, where do they come from and what do they do? If you ve been following what s new in Go 1.23 at all, you ve probably heard about new generic custom iteration functions. The signature for writing these iterators is a little tricky, but how you use them is simple. Here s an example : // counter counts up from zero func counter () iter . Seq [ int ] { // let's omit this for now } func main () { for n := range counter () { if n 5 { break } fmt . Println ( n ) } } The output is what you would expect: 0 1 2 3 4 5 If using a custom iterator is simple, how do you implement it? Fir
  4. Five Years Running a News Site on JAMStack
    May 30, 2024 · original
    I started working as the Director of Technology at Spotlight PA the Tuesday after Memorial Day, 2019, over five years ago. There have been a lot of changes in technology, journalism, and the world since then, not least of which was the COVID-19 pandemic. I thought this anniversary would be a good opportunity to look back and take stock of what went well, what went poorly, what I think would have been the best choice I could have made at the time, and what choices I would make if I had it to do again now. I’m planning to write this as a four part series with the first part focused on the broad strokes history of Spotlight PA’s technical architecture and later parts drilling down on specific practices, services, and technologies. “Five Years Running a News Site on JAMStack” has also been accepted by SRCCON 2024 as a session. I don’t believe the session will be recorded, so if you read this
  5. What’s New in Go 1.22: cmp.Or
    Apr 22, 2024 · original
    Go 1.22 has been released for a couple of months as of this writing. It’s long past time to wrap up my series on what I worked on for 1.22 . Sorry for the long delay, I’ve been busy with life stuff. Be sure to catch up on my posts about reflect.TypeFor and slices.Concat if you missed those. The final function I proposed and implemented for Go 1.22 is cmp.Or . On Go Time , I called it “the hidden gem of 1.22”. It’s a simple function with a lot of potential uses and a surprisingly long backstory. First let’s take a look at the code: // Or returns the first of its arguments that is not equal to the zero value. // If no argument is non-zero, it returns the zero value. func Or [ T comparable ]( vals ... T ) T { var zero T for _ , val := range vals { if val != zero { return val } } return zero } As is usual for my contributions to Go, it’s very short and simple. It just compares its arguments
  6. What’s new in Go 1.22? Podcast
    Feb 8, 2024 · original
    I was on episode 302 of the Go Time podcast , talking about What s New in Go 1.22. Check it out !
  7. What’s New in Go 1.22: slices.Concat
    Jan 29, 2024 · original
    We’re up to the second release candidate for Go 1.22, which should be released quite soon. In my last blog post, I wrote about my work on reflect.TypeFor for Go 1.22. This time, I’ll be writing about how I proposed and implemented slices.Concat . Here is the signature for slices.Concat : // Concat returns a new slice concatenating the passed in slices. func Concat [ S ~[] E , E any ]( slices ... S ) S It s a pretty straightforward function to have in a generic slices library, and in fact, I proposed it way back in May of 2021. In the subsequent discussion of what to add to the slices package, it got a soft rejection , Resolved: decided not to add Concat in the initial set. We can always reconsider if there is significant evidence. For context, the slices package itself was not added to the Go standard library until Go 1.21 . Before then, it was only available in a preview form as the ext
  8. What’s New in Go 1.22: reflect.TypeFor
    Jan 15, 2024 · original
    The first release candidate for Go 1.22 is out , which means it’s almost time for the final release and it is time for me to blog about what I worked on this cycle . As usual, my contributions were small, but they were mine, so I’m going to talk about them from a behind-the-scenes perspective. First up is reflect.TypeFor . Here is the entire function: // TypeFor returns the [Type] that represents the type argument T. func TypeFor [ T any ]() Type { return TypeOf (( * T )( nil )). Elem () } Pretty simple ! The test code was about ten times longer than the actual function itself. The use of this function is when you want to create a reflect.Type object for a certain type, like var intType = reflect.TypeFor[int]() or var errorType = reflect.TypeFor[error]() . The proposal to add this to the reflect package was opened by Josh Bleecher Snyder . It marks yet another step in the ongoing march o
  9. Alternate Futures for “Web Components”
    Dec 22, 2023 · original
    It seems like Web Components are always just on the cusp of finally catching on. They’re like the year of Linux on the desktop for frontend nerds. I keep reading the latest articles about Web Components as they bubble up on my social media feeds, just hoping that there is something that I missed out on and now they have more substance, but I always end up feeling disappointed. I wrote up my thoughts on Web Components back in 2020 , and it doesn’t feel like the conversation has progressed in all that time. It’s like an Eternal September with people constantly going back to the original promise of Web Components, in spite of the reality having long since shown itself to have fallen short. What went wrong To TL;DR my earlier piece: The pitch is “get semantic elements from across the web ! ” But those are wrong problems to try to solve. Custom elements aren’t “semantic” because search engine
  10. XML is better than YAML. Hear me out…
    Sep 21, 2023 · original
    They turned my unpopular opinion from Go Time 289 into a standalone blog post. Check it out !
  11. What’s new in Go 1.21? Podcast
    Aug 31, 2023 · original
    I was on episode 289 of the Go Time podcast , talking about What s New in Go 1.21. Check it out !
  12. What I worked on for Go 1.21
    Aug 10, 2023 · original
    Go 1.21 has been released ! For past releases, I wrote up my notes on what’s new in Go 1.18 ( part 1 , part 2 ), 1.19 , and 1.20 ( part 1 , part 2 , part 3 ), but I thought I would sit this round of blogging out, in part because there have been some good roundups of what’s new elsewhere already, and in part because I’ve been on family vacation until recently and haven’t had time to write much. However, I didn’t want to let 1.21 go totally by without talking about what I contributed, because if I don’t talk up my own contributions, who else will? The background to the first thing I worked on is that @fnxpt on Github proposed adding a variation on flag.Func to the flag package that would work even without an argument. To review, the flag package parses command line flags, like myprogram -verbose -input file.txt -output out.txt . Some flags have arguments (like -input file.txt or -output ou
  13. Ten Years of “Go: The Good, the Bad, and the Meh”
    Jul 18, 2023 · original
    Ten years ago, I wrote Go: The Good, the Bad, and the Meh . Way back in 2013, it made it to the front page of Hacker News and got over 400 comments on /r/programming . I don t have analytics from back then, but I suspect it s one of my more discussed pieces of writing, and it was definitely one of my first experiences of getting a lot of feedback for my writing. (Then again, I don t have any evidence of whether John Carmack read it , so maybe it s not the one for my obituary.) Anyway, it’s been a decade, and in that time I’ve gone from playing around with Go as an amateur to being a professional programmer and using Go as one of my core languages. So, I thought it would be fun to look back at what I got right, what’s changed since I wrote it, what I missed, and what I got wrong. Feel free to read or re-read the original post , or just stick to my reflections here without digging back int
  14. How to include Git version information in Go
    May 24, 2023 · original
    TL;DR: Just import github.com/carlmjohnson/versioninfo and use versioninfo.Revision to automatically include a Git hash in your Go application. Curious how it works? Want to make your own version info package? Read on. In previous blog posts, I’ve written about how you can include revision information like a Git revision hash in a Go binary by using linker flags and //go:generate or //go:embed . Those approaches worked, but they required extra manual steps outside of the normal go build or go install commands. Back in 2020, Brad Fitzpatrick opened an issue to automatically include version control information in Go binaries. He wrote, Currently many projects do this by hand with a build-program.sh and stamping it manually with --ldflags=-X foo=bar , but that means programs built the normal Go way lack that information, and people end up with non-portable (shell, often) build scripts. I ve
  15. The bits of Go we avoid (and why) Podcast
    Mar 17, 2023 · original
    I was on episode 269 of the Go Time podcast , talking about the bits of Go we avoid (and why). Check it out !

Discovered by the rss-feed-index crawler, which checks each feed at most once a month.

Same record as JSON: https://api.agentalog.com/api/feeds/fd_blog_carlana_net_e2cd20aa6a55efb4. More from this site: blog.carlana.net in the Feeds tab.