by

Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • 04:04
    eed3si9n opened #723
  • 01:39
    SethTisue commented #1223
  • 01:38
    SethTisue commented #1223
  • 01:32
    SethTisue edited #1223
  • 01:26
    SethTisue synchronize #1223
  • 01:24
    SethTisue commented #1223
  • 01:22
    SethTisue commented #1223
  • 01:21
    SethTisue commented #1223
  • 00:03
    NthPortal commented #9223
  • 00:02
    NthPortal commented #9223
  • Sep 23 21:12
    som-snytt commented #9224
  • Sep 23 20:19
    dwijnand review_requested #9224
  • Sep 23 20:19
    scala-jenkins milestoned #9224
  • Sep 23 20:19
    dwijnand opened #9224
  • Sep 23 17:18
    eatkins commented #1223
  • Sep 23 17:14
    eatkins commented #1223
  • Sep 23 16:53
    alvinj opened #1782
  • Sep 23 15:03
    dwijnand synchronize #9209
  • Sep 23 14:03
    SethTisue commented #9221
  • Sep 23 13:58
    SethTisue edited #1223
Gavin Bisesi
@Daenyth

And businesses see very less value in refactoring a working code

Right refactoring isn't the goal in itself, it's a means to an end.

What value it delivers is:

  • Future changes can be implemented faster
  • Risk of production failures is reduced by adding tests, making future tests easier to write, and making the code be clear so it's more correct at a glance
  • Improve team morale to not just be walking through sludge constantly, leading to more productivity
jahan01
@jahan01
@BalmungSan I don't think the person who wrote the code ever had testing in mind. Only good thing he has done is very minimal use of mutations and most of the functions are pure
@Daenyth I have previously argued on point of maintainability and sustainability. But it always ends as trade off between new features vs refactoring, as time and resource(money) constraints are mostly fixed. And most of the times businesses prioritise new functionalities.
Luis Miguel Mejía Suárez
@BalmungSan
Yeah, that is sad.
And that is the problem of software engineering as a general and my problem with most of the mainstream languages like Python and JS, is that they sold you "bad practices" (at least IMHO) from the beginning. And that creates a tendency of making bad developer who wrote bad code.
Gavin Bisesi
@Daenyth
@jahan01 the error is in thinking it's zero-sum
spending some time on improvements results in adding new features faster and with less risk
adding zero time on improvements usually costs more time due to fragility, etc
Rob Norris
@tpolecat
Yeah legacy code can be grim, and it can be risky to refactor to make it more testable if it doesn’t have tests!
Types can save you, if the code uses types effectively (and doesn’t use reflection).
Gavin Bisesi
@Daenyth
The best approach IME is to let the work guide you
Focus on the parts that are changing from new work
find one thing that makes them suck, improve that one thing as you go
Eric K Richardson
@ekrich
I sure don't like the threaded conversation.
2 replies
Rob Norris
@tpolecat
nope
Eric K Richardson
@ekrich
On mobile, forget it, but even on PC you have to click back and forth.
Fabio Labella
@SystemFw
can you still not put code snippets in there?
Ethan
@esuntag
You can, but for some reason ctrl+enter doesn't work to add newlines to your message
So you have to paste it in
Fabio Labella
@SystemFw
ah
Rob Norris
@tpolecat
it's awful
sinanspd
@sinanspd
Thank you @Jasper-M and @martijnhoekstra for the comments and the link. I will see if I can find some research on mutable boxes. My brain is refusing to understand how the environment can change after the lambda is closed. I need to refresh on lambdas a little bit i guess
sinanspd
@sinanspd
Unrelated, is there a library in haskell that is similar to typelevel/discipline?
Ethan
@esuntag
Haven't really written Haskell, so I'm not sure, but isn't that what QuickCheck does? Or is that just property testing?
sinanspd
@sinanspd
I guess you can write custom Law/axiom checks with QuickCheck, fair enough
Tom Grigg
@griggt
@sinanspd maybe you're looking for checkers? specifically the Test.QuickCheck.Classes module
sinanspd
@sinanspd
looks promising! thank you!
Martijn Hoekstra
@martijnhoekstra
Does anyone else tend to want filter to take a PartialFunction with a default to false?
If so, any solutions for that other than teeth grinding?
Luis Miguel Mejía Suárez
@BalmungSan
@martijnhoekstra why not write your own extension method? Or that is what you mean with "teeth grinding".
(btw, yeah I have also wanted that a couple of times)
Dermot Haughey
@hderms
What would be the best library/paradigm to implement something like the SWIM membership protocol in? Sending UDP messages to other services and maintaining a bit of state. Seems like cats effect could do it while making the synchronization easier. Akka seems well suited as well
Fabio Labella
@SystemFw
that's a cool little project
Fabio Labella
@SystemFw
(I'd do it in cats-effect/fs2 given bias :P)
Rob Norris
@tpolecat
+1
Luis Miguel Mejía Suárez
@BalmungSan
Hi all, any reason why Iterator doesn't have groupBy, gropMap & gropMapReduce?
Dermot Haughey
@hderms
@SystemFw would you use cats effect for the overall protocol and fs2 for the network part?
Fabio Labella
@SystemFw
I don't necessarily make such a hard distinction, often fs2 is useful for control flow as well
but yeah definitely for udp
Rob Norris
@tpolecat
@hderms i wrote a library that does tcp using scodec to deal with binary data and fs2 to deal with networking and queueing and so on
it worked really really well. super easy, all things considered
Dermot Haughey
@hderms
Interesting, what's the name of it @tpolecat ?
Are you talking about skunk
Luis Miguel Mejía Suárez
@BalmungSan
I would guess it was skunk.
Ichoran
@Ichoran
@BalmungSan - The signature is (CC[A], A => B) => Map[B, CC[A]]. But that doesn't work if CC is Iterator. (It's unlikely to be usable with that signature, and you can't compute it lazily so even though it looks like an iterator operation, actually the original iterator is completely evaluated to create the Map.)
It would be nice to have the factories have groupedFrom etc method with a signature (IterableOnce[A], A => B) => Map[B, CC[A]]
Luis Miguel Mejía Suárez
@BalmungSan
@Ichoran Not sure what your point is.
Everyone knows computing a Map from an Iterator would consume it.
Luis Miguel Mejía Suárez
@BalmungSan
Ah sorry, I got your point now.
The collection on the right hand side.
Ok, but what about groupMapReduce?
Luis Miguel Mejía Suárez
@BalmungSan
Also it would be cool to have a groupBy(factory)(f) as well as a groupMap