Haskell in Nixpkgs/NixOS | 724 Members | |
| For discussions and questions about Haskell with Nix, cabal2nix and haskellPackages in nixpkgs | Current Docs: https://haskell4nix.readthedocs.io/ | 145 Servers |
| Sender | Message | Time |
|---|---|---|
| 17 Jan 2025 | ||
| YAGNI? | 17:38:43 | |
| 18 Jan 2025 | ||
| @bowuigi---now-more-based:kde.org: you aren't gonna need it | 08:47:05 | |
| = avoid early abstraction as you would avoid early optimization | 08:48:05 | |
| Ah, yeah those seem in conflict | 08:50:58 | |
In reply to @b:chreekat.net DRY: don't write the same thing twice I can see how they conflict when applied loosely, but applying DRY carefully should be OK. | 13:27:32 | |
if i need lens_5_3_3 is there a way to overrideAttrs lens_5_3_2 into it? | 22:43:57 | |
| i tried just changing the version, but that unsurprisingly didnt work | 22:44:13 | |
| changing the src? | 22:45:54 | |
| Maybe something like this?
| 22:46:10 | |
| * Maybe something like this?
| 22:46:20 | |
| * Maybe something like this?
| 22:46:36 | |
| * Maybe something like this?
| 22:46:51 | |
| how does it know the deps? thats smells like IFD | 22:47:04 | |
| or is a giant FOD, im fine with that | 22:47:22 | |
| oh, changing src did it, well, it still thought its compiling lens 5.3.2, but hey, if it works it works | 22:48:07 | |
| It gets the tarball with the hash from hackage, and, I assume, gets the rest of the deps from nixpkgs. | 22:48:12 | |
| 22:48:43 | |
| right, but it doesnt know which deps, so it has to do a FOD or IFD | 22:48:58 | |
In reply to @implicit_operative:matrix.orgYeah that uses ifd | 22:57:30 | |
| FYI, using `sha256 = ""` does the same AAAA screaming | 23:04:36 | |
| that i know and it was the highlight of that years nix releases :) | 23:13:21 | |
| hear hear | 23:37:59 | |
| 19 Jan 2025 | ||
| They're fundamentally in conflict. You only avoid conflict precisely by applying them loosely. :) DRY, applied religiously, requires you to define abstractions very early that allow slightly different use cases to share common expressions. But abstractions have a cost. Copy/paste/modify is often cheaper. And most importantly, it requires a lot less careful thought. Wasting brainpower to develop a thoughtful abstraction for something that will never have more than two use cases is a shame. That's really the essence of YAGNI. | 12:22:37 | |
In reply to @b:chreekat.netIt's a very interesting dispute in our company. Our code is very YAGNI but the newer part of the team, mostly juniors, me included, have mostly heard the DRY gospel. | 12:35:47 | |
| Everytime my boss comes with a new requirement and it's a three liner for me because there is exactly one central function for it I am sooo happy. | 12:37:32 | |
| Whereas applying the same API change roughly 15 times to slight variations of the same code drives me mad. | 12:38:17 | |
| Otoh abstracting over those 15 slight variations would (have been) be quite a lot of work. | 12:40:12 | |
In reply to @b:chreekat.net That's hardly the bare minimum needed to avoid repetition. Perhaps DRY fails to explicitly account for the idea that some repetition is needed for defining things that are different even though they seem similar. For me, problems like this tend to go away when I model the problem more carefully. | 13:24:44 | |
| I think when modeling things more carefully always makes the result better. The question is does it make the process more efficient. | 13:28:32 | |
I've updated the hscurses library a little bit; in particular its new version would no longer need the line hscurses = addExtraLibrary pkgs.ncurses super.hscurses; in configuration-nix.nix (but would need to inherit ncurses from pkgs instead in the mkDerivation call in hackage-packages.nix instead in order to not pull in the Haskell lib named ncurses). Is the version update + the latter step something that's automagically made somehow? Or would that need a PR somewhere? | 13:53:33 | |