Fork me on GitHub
#ldnclj
<
2015-06-10
>
agile_geek08:06:29

@otfrom: pleased to see u acknowledging your Yorkshire roots!

korny08:06:14

@agile_geek: on personal projects I do repl-driven, then move the repl commands into unit tests

korny08:06:33

on work projects I did a mix of TDD and the above.

agile_geek08:06:44

@korny I’ve only done personal projects but I’m trying to develop a way of working and tooling that would support commercial work.

korny08:06:51

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.

agile_geek08:06:23

I’ve been thinking the same.

korny08:06:20

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.

agile_geek08:06:44

@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.

korny08:06:16

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

martintrojer08:06:20

@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.

martintrojer08:06:45

^^^ Especially if your business logic is non-trivial and a team is working on it.

cdpjenkins10:06:43

I only just noticed that this channel exists (just logged on to gitter and noticed that you lot aren't on it any more!)

cdpjenkins10:06:12

Did I mention that I will be moving to London in August? So I will finally be a real London Clojurian simple_smile

cdpjenkins10:06:02

thanks quentin simple_smile

agile_geek11:06:29

@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!

gjnoonan11:06:05

@agile_geek: not the entire north east

gjnoonan11:06:37

If you ask many people in the south, East Yorkshire may as well be the north east 😛

agile_geek11:06:26

@gjnoonan: I’m not counting Yorkshire. You’re a country in it’s own right…and if you study dialects..more than one country!

gjnoonan11:06:12

Aye lad, thee aint wrong

agile_geek11:06:13

@gjnoonan: so NE meaning from Berwick (Scotland? Contentious!) to Richmond (North Yorks not London)

agile_geek11:06:38

That’s a chunk of the country about 120 miles long and 50-70 miles wide so I’ll lay claim to that!

gjnoonan11:06:55

About 200 miles long. Well depending if you’re going as the bird flys or by road

gjnoonan11:06:20

That is a mighty big bit of land to lay claim to sir

agile_geek12:06:24

@gjnoonan: aye, but it’s all sheep and one Clojurian!

agile_geek12:06:44

and by sheep I do mean Java/C# dev’s 😉

otfrom12:06:01

anyone want to organise the July or August talks?

benedek12:06:10

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!

otfrom12:06:23

@agile_geek: that's a bit unfair on the lovely people suffering under legacy languages. 😉

agile_geek12:06:52

@otfrom: as I am one of them…baaaa!

agile_geek12:06:20

@otfrom: and legacy is COBOL, Fortran, PL1, etc.

gjnoonan12:06:02

@agile_geek: All the more people to convert

agile_geek12:06:59

@gjnoonan: Working on that at current employer. Not sure I can get them to worship at the altar of Emacs tho! 😉

gjnoonan12:06:10

Apply force simple_smile

practicalli-johnny14:06:03

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

thomas14:06:53

@jr0cket: I have used it a few times... but not really needed I guess

agile_geek15:06:21

@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)

practicalli-johnny16:06:37

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

agile_geek16:06:06

@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.

agile_geek19:06:46

@benedek @jr0cket; I tend to end up using extract function more as I often only think of the function I want to extract as I realise my code is getting a bit large and cumbersome.

gjnoonan20:06:19

Trying to work through and get them all into my workflow, and muscle memory

gjnoonan20:06:10

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

agile_geek20:06:25

@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.

gjnoonan20:06:06

Which do you use most offen?

gjnoonan20:06:42

"Skillscast coming soon.” booo

benedek20:06:54

@agile_geek: yeah i guess extract fn and create fn from example is the two sides of the coin in a way

benedek20:06:36

@gjnoonan: what kind of problem did you see?

gjnoonan20:06:33

@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

agile_geek20:06:04

@gjnoonan: it’s said that since Tuesday last week so I’m guessing they’ve lost the footage..S’OK I hate watching myself! 😉

benedek20:06:56

@agile_geek: would be a shame tho

benedek21:06:57

@gjnoonan: just guessing that since you created the protocol just before the defrecord the generated interface is not yet available on the classpath

benedek21:06:14

created an issue for it on github. will look into it more throughly

gjnoonan21:06:31

hmm, makes sense