sotolf,

This was a walk in the park compared with the previous one, fun little problem, managed to get short work out of it using some sets, and some simple iterators.

#adventOfCode #nim
https://codeberg.org/sotolf/adventofcode2020/src/branch/main/day21.nim

array,
@array@fosstodon.org avatar

@sotolf Congrats for yet another problem solved! :D I love how readable Nim syntax is, as we were talking before, there are languages which are easier to grasp coming from the ones I know a bit already. :) And BTW, just yesterday I read about the Deque DS in Crystal, which I never met before... And now I see it in use in your Nim code. It's good to try different things, there's always new stuff to learn! :D

sotolf,

deleted_by_author

  • Loading...
  • array,
    @array@fosstodon.org avatar

    @sotolf I read the Ruby creator explaining the principle of least surprise as "principle of least my surprise", meaning, not many surprises when you know the language well (he points out how C++ was still surprising him after some years using it). I guess Nim is good according to such principle's definition, and then some. :)

    The Deque seems similar in Crystal, it's intended for stack and queues' efficiency (FIFO, LIFO). It's curious I had never met the concept before though. :)

    sotolf,

    deleted_by_author

  • Loading...
  • array,
    @array@fosstodon.org avatar

    @sotolf This is very interesting, thanks for the explanation. :) And yeah, knowing the rationale behind the abstractions actually helps with coding... It's nice when it's not just " I'll use this because it works", but "I'll use this because I know it's faster/more efficient/better suited for this use case". :)

  • All
  • Subscribed
  • Moderated
  • Favorites
  • random
  • DreamBathrooms
  • thenastyranch
  • osvaldo12
  • magazineikmin
  • GTA5RPClips
  • rosin
  • InstantRegret
  • Youngstown
  • slotface
  • ngwrru68w68
  • kavyap
  • khanakhh
  • Durango
  • mdbf
  • JUstTest
  • everett
  • ethstaker
  • normalnudes
  • cisconetworking
  • tacticalgear
  • cubers
  • modclub
  • provamag3
  • Leos
  • tester
  • anitta
  • megavids
  • lostlight
  • All magazines