Morn'
Eyup
Morning
@otfrom: pleased to see u acknowledging your Yorkshire roots!
morning
mrnin
@agile_geek: on personal projects I do repl-driven, then move the repl commands into unit tests
on work projects I did a mix of TDD and the above.
@korny I’ve only done personal projects but I’m trying to develop a way of working and tooling that would support commercial work.
regarding core.typed - Ambrose’s stuff is genius, but I’d prefer something less intrusive - I prefer using Prismatic Schema to do type checking (and maybe coercion) at the program boundaries. Did have one project where this became a bit of a “golden hammer” - and ended up as a performance issue, when code would naively type-check a huge number of deeply nested objects in some circumstances.
I’ve been thinking the same.
Morning
I usually do repl driven development by putting stuff like (comment (def foo [1 2 3]) (def bar [4 5 6]) (my-fn foo bar) )
in my code, using cursive key-bindings to execute the stuff in the comment block as I play. Hopefully that stuff evolves into unit tests over time.
@korny I remember you and @otfrom mentioning this and it’s something I’ve tried since although I don’t like the idea of cluttering production code with commented code as I seen so much ‘noise’ introduced into OOP code bases over the years by Developer’s who don’t know what SCM is.
I intend for these comments to be deleted once the code is relatively stable. And I have quite different behaviour for “temporary” spike code, too - for example our current project has a clojure data seeder that generates performance test data, I don’t apply the same standards to that sort of code :simple_smile:
@korny: agree on schema/coercers. But there is still a need for some kind of type checking ‘inside’ your business logic (I think). Readability is on the list I’ll tackle on my post. Also benefits to refactoring when using core.typed.
^^^ Especially if your business logic is non-trivial and a team is working on it.
welcome @cdpjenkins !!!
Hi!
I only just noticed that this channel exists (just logged on to gitter and noticed that you lot aren't on it any more!)
Did I mention that I will be moving to London in August? So I will finally be a real London Clojurian :simple_smile:
welcome @cdpjenkins :simple_smile:
thanks quentin :simple_smile:
@cdpjenkins: as I’ve just taken a 6 month lease on an apartment in London for convenience/cost compared with Hotels, I too am a real London Clojurian…during the weekdays anyway, and the entire North East England Clojurians group at the weekends!
@agile_geek: not the entire north east
If you ask many people in the south, East Yorkshire may as well be the north east 😛
@gjnoonan: I’m not counting Yorkshire. You’re a country in it’s own right…and if you study dialects..more than one country!
haha
Aye lad, thee aint wrong
@gjnoonan: so NE meaning from Berwick (Scotland? Contentious!) to Richmond (North Yorks not London)
That’s a chunk of the country about 120 miles long and 50-70 miles wide so I’ll lay claim to that!
About 200 miles long. Well depending if you’re going as the bird flys or by road
That is a mighty big bit of land to lay claim to sir
@gjnoonan: aye, but it’s all sheep and one Clojurian!
and by sheep I do mean Java/C# dev’s 😉
anyone want to organise the July or August talks?
https://trello.com/c/SW0M8HWF/75-july-2015-skills-matter-talk
oi everyone, my clj-refactor team mate just rewrote the clj-refactor wiki with heaps of anim gif demos: https://github.com/clojure-emacs/clj-refactor.el/wiki any feedback appreciated!
@agile_geek: that's a bit unfair on the lovely people suffering under legacy languages. 😉
@benedek: cool
@otfrom: as I am one of them…baaaa!
@otfrom: and legacy is COBOL, Fortran, PL1, etc.
@agile_geek: All the more people to convert
@gjnoonan: Working on that at current employer. Not sure I can get them to worship at the altar of Emacs tho! 😉
Apply force :simple_smile:
I didnt realise there was a declare
function for making forward declarations , do people use the declare
function much ? Could be handy in the REPL I suppose... https://clojuredocs.org/clojure.core/declare
@jr0cket: I have used it a few times... but not really needed I guess
@jr0cket: I’ve tried to refactor my code so I don’t need it. I’ve only had to keep it in one toy project so far and I’m sure if I thought about it harder I could remove it (BTW it was that cheque parser kata)
Thanks @thomas @agile_geek. Seems the declare
function could be briefly useful to keep your train of thought going. For example, you are working on a function and realise you want some of the work to be done by a yet unwritten function, so you declare
the unwritten function name and keep going. I guess its more likely you would just add all the work in the current function and then refactor it out into its own. I only thought about declare
because its the first refactor in the list of clj-refactor https://github.com/clojure-emacs/clj-refactor.el/wiki
@jr0cket: John, there will be cases where you have a function that is cyclically dependent on another function further down the code and you have to use declare because (unlike Java) Clojure doesn’t have two passes through the compiler to resolve references. However, I try and write my code to avoid this.
@jr0cket nice! you can also use create function from example usage: https://github.com/clojure-emacs/clj-refactor.el/blob/master/examples/create-fn-from-example.gif from clj refactor
I’ve used this a few times today, It’s quite nice :simple_smile: https://github.com/clojure-emacs/clj-refactor.el/wiki/cljr-add-project-dependency
Trying to work through and get them all into my workflow, and muscle memory
I can see this being useful for me, but wasn’t able to get it to work earlier when I tried https://github.com/clojure-emacs/clj-refactor.el/wiki/cljr-add-stubs
@gjnoonan: haven’t used add stubs because most of my toy projects don’t have much in the way of protocols but I did a talk at Skills Matter last week on my favourite refactors from clj-refactor. I’ve got a few of the ones I used most often in muscle memory now.
Which do you use most offen?
"Skillscast coming soon.” booo
@agile_geek: yeah i guess extract fn and create fn from example is the two sides of the coin in a way
@gjnoonan: what kind of problem did you see?
@benedek: Given the contrived example of
(defprotocol UserStore
"Just a test user store"
(create-user [user])
(delete-user [user]))
(defrecord User [username]
UserStore)
I get cljr--maybe-rethrow-error: Can't find interface rep.backend.db/UserStore .. Saved and loaded into the repl fine@gjnoonan: it’s said that since Tuesday last week so I’m guessing they’ve lost the footage..S’OK I hate watching myself! 😉
@agile_geek: would be a shame tho
@benedek: any ideas?
@gjnoonan: just guessing that since you created the protocol just before the defrecord the generated interface is not yet available on the classpath
created an issue for it on github. will look into it more throughly
hmm, makes sense
Thanks! :simple_smile:
np