×

Structured logs are great… until you actually have to read them in dev by General_Apartment582 in golang

[–]ynotvim 0 points1 point  (0 children)

There are a bunch of slog handlers or formatters for human reading. Even if we don't need more, it's a fun little probject to write. I learned a lot about slog (and Go) by writing one. Mine makes the output look like this:

 INFO | Request processed | sku=24A2 branch=manhattan time="2023-04-02T10:50.09 EDT"
ERROR | Connection failed | time=2024-01-23T17:14:03Z

There's also a popular one that adds color: https://github.com/lmittmann/tint.

v2: Bubble Tea, Bubbles, and Lip Gloss by meowgorithm in golang

[–]ynotvim 24 points25 points  (0 children)

For details as well as upgrade guides for humans and LLMs see...

I'm not criticizing in any way, but to me it's still weird to think of things this way. I'm sure it's the future (LLMs writing code, and then writing docs and READMEs for other code to consume), but it just feels...weird.

Programming in C by Kochan 4th edition or C Programming: A modern approach by K.N King 2nd edition by Ryuzako_Yagami01 in C_Programming

[–]ynotvim 3 points4 points  (0 children)

Is a great book: beautiful writing, brilliant authors.

However, it's not for a beginner (which the OP specifically asks for), and as other commenters have said, it's significantly out of date in many ways.

Standard library for array/slice manipulation by ServeIndependent837 in golang

[–]ynotvim 23 points24 points  (0 children)

Always start by checking the docs for the standard library: https://pkg.go.dev/std.

It sounds like you want this: https://pkg.go.dev/slices.

Lilush: The Next Small Thing by ynotvim in lua

[–]ynotvim[S] 4 points5 points  (0 children)

Ah, sorry. I guess that means that I don't browse r/lua actively enough. Good luck with the project.

PS I saw it on Lobste.rs, in case you want to weigh in there.

Lilush: The Next Small Thing by ynotvim in lua

[–]ynotvim[S] 3 points4 points  (0 children)

This is not my project, but it may interest people here. The elevator pitch: "Static LuaJIT runtime with batteries."

Do you have any reason not to use the reworked go fix command? by Forumpy in golang

[–]ynotvim 5 points6 points  (0 children)

Yes, it's a little confusing. Here's my understanding, which may not be exact.

  • The go fix command has existed since Go was pre 1.0. Originally, it was gofix. It was created to help users deal with rapid changes at the time. This is in 2011.
  • Then in 2012, Go announces a compatibility promise. That pretty much makes gofix useless.
  • From 2012-2025, gofix stayed as it was, effectively doing nothing. Other analysis-based tools are developed (go vet, staticcheck, etc.)—more for linting code than for fixing API changes.
  • 2026 go fix is back. The compatibility promise is still in place, but there have been important new features and API additions to Go in the last several years. go fix helps users to modernize their code, even though the old code would continue to work.

tl;dr: the new go fix is 100% rewritten. Even if you had heard of the old one, this one is effectively new. The code is new, and the purpose is importantly different. Instead of changing things that wouldn't otherwise work, it modernizes things that would continue to work (because of the compatibility promise).

Using go fix to modernize Go code by ynotvim in golang

[–]ynotvim[S] 22 points23 points  (0 children)

From the post (something I wouldn't have guessed right away): "Running the command more than once also provides opportunities for synergistic fixes, as we’ll see below." It makes sense once I think about it, but I am glad they discuss it, so I figured I would flag it for others.

Do you have any reason not to use the reworked go fix command? by Forumpy in golang

[–]ynotvim 11 points12 points  (0 children)

In fairness, the (built-in) separate command is new too. From the linked blog post: "The 1.26 release of Go this month includes a completely rewritten go fix subcommand."

Undo in Vi and its successors, and my views on the mess by ynotvim in vim

[–]ynotvim[S] 1 point2 points  (0 children)

Not trying to do a gotcha or anything, undo-branches/time traveling is just a really powerful vim feature that I love

Totally fair: it's a great feature.

Undo in Vi and its successors, and my views on the mess by ynotvim in vim

[–]ynotvim[S] 7 points8 points  (0 children)

The author knows that.

My personal view is that the vim undo and redo behavior is the best and most human friendly option. Undo and redo are predictable and you can predictably intersperse undo and redo operations with other operations that don't modify the buffer, such as moving the cursor, searching, and yanking portions of text.

He's not complaining about Vim. He's arguing that POSIX (and some other recent Vi-like editors) should not limit undo/redo to the behavior of original Vi.

Undo in Vi and its successors, and my views on the mess by ynotvim in vim

[–]ynotvim[S] 10 points11 points  (0 children)

By "mess," I think he means that the POSIX standard for Vi specifies the (less useful and very limited) behavior of original Vi for undo/redo. He's arguing that Vi-like editors in active development should ignore that part of the POSIX standard for Vi. He has another recent post about current Vi-like editors that makes similar points.

More broadly, he's trying to talk about what system-level defaults should look like in 2026, even (especially?) when those defaults are based on things first written in the 70s. In the earlier post that I linked, he talks about systems that still insist on original vi and the old Bourne shell.

Undo in Vi and its successors, and my views on the mess by ynotvim in vim

[–]ynotvim[S] 2 points3 points  (0 children)

I think you're missing the point of the article. The article isn't about the code of any particular Vi-like editor. The author is arguing in general that Vi-like editors under active development should not follow the POSIX standard for Vi and insist on the undo/redo behavior of Bill Joy's original Vi. Instead, they should be more like Vim since its undo/redo behavior makes far more sense for users.

🌈🍪🚨 RAINBOW COOKIE PROJECT UPDATE: QUEENS IS COMPLETE* 🚨🍪🌈 by rosieett112 in FoodNYC

[–]ynotvim 0 points1 point  (0 children)

What a terrific site! I can't wait to share it with my wife, who loves rainbow cookies. (We lived near Bonelle for years. Rainbow cookies were definitely not their best thing, but this still brings back happy memories.)

I vote for the Bronx next. Morrone is a classic. (My wife loves that you can get a piece there that is cut like a slice of cake.)

Defer available in gcc and clang by ynotvim in C_Programming

[–]ynotvim[S] 18 points19 points  (0 children)

Plus a related recent blog post talking about different ways to implement defer in C.

https://antonz.org/defer-in-c/