This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-10-27
Channels
- # announcements (10)
- # beginners (95)
- # biff (2)
- # calva (33)
- # cherry (1)
- # clj-kondo (16)
- # clojure (96)
- # clojure-australia (1)
- # clojure-china (1)
- # clojure-europe (42)
- # clojure-filipino (1)
- # clojure-france (2)
- # clojure-hk (1)
- # clojure-indonesia (1)
- # clojure-japan (1)
- # clojure-korea (1)
- # clojure-my (1)
- # clojure-nl (1)
- # clojure-norway (24)
- # clojure-sg (11)
- # clojure-taiwan (1)
- # clojure-uk (1)
- # clojurescript (21)
- # cursive (22)
- # data-science (3)
- # events (7)
- # fulcro (3)
- # graalvm (4)
- # gratitude (6)
- # helix (11)
- # honeysql (7)
- # hoplon (1)
- # introduce-yourself (1)
- # jobs (2)
- # jobs-discuss (16)
- # lsp (15)
- # malli (14)
- # nbb (73)
- # practicalli (3)
- # reagent (8)
- # reitit (5)
- # releases (1)
- # ring (5)
- # rum (3)
- # sci (17)
- # scittle (7)
- # shadow-cljs (22)
- # tools-deps (26)
- # xtdb (9)
BTW, if you’re into that kind of stuff (or know 12 year olds which are) https://www.amazon.co.uk/Code-Language-Computer-Hardware-Software-dp-0137909101/dp/0137909101/ref=dp_ob_title_bk is a fantastic book IMO
Good morning!
There’s an issue that I see once in a while while programming. Some file or some thing is generated, and you have the final result. Great! But now you want to remove or change the generation, and you didn’t own it to begin with. And the final result does not tell you where it came from. With that little nugget of information, you’d be able to start pulling the thread to changing the implementation, but without it, you don’t know where the thread is.
I think the first time I was annoyed by something like this was in env
vars for my terminal, which can come from a bunch of different places. Another is files for some terminal programs that I wanted to remove, where doing so manually was impossible, since I had no overview of the related folders and files scattered on my file system.
Can anyone relate?
I can. ENV variables are global state, they have their uses but they are often abused IMHO. It started with Heroku using them a lot and then the 12 factor methodology endorsing them. I think their use should restricted to things like bootstrapping a configuration process but not actually storing much configuration
I’ve had this experience with this library: https://www.npmjs.com/package/rc#standards Check out how many ways a configuration can be discovered and loaded; it is very important that a team chooses a clear convention and sticks to it strictly, if possible
Interesting library! Yeah, I agree.
I’ve come to long for obvious, easily discoverable code more and more as I’ve grown more experienced as a Clojure programmer 😄
I’ve been pondering this in terms of source code as well. If we take the Java example:
List l = new ArrayList()
This is considered Best Practice(TM) since you’re now programming against the interface and not the implementation, and you’re free to swap out implementation with some other list implementation. All good.
Problem we’re seeing is akin to
Ifoo foo = new SomeFooImpl()
where both IFoo
and SomeFooImpl
are types owned by the app your’re building.
Somewhere down the code you’ll see:
foo.bar()
And it’s hard to know which implementation of bar
you’re actually talking about. Likewise, if you’re in SomeFooImpl
and you want to know where it’s implementation of bar
is used, it’s also hard.
So in this case, we’ve started being very explicit and programming against the implementation rather than the interface like:
SomeFooImpl foo = SomeFooImpl()
Whenever we’re not in need of the polymorphism that going through an interface/protocol provides.You could argue that this also goes against loose coupling, but while loose coupling is great when you want to evolve software, it’s really sucky when you want to figure out how/why software works
Seems reasonable to choose a specific implementation from the get-go. I You can always change your mind and make it general later, I guess 🙂
Yeah, all “looseness” makes for more difficult reading.
I experience it once in a while in my Clojure work project as well. I love generating stuff from data, but sometimes it becomes unclear where the data resides, and even where the generation resides.
I’ve been thinking that maybe, for some use cases, it’d be nice to include for example a little “generation report” in a comment block in a generated file, if at all possible. For easier future discovery.
I’d love to see an example, if you ever come across it again 🙂
(I do rmb that it’s just a simple “This is a generated file. Do not edit as it will be overwritten” comment on top. Maybe some that also add a line indicating which tool generated it + where the responsible source file is located at)
I tend to do a lot of code archaeology in my day job 🙂
> I love generating stuff from data, but sometimes it becomes unclear where the data resides, and even where the generation resides. metdata ftw.
F to pay respect?