This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2015-06-10
Channels
- # admin-announcements (50)
- # beginners (4)
- # boot (31)
- # cider (25)
- # clojure (120)
- # clojure-brasil (1)
- # clojure-germany (2)
- # clojure-india (9)
- # clojure-italy (6)
- # clojure-japan (104)
- # clojure-nl (13)
- # clojure-norway (1)
- # clojure-russia (6)
- # clojure-sg (23)
- # clojure-spain (37)
- # clojure-turkiye (2)
- # clojurescript (115)
- # core-matrix (1)
- # datomic (63)
- # editors (32)
- # euroclojure (56)
- # events (6)
- # ldnclj (71)
- # off-topic (27)
- # onyx (7)
- # overtone (2)
- # reading-clojure (16)
- # reagent (5)
- # slack-help (10)
Morn'
@otfrom: pleased to see u acknowledging your Yorkshire roots!
@agile_geek: on personal projects I do repl-driven, then move the repl commands into unit tests
@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.
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
@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 !!!
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
welcome @cdpjenkins
thanks quentin
@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
@gjnoonan: I’m not counting Yorkshire. You’re a country in it’s own right…and if you study dialects..more than one country!
@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!
@gjnoonan: aye, but it’s all sheep and one Clojurian!
and by sheep I do mean Java/C# dev’s 😉
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. 😉
@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! 😉
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’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
@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.
I’ve used this a few times today, It’s quite nice https://github.com/clojure-emacs/clj-refactor.el/wiki/cljr-add-project-dependency
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.
@agile_geek: yeah i guess extract fn and create fn from example is the two sides of the coin in a way
@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