Is this candidate a genius or a potential disaster?



  • I've employed a lot of developers but I still don't feel confident I know how to spot the good ones. After I've worked with them for 3 months I feel confident in my assessment but by then it might be too late.

    A German guy came in and immediately impressed me with his german accent, no-nonsense attitude and general confidence. He had no time for politics, no particular aspiration to be promoted to management, he just wanted to get on with the job and do what he's best at: code, with minimal interference. A lot like me. I asked him why he left his previous job and he complained that he was unhappy there...micromanaged and not allowed the freedom to implement processes that he thought would benefit the company, such as unit testing.

    I nearly hired him on the spot but I found a guy who was even better and then we had a debate about whether to hire 1 or 2. After we agreed we needed 2 new guys I called the german guy back for a 2nd interview. There was one thing that bothered me about his first interview: he said he liked all his class files (this is C#) to be under 250 lines-of-code. He says this is a discipline he finds helpful to reduce complexity.

    In the 2nd interview it was difficult to get him off the topic of unit testing. The conversation seemed to turn back to that at every opportunity. We have 411,000 lines of code in our project and no unit tests. We have a lot of UI code in which it's hard to define "the correct answer". We've done very well without unit testing, we double in size every 2 years, and we have a low rate of regressions or customer complaints. Maybe we would have done even_better with unit testing, but that's uncertain. There's a lot of stuff we wanted this german guy to do and I didn't want him spending his first 18 months writing unit tests for 411,000 lines of code. To get myself onto the same page as him, I asked him to show me some examples of his unit tests. He showed me one unit test which was 5 lines of code to test some really simple function...it wasn't exactly "Math.abs()", but it was something at a similar level: "assert abs(5) == 5; assert abs(-5) == 5;" and stuff like that. Suddenly I started feeling more sympathetic towards his former boss who forbade him spending any more time doing unit tests.

    Then I wanted clarity on his opinion that every class should be <= 250 lines-of-code - just how literally did he mean this? Our class files vary quite enormously in size....it's all a question of what the class is trying to do, and it never occurred to me that I might actually reduce complexity by spreading the lines-of-code over multiple classes...artificially breaking a class into multiple pieces. I am still the main programmer of our flagship product....was he going to make my baby unrecognisable to me? Would we be having arguments about whether splitting a class into 2 pieces is reducing complexity or increasing complexity?

    To my relief, he said this figure of "250" is only a "rough guide" - you don't need to follow it too strictly. I drilled down a little further - I said "what about if you had e.g. 400 lines?" He said "Oh - then I would definitely split that class." After that point it was not a real interview...I interrogated him further only out of morbid curiosity....how? why?

    I'm glad we did the 2nd interview.

    In the samples of source-code he showed me from his previous project it's true it all seemed quite simple...there didn't seem to be complexity anywhere. In fact I don't recall ever seeing a loop inside a loop and there were in fact very few loops or branches. Most of the files were full of 1-line methods, methods calling methods in other classes. It did seem to do something useful, but I couldn't see where the work was done. Perhaps he was right - he'd eliminated all complexity by breaking it up into enough small pieces...? Did I make a mistake in not hiring him?



  • @tcotco said in Is this candidate a genius or a potential disaster?:

    Did I make a mistake in not hiring him?

    no, you didn't. you would end with tons of raviolli code



  • @fbmac said in Is this candidate a genius or a potential disaster?:

    @tcotco said in Is this candidate a genius or a potential disaster?:

    Did I make a mistake in not hiring him?

    no, you didn't. you would end with tons of raviolli code

    Yeah, but http://c2.com/cgi/wiki?ReadingRavioli


  • Discourse touched me in a no-no place

    @Captain
    The general rule is that each method(/function/procedure/subprogram) must have a well-defined purpose. If it's not clear why it should exist (other than “it makes some other code a bit shorter”) then it's not really serving a useful purpose. Clarity of purpose makes it easier to comprehend the contract of the method, and so to determine whether the code is really correct. (Types don't give the whole solution to that because types are deliberately simpler than the programs they are applied to.) Shortness is not the most important code metric; both correctness and readability are much more critical.



  • Yeah, I have a feeling that if he ever made a large enough project, it might get to a point where adding a small feature would involve changing hundreds of files.


  • 🚽 Regular

    Wow, this guys sounds exactly like someone I worked with about 8 years ago, German accent and all.

    We got jack shit done on a project with a tight deadline, because he spent most of his time bikeshedding with variable names and just how well our code aligned with S.M.A.R.T. principles, to the point we'd have 3-hour-long screaming matches between him and the CTO who wasn't as rigid on guidelines, especially if it meant delivering a still-decent product on time.

    He was especially rigid on single-responsibility, which he took to an extreme level. At one point we had a simple base class with an entity generic to perform basic CRUD operations. He said single-responsibility dictates that we need separate classes for creation, reading, updating, and deleting these entities. And, yes, functions ideally should be a single line, if at all possible.

    Of course, when you do stuff like that, limiting things to 250 lines is easy. It's the 2,000,000 files you have to maintain now that becomes a bitch.



  • @tcotco said in Is this candidate a genius or a potential disaster?:

    We've done very well without unit testing

    I have yet to see in my career any examples of these mythical unit tests that people keep talking about. Certainly, trivial tests for trivial classes don't really add any value. Most of the bugs that come my way arise from complicated, unforeseen interactions of several subsystems.


  • BINNED

    @tcotco It is a mistake not to hire someone just because you did not agree on 250 line mark. Well, unless you get many job applicants and can choose and be picky, and hope you wont get a charmer. If he is junior to you, and smart, perhaps he could see your point over time. Even better would be to write down your coding guidelines, and mention 450 lines before he joins. Nothing is worse than a code that changes appearance half-way.



  • @fbmac RAVIOLI RAVIOLI, STOP ABSTRACTING THE CODUOLI



  • @Groaner said in Is this candidate a genius or a potential disaster?:

    I have yet to see in my career any examples of these mythical unit tests that people keep talking about.

    So do I. I mean I have seen good comprehensive suites of automated integration and functional tests that did help debugging a lot. But they were not unit tests. They set up simple but complete execution environment and tested the functionality front-to-back over the public interfaces.

    Certainly, trivial tests for trivial classes don't really add any value. Most of the bugs that come my way arise from complicated, unforeseen interactions of several subsystems.

    That's why a good test suite must primarily have integration tests and black box functional tests.

    Unit tests do have their use. They are useful for debugging the lower layers so you can have some confidence they don't produce complete garbage while you build and test the higher layers. Just keep in mind it is not goal to have perfect coverage, goal is to have enough confidence in the layer to not block your progress on the others.


  • Discourse touched me in a no-no place

    @Bulb said in Is this candidate a genius or a potential disaster?:

    Unit tests do have their use.

    Sure. They demonstrate that individual components are correct and ideally also that the components have sane failure modes. Failure mode testing is important, and harder than checking that everything does the right thing when the world is beautiful.

    But as you noted, they don't demonstrate that the overall system is right.


  • Fake News

    @tcotco said in Is this candidate a genius or a potential disaster?:

    I interrogated him further only out of morbid curiosity....how? why?

    What did he answer then? Why would he do it, when would he not?

    @dse While you want to hire people with somewhat different ideas to keep your team diverse, you also need to check that they're pragmatic about those ideas. You don't want that the new guy starts a refactoring run which touches the entire codebase and introduces merge errors for your entire team when he should be learning the ropes of your business.

    Having a coding standard is nice but you want to make sure that they stick to it.


  • ♿ (Parody)

    @Groaner said in Is this candidate a genius or a potential disaster?:

    I have yet to see in my career any examples of these mythical unit tests that people keep talking about.

    We really rely on automated integration tests. Though we often refer to them as unit tests.


  • Winner of the 2016 Presidential Election

    @boomzilla said in Is this candidate a genius or a potential disaster?:

    Though we often refer to them as unit tests.

    Yeah, all of those terms are used pretty loosely. Whether a particular test is a functional test, integration test or unit test isn't always clear, either.


  • I survived the hour long Uno hand

    @tcotco My vote comes firmly down on you passing up a good thing. It sounds like you're not very practiced in software engineering yourself, just sort of blindly making the best of things:

    @tcotco said in Is this candidate a genius or a potential disaster?:

    impressed me with his german accent

    Seriously? :rolleyes:

    @tcotco said in Is this candidate a genius or a potential disaster?:

    I started feeling more sympathetic towards his former boss who forbade him spending any more time doing unit tests.

    Why? Any example you're coming up with in an interview is going to be contrived and a little silly, probably, because you don't have a real codebase to work with.

    @tcotco said in Is this candidate a genius or a potential disaster?:

    We've done very well without unit testing, we double in size every 2 years, and we have a low rate of regressions or customer complaints.

    My devs say the same thing. And, well.... Yamirant.

    @tcotco said in Is this candidate a genius or a potential disaster?:

    was he going to make my baby unrecognisable to me?

    Kill your darlings. No code is above reproach, and you need to be able to distance your feelings from your codebase.

    @tcotco said in Is this candidate a genius or a potential disaster?:

    it never occurred to me that I might actually reduce complexity by spreading the lines-of-code over multiple classes

    I'm getting the feeling you're fairly junior. Breaking classes down into smaller, more focused classes can make it easier to find what you're looking for.

    @tcotco said in Is this candidate a genius or a potential disaster?:

    there were in fact very few loops or branches.

    Let me guess, was it a very "functional programming" style codebase?

    The guy may or may not have worked out at your place. His style might or might not jive well with yours. He might or might not have annoyed you. But if you have no idea where he's coming from, and can't see any value in using his techniques.... that's a reflection of your own toolbox being lacking, not his.


  • I survived the hour long Uno hand

    @asdf said in Is this candidate a genius or a potential disaster?:

    Whether a particular test is a functional test, integration test or unit test isn't always clear,

    :rolleyes: Only because nobody bothers to learn what words mean anymore.


  • I survived the hour long Uno hand

    @dkf said in Is this candidate a genius or a potential disaster?:

    they don't demonstrate that the overall system is right.

    They're not meant to.


  • Winner of the 2016 Presidential Election

    @Yamikuronue said in Is this candidate a genius or a potential disaster?:

    Only because nobody bothers to learn what words mean anymore.

    To be fair, there are at least 5 different definitions of what "functional test" means.


  • I survived the hour long Uno hand

    @asdf Functional tests are tests that are meant to test the functional requirements, as opposed to nonfunctional tests, which test nonfunctional requirements (security, performance, et cetera).

    Which means unit tests and integration tests are a type of functional test.

    So are, however, the full-stack tests: UAT and Regression tests. As shorthand, the collected set of acceptance tests and regression tests are called "functional tests" because that's the narrowest commonly-named category they share. That's an acceptable alternate meaning.

    Unit tests test a single, indivisible unit of code: a single method, a single stored procedure, whatnot. Integration tests are the big grey area between unit and acceptance tests: they test a portion of the system, or portions of two systems that interact.


  • Winner of the 2016 Presidential Election

    @Yamikuronue said in Is this candidate a genius or a potential disaster?:

    As shorthand, the collected set of acceptance tests and regression tests are called "functional tests"

    That's the definition we use. Except that the line between functional test and integration test is extremely blurry, since our product is a set of libraries.


  • I survived the hour long Uno hand

    @asdf For an API-only sort of solution, your acceptance tests will be black-box and your integration tests some level of white-box, typically mocking out tricky bits like the database or a third-party system you're interfacing with. You might only have unit and acceptance tests, and that's okay, because without a GUI your acceptance tests are in a lot better state (faster, more stable).



  • @dkf said in Is this candidate a genius or a potential disaster?:

    @Bulb said in Is this candidate a genius or a potential disaster?:

    Unit tests do have their use.

    Sure. They demonstrate that individual components are correct …

    Yes. Well, the problem with individual components is that they don't have any explicit requirements. The only arbiter of what is “correct” is the components above them and as those components evolve, the requirements are likely to evolve too. Too fine-grained unit tests will just get in the way of that evolution while not guaranteeing much as they will always be just catching up.



  • @Groaner said in Is this candidate a genius or a potential disaster?:

    I have yet to see in my career any examples of these mythical unit tests that people keep talking about.

    At my last job, we had a very complicated pricing system. We had unit tests for all of the edge cases and to check for regression of some of the more vexing bugs that happened in the past.

    We also had a PDF-to-image conversion process. Every time it choked on a weird PDF, we threw that in the suite of PDFs to be tested. Fixing the problem usually involved upgrading ImageMagick and the tests allowed us to really easily see if the new version handled all of the previous problem PDFs.



  • @Jaime said in Is this candidate a genius or a potential disaster?:

    We also had a PDF-to-image conversion process. Every time it choked on a weird PDF, we threw that in the suite of PDFs to be tested. Fixing the problem usually involved upgrading ImageMagick and the tests allowed us to really easily see if the new version handled all of the previous problem PDFs.

    If-you-find-a-bug-write-a-test is a great mantra, one that I've only recently discovered.



  • @AyGeePlus said in Is this candidate a genius or a potential disaster?:

    If-you-find-a-bug-write-a-test is a great mantra, one that I've only recently discovered.

    We had two mantras:

    If-you-are-a-contractor-or-newb-write-setter-and-getter-tests-but-nothing-else

    ... and ...

    If-you-are-somewhat-good-at-your-job-then-write-tests-for-the-things-that-are-important-to-test-but-don't-spend-all-day-writing-stupid-tests


  • BINNED

    @JBert said in Is this candidate a genius or a potential disaster?:

    Having a coding standard is nice but you want to make sure that they stick to it.

    How about also having code review? It comes in a package, and should be part of company policy. Give it a scary name that people's livelihood depends on it and they will stick to it.



  • I just wonder where they breed people like that.

    Good code is an optimum point of many parameters. The parameters are readability, no copy-paste abuse, getting shit done, complexity as reduced as possible, maintainability, performance, reliability, interoperability with whatever other shit there exists. These kinds of things. Software exists for a purpose. It either fulfills it or not, or matches the purpose within an acceptable tolerance.

    ...while having unit tests or not, 100% coverage, classes under 250 lines... you know, my teeth literally hurt as I enumerate this utterly insignificant shit! Oh gods. People, just get a fucking grip on reality. These are not even means to an end. These are means to means to an end. They are useful guidelines, but hell, don't put them on a fucking pedestal!

    That guy you speak of didn't acquire a skill. He's got a religion. He accepted some design dogmas into his heart uncritically. You don't want a religious fundamentalist working with you, especially if his religion impacts directly the stuff you are working on.

    Of course, you don't want on board a guy who hates unit tests as such, never did one, and who loves giant god classes with thousands of tentacles. They are really the avatars of the same guy, just dogmas are different.



  • @JBert said in Is this candidate a genius or a potential disaster?:

    Having a coding standard is nice

    every time I saw a coding standard, it defined stupid shit like spaces vs tabs, and did nothing to increase the overall quality of the software written



  • @wft said in Is this candidate a genius or a potential disaster?:

    my teeth literally hurt as I enumerate this utterly insignificant shit!

    You can learn a lot about a team by reading their coding standards. The worst teams do have a document, but it's full of bikeshedding and cargo-cultism. I'd rather have no standard than a ten page document on variable naming.


  • BINNED

    @fbmac said in Is this candidate a genius or a potential disaster?:

    it defined stupid shit like spaces vs tabs

    I have seen code with a mix of 2,4,8 white-space and Tabs. Looked like a public toilet, added my contribution and got out quickly.



  • @wft said in Is this candidate a genius or a potential disaster?:

    giant god classes with thousands of tentacles

    how many tentacles should a proper class have?



  • @fbmac said in Is this candidate a genius or a potential disaster?:

    every time I saw a coding standard, it defined stupid shit like spaces vs tabs, and did nothing to increase the overall quality of the software written

    This has a purpose, actually. You want your code formatted uniformly and all your developers to use the same formatting settings, because you want commits to be to the point. So they don't include unrelated shit with changes only to formatting. And yeah, corporate environment is a thing where there are very different people, with different level of indoctrination, so you want the policy enforced and not questioned much. You, as a team, have better purpose for your energy than petty formatting wars.


  • Fake News

    @dse said in Is this candidate a genius or a potential disaster?:

    @fbmac said in Is this candidate a genius or a potential disaster?:

    it defined stupid shit like spaces vs tabs

    I have seen code with a mix of 2,4,8 white-space and Tabs. Looked like a public toilet, added my contribution and got out quickly.

    I take it you used 3 spaces to shake things up?



  • @fbmac said in Is this candidate a genius or a potential disaster?:

    how many tentacles should a proper class have?

    The correct answer is "it depends".

    A shitty coder hears "everything should be in a class", so he does exactly this and puts everything into a monstrous class.


  • Discourse touched me in a no-no place

    @fbmac said in Is this candidate a genius or a potential disaster?:

    how many tentacles should a proper class have?

    That depends. Is it in Japan?


  • Notification Spam Recipient

    @fbmac said in Is this candidate a genius or a potential disaster?:

    @wft said in Is this candidate a genius or a potential disaster?:

    giant god classes with thousands of tentacles

    how many tentacles should a proper class have?

    I've watched a lot of anime and at an educated guess... seven!



  • @fbmac said in Is this candidate a genius or a potential disaster?:

    every time I saw a coding standard, it defined stupid shit like spaces vs tabs, and did nothing to increase the overall quality of the software written

    Yeah, and than someone new comes in uses tabs instead of spaces, reformats the entire doc and does a commit. Now your diff is every single line and you have no idea what the hell they actually changed.



  • @fbmac said in Is this candidate a genius or a potential disaster?:

    @wft said in Is this candidate a genius or a potential disaster?:

    giant god classes with thousands of tentacles

    how many tentacles should a proper class have?

    In software? Oh, probably as few as possible. In some cases you get lucky and only have one!

    Japan? I don't think numbers are the right question.



  • @tcotco If you can write this many words about how uncertain you are, you made the right decision to not hire him.

    All good companies I've worked for have a simple hiring policy: if you're on the fence about a candidate, say no. I've never seen that strategy go wrong.

    (BTW, on his 250-line rule for classes in C#, I agree that's a low number, but I also like smallish files and I make judicious use of partial classes to implement that. If he uses well-organized partial classes, that might be a complete non-issue.)


  • area_pol

    @fbmac said in Is this candidate a genius or a potential disaster?:

    every time I saw a coding standard, it defined stupid shit like spaces vs tabs, and did nothing to increase the overall quality of the software written

    @Dragoon said in Is this candidate a genius or a potential disaster?:

    Yeah, and than someone new comes in uses tabs instead of spaces, reformats the entire doc and does a commit.

    That should not be in the coding standard at all, instead it should be automated and inside some plugin of the version control software, which would auto-format everything to a canonical form.

    The possibility to store the same abstract-syntax-tree in many different ways is a pointless complication.



  • @dse said in Is this candidate a genius or a potential disaster?:

    I have seen code with a mix of 2,4,8 white-space and Tabs. Looked like a public toilet, added my contribution and got out quickly.

    Control-E, Control-D.

    If you spend more than the 3 milliseconds it takes to type that keyboard combination thinking about code style, you're using a shitty language with a shitty editor and you probably shouldn't be.

    For those of us with quality tools, it's been a solved problem for decades.



  • @Dragoon said in Is this candidate a genius or a potential disaster?:

    Yeah, and than someone new comes in uses tabs instead of spaces, reformats the entire doc and does a commit. Now your diff is every single line and you have no idea what the hell they actually changed.

    Click the "ignore whitespace" button in your diff tool. If you don't have one, then we're back to "you're using shitty tools, please stop using shitty tools".

    EDIT: admittedly that doesn't work well for refactoring, but for reformatting the changes should only be touching whitespace.



  • @blakeyrat Does this work as well for annotation? E. g., "show me who introduced that crap and when"



  • @blakeyrat Yeah, think that is what actually occurred. It wasn't on my project, just overheard the cursing after it occurred and a build broke.

    Come to think of it, why isn't that the default behavior in most diff tools? I work almost daily with a white space sensitive language and I still very rarely care about diffs showing me white space.



  • @wft said in Is this candidate a genius or a potential disaster?:

    @blakeyrat Does this work as well for annotation? E. g., "show me who introduced that crap and when"

    ?

    I have no idea what you're asking, sorry.

    @Dragoon said in Is this candidate a genius or a potential disaster?:

    @blakeyrat Yeah, think that is what actually occurred.

    What actually occurred? People using a shitty diff tool without the ability to hide whitespace changes?

    @Dragoon said in Is this candidate a genius or a potential disaster?:

    Come to think of it, why isn't that the default behavior in most diff tools?

    Most diff tools are open source, and open source software sucks shit.

    When VS runs diffs for C#, it not only ignores pointless whitespace changes, but it actually does some heuristic evaluation of the language itself and ignores meaningless changes that don't involve whitespace. But Visual Studio was written by intelligent people who cared about creating a quality product.



  • @blakeyrat Nah, after a long manual build process that failed, the guy in charge of it went to see why and when he diffed the file it showed every line as having changed. It was the end of a very long day and he was pissed.

    Not sure how it was ultimately resolved. I know the product got shipped to the needy customer.



  • @blakeyrat You see, I dunno how it's with other VCSes, but git has "blame" and "annotate", which allow me to see, on each line, who changed it last, when, and in which commit. If I see shit code, I use that tool to find out who I talk to. If people in addition to the things they really want to commit, commit unrelated whitespace changes their IDEs introduced, they inadvertently get "ownership" of these lines as well.

    Also, including unrelated code into a commit makes cherry-picking commits hard as fuck, but that's another story.


  • area_pol

    @wft said in Is this candidate a genius or a potential disaster?:

    commit unrelated whitespace changes their IDEs introduced, they inadvertently get "ownership" of these lines as well.

    The point is that whitespace change is not change, as the program's content is exactly the same.



  • @Adynathos Python



  • @Adynathos it gets committed to source control anyway. Otherwise, how the fuck do you even commit formatting changes when that's what you exactly intend to do?


Log in to reply