This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-08-15
Channels
- # announcements (13)
- # beginners (106)
- # cider (70)
- # cljdoc (1)
- # cljsjs (1)
- # clojure (97)
- # clojure-finland (1)
- # clojure-italy (13)
- # clojure-mexico (16)
- # clojure-russia (1)
- # clojure-spec (53)
- # clojure-uk (146)
- # clojurescript (44)
- # core-async (5)
- # cryogen (1)
- # css (1)
- # cursive (11)
- # datomic (89)
- # duct (10)
- # emacs (4)
- # figwheel-main (58)
- # fulcro (5)
- # hispano (35)
- # hyperfiddle (1)
- # jobs (2)
- # jobs-discuss (1)
- # lambdaisland (1)
- # leiningen (3)
- # off-topic (13)
- # onyx (50)
- # parinfer (3)
- # pedestal (4)
- # reagent (9)
- # ring-swagger (56)
- # rum (3)
- # shadow-cljs (85)
- # spacemacs (4)
- # vim (4)
Morning (yawns)
@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
Morning.
Bore da pawb
mornings!
Mornin'
Morning!
Anyone up in the Stafford area? I'm here for a cat show this weekend (at the pet show at the county fairgrounds).
It's what Jay & I do at weekends as a hobby 🐱
She's a judge
Good morning!
The weather is a lot more bearable than when I was here last month! :barely_sunny:
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 🙂
http://tonsky.me/blog/readable-clojure/#dont-rely-on-implicit-nil-to-false-coercion what is the point of advising not to use higher order functions ?
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
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.
I don't think that's strictly true. Tonsky is very experienced. It might be from watching a lot of beginners getting started.
“it looks different from the normal function calls … Even as experienced Clojure programmer I haven’t developed a skill to parse such structures easily.”
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.)
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
.
I think I assumed that to be exaggerated, because he's so experienced. Upon consideration, it may not be true.
but as ive been working with clojure for longer periods of time i don’t really like what hes saying
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
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.
I still prefer https://github.com/bbatsov/clojure-style-guide
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
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.
(because they will have to learn the idioms to be effective -- and to read most Clojure library code out there)
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.
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.
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.
And please understand I think that you are making good points @agile_geek
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! 😉
... after that, I think I'll invent a new 'agile' process and retire on the proceeds
I'm hoping to cash in on the inevitable backlash with 'Ponderous' development.
@agile_geek - Take.My.Money!
My “Fragile” development training never took off. It turned out most large organisations already knew how to do it.
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.
Indeed - it's taken months of floundering to get it this resilient!
Flounder sounds like the name of my new agile process! ™️
The whole thing could be themed around flatfish. Sounds brill! :thinking_face:
@agile_geek of which you will be the sole practitioner?
Well, obviously I will sell training and certification!
This whole thread is getting fishy
>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
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.
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.
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.
I think 2) is as, if not more, important than 1) but almost nobody does it well
Also 2) is the reason architects should code (feel the pain you induce)
breathe
> 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?
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.
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
But I realise that's not the norm, so I'm trying to understand how other people/companies do things
@lady3janepl agreed most architects don't... but they should... and this is often the root of a lot of problems!
@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!
I've worked in lots of consulting gigs that are just staff augmentation and are very focused on just deliver now
but not the car or cdr?
It's all a big cons...oh dear... Not puny
@jasonbell not enough $'s .. Con$$$$$$$$$ultant!
2nd mornings
Can anyone explain to me what schema.core/named
is doing here https://github.com/plumatic/schema/blob/60bf36a8d63c15216f366c73ccf7ff8e7cd6baad/src/cljx/schema/core.cljx#L434-L445
NamedSchema.
is java interop for creating an object i believe? and its just passing in the schema and name
I remember reading that it’s recommended to not create records by using the (Thing. )
notation, but to create a function wrapper for that
@yogidevbear @lady3janepl that's just for convenience, (Ctor.)
requires requiring the namespace and importing the class, a wrapper function just requires requiring the namespace
(map->WereWolf {:name "Lucian" :title "CEO of Melodrama"})
Taken from :
https://www.braveclojure.com/multimethods-records-protocols/
I guess they prefer exposing ctor
instead of ->Ctor
as their public api, so that's what named
is there for
Its a common pattern i think where u create a defrecord then create a function below that calls the constructor inside the fn.
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
You just gotta take every thing as a chance to learn 😄 No one really knows everything about clojure
There are days when I feel like I know less than I thought I did previously 🙂
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!
for completeness, map->Ctor
is only generated on defrecord
, while ->Ctor
is generated for both defrecord
and deftype
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?
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 declare
d it before starting the type definition.
@lady3janepl yeah there's already a ticket + patch for that, one sec
@bronsa isn't Jira just a black hole for things you wish would be implemented. Like that in most orgs!
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
but whatever, all the major patches I cared about have already made it eventually, it's just the minor things that are left over
I'm not saying they're good ideas!