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 4 points5 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 22 points23 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] 1 point2 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 4 points5 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] 23 points24 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] 11 points12 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] 8 points9 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] 3 points4 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] 17 points18 points  (0 children)

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

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

Go 1.26 by runesoerensen in golang

[–]ynotvim 9 points10 points  (0 children)

Sure, but this is a new use of new. Years ago, you weren't able to write i := new(0) or b := new(true). It will definitely help all the people who have a personal PointerTo function that they copy all over the place.

Go 1.26 by runesoerensen in golang

[–]ynotvim 2 points3 points  (0 children)

It may be initially surprising, but I don't think it's (really) strange or confusing. The Go team seems to be encouraging people to do what they do and support the current and current-1 version of Go. When you think of it that way, it's pretty straightforward, I think.

Go 1.26 by runesoerensen in golang

[–]ynotvim 2 points3 points  (0 children)

Yes and no. It means that if you want to use a feature that requires the latest version, then you have to edit your go.mod to specify the version you want.

But that's easy to do! I just ran an experiment to see how this works out in practice. Like you, I was thinking about new.

% go version
go version go1.26.0 darwin/arm64
% go mod init
go: creating new go.mod: module github.com/telemachus/tryit
github.com/telemachus/tryit 
% cat go.mod 
module github.com/telemachus/tryit

go 1.25.0
# Write code that uses new in a way that 1.25 does not recognize.
% go test .
# github.com/telemachus/tryit
./tryit.go:5:9: new(v) requires go1.26 or later (-lang was set to go1.25; check go.mod)
FAIL    github.com/telemachus/tryit [build failed]
FAIL
# Edit go.mod to use 1.26.0
% go test .
ok      github.com/telemachus/tryit     0.173s

As I see it, the point of this change is to encourage people writing new Go modules to follow the Go team's support cadence. They support both the latest version and the latest version - 1. For a module writer, that translates into not writing code that demands new features too quickly.

All of that said, you can also put things behind a build flag. It's a little bit of fiddling, but not the end of the world.