@lain @matrix tests are a degenerate form of writing contracts for your code
@lain @matrix I'm half kidding and half serious, tests are good but imo best for regression prevention
@sun @matrix i think that's a difference between functional and imperative programming, the small-function style of most functional programming works well with test-first development.
@lain @matrix @sun nope. It all depends on how vast the input space is and how many possible combinations of edge cases it contains. That's one reason I switched from Erlang to Haskell some years ago. I still do tests in Haskell, but those are to catch regressions and to test against some known specification.
@lain @matrix in my last job I struggled with breaking up my code into meaningful smaller functions, a lot of my code was just munging data from one structure to another to satisfy some API input/output, or to make some kind of querying easier. that may have been specific to blockchain stuff though since it was really particular about data structures
@lain @matrix you have to know what you're doing to write tests first
@lain @matrix you can get me to write tests but you will never make me stop wanting static type checking
@lain @matrix I'll write tests for my python code because python is shit and I need tests to survive
@sun @matrix @lain tests are for stopping your developers from clobbering each other so hard nobody knows whose code broke the build

@sun Older Python code is the biggest struggle, lot of new Python code has type hints now

@matrix switching between python and nim fucks with my head so hard, because they're similar yet different enough that i keep making stupid mistakes
@matrix it feels like riding a bike where someone has swapped which brake lever is for the front and which is for the back, so every once in a while i pull the wrong one and faceplant for no reason
@quad @matrix Heh I wonder if it's standard or I just got lucky (I had like 3 different bicycles at one point, with 2 used regularly).
@lanodan @matrix I think it's standard but varies around the world. So for example most bike shops in Europe will mount the rear brake on the right. But if you go to Asia I've heard most bike shops would mount the rear brake on the left.

afaik it's kinda an "unwritten rule" which most bikers in a country/region have just silently agreed on.
@matrix then the java programmer comes in "my types, my types, i can't be seen without my types" :johnnybravo:
Sign in to participate in the conversation
Game Liberty Mastodon

Mainly gaming/nerd instance for people who value free speech. Everyone is welcome.