Fork me on GitHub
#other-languages
<
2018-12-01
>
Denis G22:12:22

Guys what do you say about generics/templates vs interfaces

seancorfield22:12:12

Other than "they're orthogonal"?

seancorfield22:12:29

@denisgrebennicov Can you refine your question by providing some context?

Denis G23:12:05

@seancorfield the question is more directed to which of one should be preferred to be used. When should one use templates/generics and when interfaces

lilactown23:12:48

templates & generics solve copy + paste problems. Interfaces solve “everyone must implement the same API” problems

lilactown23:12:09

for anyone interested, I’m going to be trying to do Advent of Code in both CLJ and Rust: https://github.com/Lokeh/advent-2018/tree/master/day1

gklijs23:12:59

Nice, I try rust and RxJava, you might want to give https://github.com/gobanos/cargo-aoc a try for rust, makes it really easy to focus on the solution. Didn't found the cycle input, gonna check if it will perform better.

lilactown23:12:22

Very cool. I think I'll stick with just using plain cargo for now; I'm using this to learn how to use and setup cargo as much as for learning the language

lilactown23:12:23

I'm sure at some point between now and the 25th I'll get sick of it and use the fancy plugin:stuck_out_tongue_winking_eye:

gklijs01:12:49

They are planning on having a kind of leaderboard based on performance. That could be nice. I also added some timer to JavaRx, but it's about 10 times as slow as rust

lilactown01:12:07

yeah my Clojure solution took 300ms on my dinky VPS I’m sshed into. My rust solution built with —release took 20ms

gklijs12:12:18

I now also set the JavaRx up to properly test with jmh, warming up the JVM and such.