clay schöntrupnum-paths exerciseour challenge is to write a function to return the number of paths we can traverse from the upper-left corner of a grid to the lower-right…Jun 8, 2022Jun 8, 2022
clay schöntrupsimpler enums in typescripti often see typescript enums used as constraints for redux actions and the like. for example:Feb 10, 2023Feb 10, 2023
clay schöntrupordered dependencies problemproblem: given a graph of dependencies, write a function to return an array of ordered dependencies. that is, no dependency comes before…Apr 25, 2022Apr 25, 2022
clay schöntrupBetter Rails Partial RenderingHere was my problem. I wanted to render a polymorphic array like this.Jan 2, 20222Jan 2, 20222
clay schöntrupBuilding Arrays with Conditional Elements in RubyIf inspecting_users? returns false, the returned array will contain only the first and last elements.May 1, 2021May 1, 2021
clay schöntrupStimulus.js Lifecycle CallbacksOne common mistake I see in Stimulus controllers is that people use the connect() callback to set up event handlers when they really…Mar 31, 2021Mar 31, 2021
clay schöntrupMy RuboCop configBy far my favorite is Style/MethodCallWithArgsParentheses, which forces parentheses everywhere. Optional parens are one of my least…Dec 7, 2020Dec 7, 2020
clay schöntrupEnumerable in Go Using GenericsThe latest iteration of generics is amazing. Here’s a short proof of concept for a Ruby-like enumerable construct.Sep 6, 2020Sep 6, 2020
clay schöntrupDon’t use version constraints in GemfileThe “~>” is not a “min version specifier”. It is the pessimistic operator. For example:May 15, 20201May 15, 20201
clay schöntrupUse buildpacks not DockerfilesDon’t take my word for it, let these people make the case.May 16, 2020May 16, 2020
clay schöntrupAvoid #each_with_object (generally)In my experience, Ruby’s each_with_object (docs here) can almost always be replaced with a simpler more specific/semantic construct.May 18, 2020May 18, 2020
clay schöntrupDetails MatterWhen you’re a disciplined software engineer, particularly one working in the XP (Extreme Programming) school, it can be a bit challenging…Jan 1, 2020Jan 1, 2020
clay schöntrupAvoiding Type Assertions in GoPrefer Polymorphism to ConditionalsNov 29, 2019Nov 29, 2019
clay schöntrupOOP vs. FPI’ve come across countless articles debating the merits of object oriented programming (OOP) vs. functional programming (FP). I want to…Jul 11, 20191Jul 11, 20191
clay schöntrupOAuth and TDD in GoI recently set up some Go code to communicate with the Nielsen API using OAuth. In addition I wanted to use the VCR library to record and…Jul 5, 2019Jul 5, 2019