Earlier quoted context omitted.
> I'm using MVC design patterns for some codebases, I'm using DDD plus Event sourcing and Event Driven for others. All examples of OO nonsense. There is only one pattern you need (functions) (tongue-in-cheek): https://fsharpforfunandprofit.com/fppatterns/ Edit: Also consider using the ELM architecture instead of MVC: https://guide.elm-lang.org/architecture/
I typically reach for Go when I am building things, bubbletea, a TUI library uses the Elm architecture and enforces it on people using it. Did not like, Won't use again. MVC is well understood and works perfectly in my experience. edit: Even though you were tongue in cheek about F# - this stood out on the page > The functional programming community has design patterns and principles as well.
In praise of –dry-run
161–170 of 175 posts
Re: In praise of –dry-run
#162I like the opposite too, -commit or -execute as it is assumed running it with defaults is immutable as the dry run, simplifying validation complexity and making the go live explicit.
Re: In praise of –dry-run
#163Earlier quoted context omitted.
How do you easily diff what changed between Docker and host?
The way OverlayFS works is that there's a base directory. And then there's an overlay directory that only contains the changes. Docker is based on OverlayFS. There's two main ways overlays are used, first at build time, each line/command generates a new overlay based on the previous base, so when you do something like FROM debian RUN apt-get update it creates a base from the debian image , and then creates an overlay…
Re: In praise of –dry-run
#164I like the opposite too, -commit or -execute as it is assumed running it with defaults is immutable as the dry run, simplifying validation complexity and making the go live explicit.
And it's pretty nice. The downside is if you get used to that behavior in things that don't have it the consequences can be bad. (Like the common `alias rm='rm -i'`. No, that's just a trap; don't do it.)
Re: In praise of –dry-run
#165Earlier quoted context omitted.
I wouldn’t want most things to work this way: $ rm file.bin $ rm —-commit file.bin $ cat foo.txt > bar.txt $ cat foo.txt | tee —-write-for-real bar.txt $ cp balm.mp3 pow.mp3 $ cp —-i-mean-it balm.mp3 pow.mp3 There is a time and a place for it but it should not be the majority of use cases.
Uhuh: $ rm -rf / rm: it is dangerous to operate recursively on '/' rm: use --no-preserve-root to override this failsafe
Re: In praise of –dry-run
#166Earlier quoted context omitted.
I had the equivalent of --dry-run in my kdecvs-build script from 2003 (where it was called --pretend) so it's not that spontaneous an idea that it must have been dreamed up by an AI. Any time you have a script that needs to run for a long time or might involve destructive actions, having a way to run the script in a "tell me what you would do without actually doing it" mode is a fairly obvious user story to throw in.
Again, it's completely possible that OP and you are the wonderful exceptions (untouched and uninspired by coding agents) that have been using these patterns for as long as you can remember. My comment revolved around the psychological phenomenon, not whether dry-run is a clever/novel idea. It's about how we might tell ourselves stories about the origin of our ideas when working with those tools.
This isn't something with surprising nuance like how a McDonald's milkshake serves a non-food "job to be done" during a shopper's morning commute. As evidenced by all the others in this thread pointing out other tools that do similar things, it's a fairly obvious idea to come up with after actually using a new tool.
You'd be more likely to learn about it doing product comparisons of other tools, although since there is a lot of common art for AI training to draw from, yes it is also possible to hear about it from your AI first.
Re: In praise of –dry-run
#167If you're interacting with stateful systems (which you usually are with this kind of command), --dry-run can still have a race condition. The tool tells you what it would do in the current situation, you take a look and confirm that that's alright. Then you run it again without --dry-run, in a potentially different situation. That's why I prefer Terraform's approach of having a "plan" mode. It doesn't just tell you w…
> That's why I prefer Terraform's approach of having a "plan" mode. It doesn't just tell you what it would do but does so in the form of a plan it can later execute programmatically. Then, if any of the assumptions made during planning have changed, it can abort and roll back. And how do you imagine doing that for the "rm" command?
Re: In praise of –dry-run
#168Earlier quoted context omitted.
And just like that, you find yourself implementing a compiler (specs to plan) and a virtual machine (plan to actions)!
> And just like that, you find yourself implementing a compiler (specs to plan) and a virtual machine (plan to actions)! Not just any compiler, but a non-typesafe, ad-hoc, informally specified grammar with a bunch of unspecified or under-specified behaviour. Not sure if we can call this a win :-)
Re: In praise of –dry-run
#169Earlier quoted context omitted.
this is where design patterns come in handy even tho folks roll their eyes at it.
Design patterns are one of those things where you have to go through the full cycle to really use it effectively. It goes through the stages: no patterns. -> Everything must follow the gang of four's patterns!!!! -> omg I can't read code anymore I'm just looking at factories. No more patterns!!! -> Patterns are useful as a response to very specific contexts. I remember being religious about strategy patterns on an ap…
Re: In praise of –dry-run
#170Earlier quoted context omitted.
> That's why I prefer Terraform's approach of having a "plan" mode. It doesn't just tell you what it would do but does so in the form of a plan it can later execute programmatically. Then, if any of the assumptions made during planning have changed, it can abort and roll back. And how do you imagine doing that for the "rm" command?
In my case, I’d use a ZFS snapshot. Many equivalent tools exist on different OSes and filesystems as well.
I think the current semantic of "rm" works fine. But I understand the new world where we'll perhaps gonna be deleting single files using Terraform or cluster of machines, or possibly LLMs/AI agents.