Skip to content
HomeVideosBooksBlogs
AllTop postsTopics
Podcasts
HistoryListsWatch laterLiked videosFollowing

The videos, books, blogs and podcasts Hacker News keeps recommending, all in one place.

VideosBooksBlogsPodcastsAboutPrivacySettings

Data from Hacker News, HackerTube, HackerBooks, HackerBlogs and Open Library. Credits · Not affiliated with Y Combinator.

HomeVideosBooksBlogsPodcasts
Ctrl K
    J

    James Shore

    jamesshore.com · Personal blog · on HN since 2008

    James Shore, a software developer and agile consultant, writes about testing, dependency injection, test-driven development, and agile practice.

    Visit blogRSSHN submissions
    ProgrammingManagementCareer & Work
    What HN says

    Commenters call his dependency injection post a favorite and a classic explanation of a simple concept behind a fancy term.

    Stats for nerds
    56HN people shared it
    74linked in comments
    1Kstory points
    Aug 2026last shared
    2012people per year2026

    Top posts on HN

    1. 1
      A useful productivity measure?
      1 person · 249 points · first shared 2024 · 177 comments on HN
    2. 2
      If we had the best product engineering organization, what would it look like?
      1 person · 215 points · first shared 2025 · 121 comments on HN
    3. 3
      The Accountability Problem
      1 person · 144 points · first shared 2025 · 60 comments on HN
    4. 4
      Cargo Cult Agile (2008)
      1 person · 111 points · first shared 2017 · 109 comments on HN
    5. 5
      Testing Without Mocks: A Pattern Language (2023)
      3 people · 92 points · first shared 2023 · 62 comments on HN
    6. 6
      Testing Without Mocks: A Pattern Language (2018)
      3 people · 57 points · first shared 2020 · 28 comments on HN
    7. 7
      How Does TDD Affect Design?
      1 person · 54 points · first shared 2014 · 43 comments on HN
    8. 8
      James Shore: The Decline and Fall of Agile
      3 people · 25 points · first shared 2008 · 11 comments on HN
    9. 9
      Cargo Cult Agile (2008)
      1 person · 8 points · first shared 2025 · 11 comments on HN
    10. 10
      Dependency Injection (simple explanation)
      9 people · 7 points · first shared 2011 · 2 comments on HN

    What HN people wrote when they linked it

    • rednosehackerAug 2020

      Hey Normille,

      I am glad you asked !

      "Genuine question. I've read so many times about why I should practice TDD that I believe it in theory. But I've never seen a beginner's example that has actually seemed like it would provide the claimed benefits."

      You need to find ressources to show you. I think when you see a thousands lines long codebase (divided in modules, classes, files, ...) with a test suite which fail immediately when a feature - you are not even working on so you where not meant to test immediately - breaks because of your current refactoring you thought was cool... Voila!

      "Why is writing a test that takes one single specified input and checks for one single specified output "better" than just writing my code and then trying to break it by [metaphorically] hitting the "Do Not Press!" button, by throwing as much incorrect, malformed or otherwise "wrong" data at it, as possible. "

      Did you see the test to fail before you write your code ? Maybe you don't need to write it haha. Maybe your test don't fail for the good reason. If you don't write your test before to see it to fail for the good reason, how are you sure you write code to actually do what it is supposed to ?

      To me learning TDD is like learning martial art (I talk about my own experience haha). You need to practice. Some say it need discipline to stick to it enough, sometimes you are not convinced but you just push the experiment a bit further and there you get it !
      Maybe you like to read, to watch,…

    • still_grokkingJun 2023

      No, it isn't.

      The benefit that some code (maybe) provides is an asset. The code as such is strictly not.

      Nobody would even look at your code if you don't compensate them with some benefits.

      Exactly that's why nobody touches random "free code" even with a ten foot pole if there aren't very strong reasons to do so.

      If you could have the benefits without the code any sane person would prefer that.

      Code is just cost. You don't want code as such as already just owning it has steadily increasing costs. You just want the benefits out of it.

      If there's a solutions to a problem where writing new code can be avoided this is almost in any case the cheapest and most preferable solution.

      Only junior devs think code has value. But the truth is you get more value if you're senior skilled and smart enough to avoid wasting your time on writing (more) code.

      Code is a means to an end, not a means in itself!

      Given that, the best approximate measure of technical dept (and with it security issues, bugs, and in the end of the day cost) is: Lines of code!

      https://www.jamesshore.com/v2/blog/2008/an-approximate-measure-of-technical-debt

      Now, a smart and really helpful AI for programmers would try very hard to achieve the stated goals but delete on it's way as much code as possible. Because that's the only way to lower cost in the long run and keep things maintainable.

      Any AI that does the opposite, and just creates mostly completely mindless piles of more and more code, is like an oven…

    • _audakelJun 2016

      Beign at either extreme, moving too fast or moving too slow, is problematic. A related field to medical is the Space + Rocket industry. Heavily regulated and if you make a mistake people die.

      For much of the lifetime of the industry, NASA was the best there was. They embraced a "zero bug" mentality (http://www.jamesshore.com/Agile-Book/no_bugs.html). It resulted in very slow and costly development and we accepted that as the way things where, ie very expensive and little progress.

      SpaceX came in with a move fast and break things mentality. They did not approach this in the way that had always been done (move slow and make no mistakes). They have greatly reduced cost and increased capability to a level that arguably would never have been reached by NASA, all without loss of life.

      We don't need to test or develop medical in a haphazard way, but do have to accept that the way things work currently will not result many advancements (at least not rapid advancements). FDA regulations are fine until you realize that you have a currently incurable medial condition, and wonder if medical innovation was easier if you would have a cure.

      Is the regulation to ease fear of a potential death/injury worth the many real deaths of people who we do not have treatments for?

    • rsanheimApr 2025

      It isn't a matter of trust, its a matter of developers are humans. Humans make mistakes, and continuous integration helps catch mistakes.

      I've been coding for 25+ years, and I sometimes I forget to remove debug output, or I forget to update an explicit exception I threw somewhere, or I forget to make sure dependencies build across all the platforms we need.

      Running your build a second machine helps to catch a lot of those mistakes. It also helps enforce automation and good configuration practices and lint/formatting standards and all that, but fundamentally its helps us because humans make mistakes.

      CI doesn't have to mean setting up a 12 step pipeline in GH actions with 3k lines of yaml and crazy triggers and workflows. It can just be an old dev machine (https://www.jamesshore.com/v2/blog/2006/continuous-integration-on-a-dollar-a-day) that pulls the latest code, runs `script/build`, and POSTs results somewhere.

      Maybe local signoff works for 37signals, if so, thats great. But it isn't continuous integration.

    • nilliamsOct 2014

      What you just wrote as a code example is Dependency Injection, it's just manual dependency injection as opposed to using an IOC container or any of the mechanisms Angular provides.

      I am very much in favour of the approach you posted. That's exactly how I write my code (I don't currently use Angular), but yep ... that's DI. As James Shore said 'Dependency Injection is a 25-dollar term for a 5-cent concept'. [1].

      What you show in that code example is what in my head I call "poor man's DI" or ... "passing stuff in" but it's actually my favourite kind as it demonstrates the fundamental idea and is easy to explain to people - as soon as you start talking about IOC and service providers things start to get murkier. I think that's definitely where Angular is losing some people. You can get a long way with the basic "poor man's" approach.

      [1] http://www.jamesshore.com/Blog/Dependency-Injection-Demystified.html

    • jdlshoreMay 2012

      I love the idea, and when I created a search engine for http://jamesshore.com, it complained that the web page doesn't exist. Ditto for http://www.jamesshore.com. Trying again colored the "Name" field red without any indication of what was happening.

      After poking around a bit more, it looks like my search engine was created. But when I click it, I get an error message: "You have not created any DocumentTypes in James Shore yet. Please use the API to get started." This is despite selecting the "Crawler" option when creating the engine.

      Also, deleting an engine asks me to confirm, but then doesn't actually appear to delete it.

      I want to love this tool, so I'm looking forward to when these growing pains are resolved.

      Edit: A third attempt appears to have worked. I'm guessing you're seeing a lot of load, and your code isn't handling timeout errors well?

    Related

    Rachel Krollrachelbythebay.com493 people

    fork() can fail

    Rachel Kroll
    Personal · last shared 2026
    Let's Code JavaScriptletscodejavascript.com23 people

    Let’s Code: Test-Driven JavaScript

    Let's Code JavaScript
    Personal · last shared 2022
    James Bachsatisfice.com30 people

    Advice to Lawyers Suing Toyota

    James Bach
    Personal · last shared 2026
    Jessitronblog.jessitron.com64 people

    Hitting OKRs vs. Doing Your Job

    Jessitron
    Personal · last shared 2026
    Giles Bowkettgilesbowkett.blogspot.com138 people

    Went Off The Rails: Why I'm Rebuilding Archaeopteryx In CoffeeScript

    Giles Bowkett
    Personal · last shared 2018
    SoftwareMill Blogsoftwaremill.com55 people

    Hiring Developers in a Remote and Distributed Company

    SoftwareMill Blog
    Company · last shared 2026
    The Valuable Devthevaluable.dev34 people

    A Vim Guide for Advanced Users

    The Valuable Dev
    Personal · last shared 2025
    Never Work in Theoryneverworkintheory.org73 people

    “Extremely angry with the state of academic CS research right now”

    Never Work in Theory
    Publication · last shared 2026