Fork me on GitHub
#clojure-europe
<
2020-12-20
>
orestis15:12:10

I was thinking these days about the gulf that separates beginner programmers, usually being focused to “making things happen” and to, well, more experienced ones that, well, don’t.

val_waeselynck15:12:58

"Can I do this?" "Can I do this elegantly?" "Can I do this efficiently?" "Can I not do this?"

😂 2
orestis15:12:05

I still remember the rush of excitement that Django provided: you could do “full stack” in one go (for me that was a first), and it seems every tech iteration provides the same rush to newcomers.

orestis15:12:17

The code base I’m migrating from seems to have caught the Node and Websockets fever and you can almost feel the excitement of the first devs that managed to go full circle...

orestis15:12:49

The same people also rode out that high and then got another high trying to rewrite to go, Postgres and gRPC.

orestis15:12:02

(Thanks for coming to my rant)

orestis15:12:51

They had a great allergy on actually writing “business specific” code. So naturally they tried to write machinery instead, and then failed...

val_waeselynck15:12:29

"Don't mistake motion for progress"

val_waeselynck15:12:42

(yes, I'm decided to comment only by quotes)

orestis15:12:22

So I’m writing all that stuff because I was trying to figure out if I can phrase my “instincts” in a way that makes sense for others. I think Zach Tellman has something about this in his book.

orestis15:12:13

So these days I’m usually thinking about “the domain” and trying to write code that resembles it. This could be tiny named functions that return snippets of SQL/mongo queries or our graphql API that is domain oriented (vs database oriented)

orestis15:12:48

(Waiting for another quote @val_waeselynck !)

val_waeselynck15:12:45

"To solve a problem, you have to let it dissolve into a rising tide of general theory"

val_waeselynck15:12:58

OK, that one didn't work out that well

😄 2
orestis15:12:21

I blame the various tutorials that always aim at showing how the tech is put together, naturally using the simplest of domains, which gives people false confidence, because they leave thinking that making the machine dance is the job. Whereas it’s only the most basic requirement...

val_waeselynck15:12:34

Yeah we do have a problem that having a good grasp of each mechanical part does not mean we have a good grasp of how they should come together into a sensible whole

val_waeselynck15:12:11

And that's a misconception that typically plagues the discussions of "which technology is easiest"

val_waeselynck15:12:46

Like, assembly language is quite easy, in the sense that it's very easy to picture what each individual instruction does

val_waeselynck15:12:24

Much more so than the building blocks of Clojure programs for example

val_waeselynck15:12:56

This does not change the fact that it's easier to program advanced logic in Clojure

val_waeselynck15:12:27

Well I guess that's already addressed in Greenspun's 10th rule, should have quoted that maybe

val_waeselynck15:12:20

Unfortunately, I think you can only cure that addiction of instant gratification through self-inflicted spaghetti code

val_waeselynck15:12:27

Well, actually @orestis, maybe there's another way: actually achieving the right abstraction, where all the mechanical aspects become invisible, can provide another intense form of gratification, an "epiphany". Maybe that's something to encourage, a desirable reward to promote so that people strive for "pure-domain" code.

orestis16:12:42

Yeah I was thinking about the ways to learn this: there’s the luck of landing in a team that got this right (to some extent), or the struggle of having to clean up the mess :)

orestis16:12:47

Domain- driven design does try to go into this a bit but I remember a lot of noise about OO...

val_waeselynck16:12:32

Yes, unfortunately most of what I've seen of DDD at conferences was working around the limitations of class-based languages

jeremie18:12:13

I agree, DDD is deeply rooted in OO language for its tactical aspect not for the strategic ones (Ubiquituous Language, Bounded Context, Context map, etc.) where the real innovation and value was, and that part is language agnostic. For instance the Value Object building blocks has a lot of “functional” characteristics (immutability, etc.) and is simply a…Value. The Entity/Aggregate ones deals with lifecycle that is not tied to the language but more with identity, persistence, etc.

👍 1
val_waeselynck16:12:40

There does seem to be some Clojure-specific content though, e.g: https://www.infoq.com/presentations/DDD-Clojure/

val_waeselynck16:12:05

(haven't seen it, don't know if it's good)

val_waeselynck16:12:04

Anyway, you might not need to go all the way to DDD to teach that lesson - even SICP makes this sort of point

orestis17:12:11

Still haven’t read SICP :(