1. 3

    (for context: I’m a solid TDD believer and practitioner)

    My worry with TDD marketing is that people really get stuck on the “test” word and misunderstand it as “write the kinds of tests you currently write…except before the application code” and that just confuses everyone because the TDD tests are very different from the kinds of unit tests one would typically write. Tests are just a vehicle for the practice and I think they’re used to drive TDD because we typically have infrastructure in place that runs the test code quickly and easily.

    Either way, I like the framing that this post gives the practice as a versatile tool with many uses!

    1. 2

      That’s an excellent way of describing it! I think you hit the nail on the head - people get tripped up on the “test” part of it.

      When I’m “in the zone” with TDD it doesn’t even feel like writing tests at all really, it just becomes an extension of my design or coding process, and the “ceremony” or “separateness” of the tests kind of starts to fall away.

      BDD (behavior driven development) kind of moves away from thinking of this as purely a testing practice, at least by using the word “behavior” rather than “test”, but I don’t think many people think of BDD as writing tests first.

      I’ve often thought of TDD (and unit testing in general) as kind of like a visual design aid in which instead of a whiteboard or design doc, you visualize the problem by defining your inputs and your expected outputs. I might write another post similar to this one using the “visual learning” concept as a basis for another way of thinking about TDD.

    1. 1

      Key moment:

      Khan Academy set aside 6 weeks at the end of 2017 for the entire company to work on paying down technical debt

      Getting that sort of organizational buy-in is pretty special! Props to the tech leadership for making that happen.

      Also, I thought the footnote was interesting about how JS gets refactored as part of performance initiatives because there’s an incentive to get the bundles as small as possible. Makes me wonder if there’s some other performance metric you could attach to the backend that would naturally motivate the Python refactoring as well. I guess it just defaults to “velocity” which is hard to measure to begin with.

      1. 12

        After seeing too many “Rails is dead” rants from intermediate developers, who may have enough experience to make their own judgements but not enough to generalize to others' situations, it’s refreshing to read this.

        I agree. The future of Rails and of Ruby has less to do with raw speed or hipness than it does with having a smooth and long path from “quicky” web apps up to major APIs with many contributors and appropriate amounts of abstractions.

        In my own experience, on a number of small and verging-on-major Rails apps, the transition from the former to the latter scale of Rails project has always been marked by the creation of an app/services directory.

        1. 7

          sorry this is a bit off-topic but would you mind pointing me to what is implied by having an app/services directory? I’m currently learning Ruby/Rails at a new job that involves managing and extending legacy Rails apps and am trying to get a handle on what good refactoring paths are. I have experience doing similar work in Java but I imagine the Rails community has had plenty of time to come up with their own best practices for cleaning up technical debt.

          1. 7

            Not OP but, if you have a flow where you are orchestrating more than a few models, doing some mailings, etc, you could extract it to a Service object (or interaction, or interactor, or whatever you prefer to call it) A classic example of this popping up in a rails project is handling signups for a SaaS. You may have to create a few internal models (User, Account, Subscription), communicate with Stripe, and send welcome emails. It’s good to compose those into smaller actions, but you probably need something top level to coordinate.

            Some readings:

            1. 3

              Yeah, I also highly recommend that Code Climate blog post. A set of options any solo developer or team can start using right away and grow into over time as their knowledge of architectural patterns increases (and I say that as a technical lead still only confident in a few of ‘em).

        1. 1

          What about https://github.com/pholser/junit-quickcheck for Java? I’ve used it only a tiny bit but it has felt very straightforward and user-friendly.

          1. 13

            It fails the “supports example shrinking” requirement.

            In general QuickCheck ports that don’t support shrinking are basically a dead end because they’re more frustrating to use than it’s worth, and if you make serious use of them you end up wasting a lot of time debugging their output.

          1. 8

            Sounds similar in spirit to “Press release driven development” I’ve heard of being used at Amazon. If the imagined benefits to the user aren’t obvious or difficult to articulate then it’s possibly worth rethinking your approach instead of diving into development.

            1. 3

              I’m working on trying to read, understand, and write and run the clojure code on Yoav Rubin’s An Archaeology-Inspired Database which is basically an in-memory datomic-like database from scratch. I’m finding it super educational and interesting to both see at a very high level how something like this is put together and it’s also the most complex clojure stuff I’ve ever tried to write.

              Just got to the first few macros last night and that was a bit rough. I’m coming from a Java/Python background at my job and it’s tough to really wrap my mind around the fact that the forms passed to macros don’t have a “type”…they’re just lists of symbols that are manipulated into other lists of symbols that eventually become things to be evaluated.

              (Also would like to say that I really love the articles from the “500 Lines or Less” series so far. I find a lot of tutorials for languages or technologies out there to be a bit boring and as a non-beginner I like how this series dives into interesting problems and solutions very quickly.)

              1. 5

                I picked up my work on the Build Your Own Lisp book this weekend again. Implementing functions was exciting so I’m hoping to keep up the momentum and finish it up this week! It’s been the most C I’ve ever written in my life and I’m now wondering how difficult it would be to try learn some Rust by converting the finished product into it as a little learning project next.

                If anyone is curious about the book I highly recommend it.

                1. 1

                  I believe I read this once. The problem I had (as well as others) were the fact it just dumps a library for parsing at you, and you really don’t learn much from the random library dropped on you, especially when you could have written it yourself.

                1. 3

                  I’m working on implementing some basic load balancing and retry logic from our node.js server when communicating with clusters of backend services via HTTP. I’m usually a Java dev so a lot of the node patters are new to me. I got some great direction from the Joyent documentation on Error Handling in javascript/node.js. A really great piece of documentation that clarified a lot of stuff for me around sync/async error handling.

                  I wasn’t able to find any existing libraries that handle these kinds of problems. If anyone knows of anything they could point me to that would be great!

                  1. 4

                    This looks great! I especially like the tree visualization and manipulation. So many things become easier once you can “see the tree”.

                    I’ve settled on a workflow that combines command line for quick commits and work in progress. Then I load up Gitx (rowanj fork: https://rowanj.github.io/gitx/) and do interactive rebase or something and edit the commits one by one with good messages and add/remove chunks in the staging interface. I’ve tried a few times to get the hang of staging chunks via command line but while I understand it’s possible and fully supported, a visual UI works wonders and saves me a lot of time.

                    1. 6

                      So many things become easier once you can “see the tree”.

                      When teaching hg, I always tell people to alias hg log -G to hg glog, and I make a point of always telling them to use hg glog. It does seem to help. Our Windows hg users by and large use hg through TortoiseHg, which also has the DAG front and centre. I really don’t get why git users seem to have a habit of not really thinking about the DAG. The average git user thinks about branches, but cares little about their topology.

                      Remember that most VCS users don’t really want a VCS at all. Most, not the kind that posts to lobste.rs or HN, just consider babysitting history to be a chore, and hardly ever learn anything beyond four or five commands. Their method for getting out of trouble is to re-clone, or follow a convoluted path to get back to a state that they know what’s happening instead of trying to learn new ways around the state they’ve found themselves in. There is Google-backed usability research to back this up.

                      1. 2

                        git reset --hard all the things~

                      2. 3

                        i like git-cola for interactive rebases and the venerable gitk for exploring the graph

                      1. 3

                        Slightly OT: Are there any large/general-purpose eInk displays/devices?

                        1. 3

                          I really wish there was one big enough for papers/math books that wasn’t super expensive. I love reading on my Kindle but I basically can’t use it for anything work related.

                          1. 2

                            There is Sony Digital Paper [1] but last I checked it was prohibitively expensive for a tablet (>$1100)

                            [1] http://pro.sony.com/bbsc/ssr/show-digitalpaper/resource.solutions.bbsccms-assets-show-digitalpaper-digitalpaper.shtml

                            1. 1

                              I keep wondering whether the new high-ppi displays on kindle/kobo could be juuuuust decent enough for most papers…have yet to try them out though

                            1. 2

                              Haven’t read this yet but looks useful on first glance. Short and sweet.

                              I really wish every service/project people would write would have documentation around what architectural patterns it implements and why. Plus discussion of any deviations or “weird parts” that might not make sense at first, etc. It would really help put code into context right from the beginning for both writers and readers.

                              Anyone know of any open source projects that do this well? Would be great to see some examples for inspiration.

                              1. 2

                                Back in 2003, I hacked on a native Win32 client for AOL Instant Messenger. It uses a combination of a microkernel architecture + message (aka event) broker to decouple the application into pluggable features I called components that can be developed independently. It turned out pretty well, but working on a real implementation of the AIM protocol sucked up a lot of time. You can sign on to 1-n AIM accounts, set your away message, and message other users.


                              1. 4

                                People who are interested in URR may also be into the episode of Roguelike Radio where they discuss this game w/ the creator. (Also in general, I am a huge fan of that podcast. Recommended if you’re curious about roguelike games!)

                                1. 4

                                  Thinking about ways to visualize generative spaces, esp. for stuff like generative music. Wrote a blog post about an experiment I (w/ collaborators) just finished, which tags a generator’s control space with crowdsourced subjective word clouds, which is one angle. Might try to integrate something based on objective musical features also, like what the CataRT tool does for concatenative corpus-based synthesis.

                                  1. 1

                                    That looks so interesting! I’ve always had an idea in the back of my mind to create a generative ambient music engine for myself to just have on at work that I could tweak using various high-level parameters and have uninterrupted audio all day.

                                    1. 1

                                      Oh man, reading that blog post gave me some warm fuzzies about my days in my Computer music class back in College. Makes me want to start wiring things up and making god-awful sounds in Pd again.