Fork me on GitHub
#clojure-uk
<
2018-08-15
>
yogidevbear06:08:00

Morning (yawns)

otfrom07:08:27

@jasonbell I don't think @agile_geek needs a mobility scooter to prove he's having a mid life crisis. I think his CBR-all the CCs proves that

4
jasonbell07:08:15

I'm sure he does

agile_geek07:08:16

Bore da pawb welsh_flag

guy09:08:06

Morning all!

seancorfield09:08:49

Anyone up in the Stafford area? I'm here for a cat show this weekend (at the pet show at the county fairgrounds).

😻 4
guy09:08:35

take lots of pictures! i wanna see 😄

guy09:08:49

That sounds pretty awesome 😄

seancorfield09:08:49

It's what Jay & I do at weekends as a hobby 🐱

guy09:08:53

wow!! awesome

seancorfield09:08:50

The weather is a lot more bearable than when I was here last month! :barely_sunny:

👍 8
🐻 4
3Jane09:08:01

Also: yay, pet shows! I used to hang out with small animal/rat show breeders and judges, it can be great fun to get to know the owners and the pets 🙂

bronsa09:08:43

that list is highly questionable

bronsa10:08:36

and the terminology there is incorrect, it's talking about "point-free" style but referring it as higher-order functions -- both examples are using higher order functions, the first is in point-free while the second isn't

👍 4
3Jane10:08:55

The guy advises to avoid these functions because he hasn’t internalised the pattern they use enough that he can speed-read it. It’s his personal preference.

dominicm10:08:01

I don't think that's strictly true. Tonsky is very experienced. It might be from watching a lot of beginners getting started.

3Jane10:08:45

Right. I’m going by what he wrote.

3Jane10:08:02

“it looks different from the normal function calls … Even as experienced Clojure programmer I haven’t developed a skill to parse such structures easily.”

3Jane10:08:35

Yeah, they do look different; it’s a new pattern that you have to learn. (It’s why I was annoyed by Clojure initially, actually 😄 it didn’t read as smoothly/uniformly as the lisps I remembered from long ago, not that I was a power user.)

3Jane10:08:50

But then these functions are not the only case of weird syntax and I’m not sure that “avoid anything non-uniform” is the best way to do things. Say, are from clojure.test.

dominicm10:08:49

I think I assumed that to be exaggerated, because he's so experienced. Upon consideration, it may not be true.

guy10:08:35

i found that blog really interesting

guy10:08:53

If i read that when i first started clojure i would totally agree

guy10:08:14

but as ive been working with clojure for longer periods of time i don’t really like what hes saying

guy10:08:48

To me it feels like most of his points would help beginners learn a new code base but i find most of his suggestions frustrating

3Jane10:08:50

Incidentally, I do find myself annoyed by the lack of clarity between nil (null) and false and various ways to indicate “not found” or “error” in a different language (PHP), so I’m actually glad for the -some varieties. I like when the author takes extra time to be clear about their intentions.

4
guy10:08:14

rather than just someones blog post

guy10:08:19

:man-shrugging:

guy10:08:06

I would assume (maybe wrongly) that if you followed the above links style, then people who have done clojure before will have an easier time of reading your code

guy10:08:47

anyways ill stop 😅 i think im a bit tilted haha

seancorfield11:08:38

Several things in Tonsky's blog post are very non-idiomatic (and to be fair he does sort of acknowledge that). But I think learning to read and write idiomatic Clojure is more important than catering to potential newbies.

seancorfield11:08:45

(because they will have to learn the idioms to be effective -- and to read most Clojure library code out there)

👍 20
agile_geek12:08:47

I wrote a long rant about idioms....among a load of other stuff... for why I find some Clojure/Clojurescript codebases hard to grok. The idioms help you scan code faster but the big payback for me personally is when I have something that tells me the 'shape' of the data every fn is expecting. You can get some of this from Spec and/or Schema but that tends to just be at the boundaries of the app not deep inside the app. Most of it comes down to giving the next developer (or the future you) breadcrumbs to follow. So I find example based unit tests and integration tests among the most useful things for describing the expected input if you don't add spec to every fn.

agile_geek12:08:59

Along the lines of my other rants about evolutionary architecture, I think the trick with Spec/Schema is adding it at the point where the abstractions (and associated data) stabilise. Don't impose abstractions too early before you're sure they're required as that's a decision that becomes a 'legacy' (in a bad way) that you carry the cost of maintaining for as long as the codebase hangs around.

agile_geek13:08:34

All of this eventually comes back to: 1) A clear, but evolving, architectural vision understood by all the team(s) (and the underlying reasons for choices made tied back to business benefit/needs) 2) Developers using the right disciplines at the right time to implement said vision All of which is context specific and can't be taught by rote.

maleghast13:08:28

Here endeth the lesson...

maleghast13:08:33

And please understand I think that you are making good points @agile_geek

agile_geek13:08:10

Yeah, just need to completely ruin the whole point by distilling it down to a training course with associated documentation and certification... publicise it and make some money! 😉

✔️ 4
agile_geek13:08:24

... after that, I think I'll invent a new 'agile' process and retire on the proceeds

parrot 4
rhinocratic13:08:46

I'm hoping to cash in on the inevitable backlash with 'Ponderous' development.

😹 8
Rachel Westmacott13:08:07

My “Fragile” development training never took off. It turned out most large organisations already knew how to do it.

😁 8
rhinocratic13:08:50

Mine certainly does. I expect the durability of the system I'm working on to be comparable to that of a poppadom in a stiff south-westerly.

mccraigmccraig13:08:46

so that's pretty good then by industry benchmark standards @U0HJFE43U!

😁 4
rhinocratic14:08:28

Indeed - it's taken months of floundering to get it this resilient!

agile_geek14:08:04

Flounder sounds like the name of my new agile process! ™️

rhinocratic14:08:04

The whole thing could be themed around flatfish. Sounds brill! :thinking_face:

3Jane14:08:37

@agile_geek of which you will be the sole practitioner?

agile_geek14:08:35

Well, obviously I will sell training and certification!

3Jane14:08:27

The joke won’t work anymore then 😞

rhinocratic14:08:31

You'd be a Dab hand, I'm sure.

👍 8
agile_geek14:08:28

This whole thread is getting fishy

3Jane14:08:17

That’s what happens when a consultant gets involved

firthh13:08:56

>2) Developers using the right disciplines at the right time to implement said vision I think the hard part here is the right time. It's not easy to know when the right time is and just use the same disciplines all the time

agile_geek14:08:08

Part of 'developer discipline' is knowing this. It's a skill that takes everyone different experience and time to acquire. Personally I'd prefer ppl start by applying some std disciplines rigorously and then tune it. E.g. I'd rather ppl started by using TDD rigorously until they understand when it's not adding value. You can always remove cruft in a PR review by deleting and refactoring tests.

agile_geek14:08:12

the difficult bit is the sort of thing where a developer is asked to add some data and they don't understand the architectural vision so they just shoehorn it into an existing component and database without realising that they added a responsibility that that component should not own. This takes an 'architect'* to communicate vision and senior dev's to interpret said vision. * Where architect is a role possibly taken by one or more dev's on the team.

agile_geek14:08:20

Architect has two responsibilities: 1. Own the vision and constantly test it against the biz needs (map metrics in architecture to biz metrics). Adapting the vision as metrics are changed or the values trend the wrong way. 2. Communicate bi-directionally to/from dev's the vision and soft metrics on feedback about pain induced or pain reduced by architectural vision.

agile_geek14:08:50

I think 2) is as, if not more, important than 1) but almost nobody does it well

agile_geek14:08:19

Also 2) is the reason architects should code (feel the pain you induce)

firthh14:08:37

> Where architect is a role possibly taken by one or more dev's on the team. Do you think a dedicated role or having devs in the team own this is better?

3Jane14:08:21

Architects communicating is one thing; managers pushing the employees to produce results faster against/ignoring the architecture is another. If there is conflict between planning and execution authorities, so to speak, even the best written documentation will break. Architects don’t have the authority or even possibility to enforce quality.

firthh14:08:42

It's been a long time since I've worked anywhere that has architects or managers that push people to produce results faster. My last role we didn't even have managers. The responsibilities managers would typically have were shared by everyone in the team

firthh14:08:37

But I realise that's not the norm, so I'm trying to understand how other people/companies do things

agile_geek14:08:18

@lady3janepl agreed most architects don't... but they should... and this is often the root of a lot of problems!

agile_geek14:08:47

@U0694C7V3 lucky you! The only times I've ever worked anywhere where dev's didn't get pushed to produce results faster where in a couple of startups (or grown up startups) and ... I hope... a consultancy I was CTO of!

firthh14:08:55

Yeah, I've only ever worked in consulting and grown up startups

agile_geek18:08:28

I've worked in lots of consulting gigs that are just staff augmentation and are very focused on just deliver now

sundarj14:08:23

i see you have the sultan part of 'consultant' covered

jasonbell14:08:16

Consultant spelt Con$ultant 🙂

sundarj14:08:22

he uses a lisp, so clients pay a premium for the cons

agile_geek14:08:00

but not the car or cdr?

3Jane14:08:10

Company cars on lease; cdrs expenses moved to next quarter.

😁 8
sundarj14:08:01

joke's on them, the cons bill includes the prices for both anyway

danm15:08:48

You're all bad people and you should feel bad 😛

sundarj15:08:18

i wear my turpitude with pride

agile_geek18:08:08

It's all a big cons...oh dear... Not puny

agile_geek14:08:28

@jasonbell not enough $'s .. Con$$$$$$$$$ultant!

guy14:08:29

lollllll

guy15:08:42

it looks like its creating a NamedSchema record ?

guy15:08:10

I’m not sure i understand what question you are really asking

guy15:08:42

NamedSchema. is java interop for creating an object i believe? and its just passing in the schema and name

3Jane15:08:57

named is a constructor

4
3Jane15:08:42

I remember reading that it’s recommended to not create records by using the (Thing. ) notation, but to create a function wrapper for that

guy15:08:14

I would usually use the ->map thing

guy15:08:16

let me find it

bronsa15:08:13

@yogidevbear @lady3janepl that's just for convenience, (Ctor.) requires requiring the namespace and importing the class, a wrapper function just requires requiring the namespace

👍 12
guy15:08:25

(map->WereWolf {:name "Lucian" :title "CEO of Melodrama"}) Taken from : https://www.braveclojure.com/multimethods-records-protocols/

bronsa15:08:38

defrecord autogenerates map->Ctor and ->Ctor functions

bronsa15:08:00

I guess they prefer exposing ctor instead of ->Ctor as their public api, so that's what named is there for

guy15:08:41

Its a common pattern i think where u create a defrecord then create a function below that calls the constructor inside the fn.

guy15:08:34

^ my english isnt very good sorry, let me rephrase

bronsa15:08:35

it's common mostly when that constructor function is exposed as a public API, for internal APIs the autogenerated ->Ctor function is just the same

👆 8
yogidevbear15:08:33

imposter syndrome setting in

👀 4
4
guy15:08:57

You just gotta take every thing as a chance to learn 😄 No one really knows everything about clojure

yogidevbear15:08:25

There are days when I feel like I know less than I thought I did previously 🙂

guy15:08:57

Thats natural

guy15:08:31

It just takes time to sink in and grok, then eventually u will be the one answering the questions in chat haha. I learn something new everyday and love that fact!

yogidevbear15:08:50

Definitely 🙂 So much to learn which is great

❤️ 8
mario-star 4
bronsa15:08:47

for completeness, map->Ctor is only generated on defrecord, while ->Ctor is generated for both defrecord and deftype

guy15:08:59

ooh thats neat to know

guy15:08:13

TIL; :thumbsup:

yogidevbear15:08:31

So reading and re-reading, my understanding is that I can use schema.core/named to define a custom named schema validation type. Does that sound about right?

guy15:08:36

(named some-schema some-schema-name)

👍 4
guy15:08:03

yeah i think so

3Jane16:08:57

Also, annoyingly when you do a deftype and implement some protocols at the same time, you cannot use ->MyType inside the implementations. However, you can use the constructor function, if you declared it before starting the type definition.

bronsa16:08:42

@lady3janepl yeah there's already a ticket + patch for that, one sec

bronsa16:08:28

only been open for 6 years 🙃

bronsa16:08:54

6 years and 5 days actually

3Jane16:08:20

puts things in perspective

agile_geek18:08:37

@bronsa isn't Jira just a black hole for things you wish would be implemented. Like that in most orgs!

bronsa18:08:02

jira in this case is a black hole for things I have already implemented over and over and wish they would just get merged or even looked at

👀 4
parrot 8
😂 8
3Jane06:08:43

All the feels

bronsa18:08:38

but whatever, all the major patches I cared about have already made it eventually, it's just the minor things that are left over

bronsa18:08:04

i'm not as bitter about it as I was a few years ago :)

👀 4
4
😆 8
bronsa18:08:53

i find it so hard to come up with talk ideas 😓

agile_geek18:08:08

I'm not saying they're good ideas!

jasonbell18:08:03

@bronsa - 1. Siphon off the last three hundred talk titles from your favourite conferences. 2. Lower case the titles, remove words like "and", "it", "is" etc. 3. Use Clojure to split the words by space into one big vector and then run frequencies function against it.

😛 16
😆 4
jasonbell18:08:45

Works for me 🙂