Sometimes a new job or contract will come with the discovery that the codebases on which we are asked to work are not what we were expecting, to put it lightly.
Such as,
* saturated with anti-patterns to the point that it's a massively negative impact on productivity
* excessively long compile / build times due to lack of maintenance and/or things just not being built well
* severely outdated tooling and versioning
etc.
While this can be a workable situation sometimes, an opportunity to contribute in a meaningful, positive way, in others it can be a tedious slog.
A developer can ask questions during the interview process about these things, which can sometimes illuminate these issues.
If an organization's developers are active in open source contributions, that can be a helpful signal as to the quality of a codebase.
And, it occurred to me that there's a big double standard in hiring around this. It seems like the software development process, generally speaking, is built on what is essentially a lack of trust in engineers - we can come in with over 10 years of verifiable experience, talk eloquently about that and our abilities, and still be met with these ridiculous and demeaning puzzles.
Why should we not be able to look at the code at a place we are thinking about working at? It's a CORE part of the job. To be blind to that doesn't feel right to me.
If/when I decide to look for a different position, I'm considering to ask employers if they would be willing to let me sign an NDA so that I can take a look at the code on which I'll be working. Or at least some portion of it.
I'm curious how this idea lands for people reading this post. I can envision a world where this is standard practice in hiring.
I'm curious to also hear reasons as to why this couldn't work in practice.
EDIT: changed non-intentional ultimatum-esque language
With such a high potential cost, you'd want to buy something important. I don't think code quality matters that much. It's probably crap, it's probably fixable, and you'll probably get accolades for tracking down thorny issues and for sweeping changes that make it better. If you accidentally hit upon a company not using version control and not willing to change then in such rare cases you can grab another job in a couple weeks.
Unless some extraordinary scenario applies where you need each prospective job to have as high of a chance of success as possible (H1B quasi-slavery and whatnot), I don't think I'd bother even asking about code health.
There are some terrible software patterns that someone might not want to work with, but such things can be found in every team of every company. My experience is that good engineers will gradually come to own whatever legacy they have inherited and either clean those up or rewrite them until they are satisfied. So for the purpose of not wanting to work with tech debt, asking to see the codebase seems futile.
But a codebase is also a reflection of culture, and it's reasonable to want to understand what culture you will be getting into. For example, if every other code comment contains a juvenile joke and that's the sort of thing that will offend you, that might not be a place you want to work. Cleaning up code is much easier than cleaning up culture.
>I will, in fact, claim that the difference between a bad programmer and a good one is whether he considers his code or his data structures more important. Bad programmers worry about the code. Good programmers worry about data structures and their relationships. -- Linus Torvalds
So really, why ask for just the code? Why not ask for a copy of their database as well? That's even more important. It has all the relations and structure, the customer data, the data points they use to judge success, etc.
I think you can imagine plenty of reasons why they'd say no to that. And the reasons regarding proprietary code, while not as strong, are not all that different.
Of course, it would be nice if they had something to show. A lot of companies do some work on open source modules that they use, so they should at least be able to show that.
But that's not necessarily indicative of their entire legacy codebase, nevermind their data structures. And many companies have some nice new code that they're working on, but still have to support lots of old legacy code as well. So you really need to be able to deal with that anyway.
I interviewed with the CTO at a series A, and he was enthusiastically talking about how good their CI and developer productivity was. I asked him to show me, and he happily solved an actual UI bug in front of me to show off the system. Left a very positive impression.
Hiring managers at big companies probably wouldn’t risk doing this, because they don’t know whether it’s allowed. Although maybe they would if it’s something they’re proud of and they have a bit of an anti-establishment streak.
show me a random file that exists in every codebase but isn't sensitive, like the entrypoint
show me your jenkins / CI, how long do they take, how often do tests flap
screenshot of datadog / sentry
all that said, in the case of ML, I'm guessing even the dependency graph is giving away some hard-earned information like 'this implementation of this algorithm works best for our domain'
Granted, there is the problem of academic cheating in CS so for people coming right out of college into the job market, so it's likely an acceptable filter for screening out people who haven't ever really written their own code from scratch, but otherwise. for people with proven track records in the industry?
Maybe the thinking is: "We've got this mess of a codebase, it's poorly documented, if it ever got out how bad it is we'd be very embarrassed, and we want compliant team players who won't shake up the boat or demand we overhaul the whole thing, as we care a lot more about revenue than code quality, and this thing does work, sort of, most of the time, and we sure don't want anyone writing memos about massive security holes to upper management... now, will you jump through these degrading hoops like a good little poodle or not?"
How about this instead? Ask to briefly shadow some of the team as they do their normal work. You will hopefully get a much more real impression of what working there is like.
I once had an interview last several hours, and in the middle they sat me down with one of the existing workers for a 45 mins chat. The guy talked about watching movies on shift - it was an honest chat.
ps. I work for an employer where almost all our code is open source, so we would find this an easy question :-)
Two of Joel questions cover example downsides (slow builds, bad tooling), post is from year 2000 - so in theory asking about source control might be silly but if company is not using GIT in 2022 I would slowly (not to make any sudden moves) try to find my way out of the interview room because there is seriously something wrong there.
https://www.joelonsoftware.com/2000/08/09/the-joel-test-12-s...
This is called a "power imbalance". So long as it's possible to recruit developers despite all these things, they will continue. Unless you manage to cartelize people into refusing to work under those conditions.
* Legacy code that was written by people who left long ago and nobody wants to touch
* Code written in "uncool" languages, frameworks, and libraries that nobody wants to touch
* Code that was written by various offshore contractors
* Non-deterministic test suites that randomly fail and that engineers learn to skip/ignore rather than address
* Long build times
* Weird, bespoke code that was written for "fun" rather than using an established library or framework
* Microservice hell - impossible to tell what the codebase actually does since the true business logic is distributed across so many different services, and only an old-timer will be able to tell you how they all connect together * Severe lack of internal documentation
Given the above, when trying to select an employer, I think it's more important to carefully evaluate the people you'll be working with:
* Are they pragmatic or idealistic?
* Are they chasing fad technologies or are they comfortable using established frameworks that get the job done?
* What do they value more highly, delivering useful software or developing byzantine processes for everything?
* What percentage of the workforce is full-time vs contractors?
* What's the average years of experience of the engineers? Are there any adults in the room?
* Do people know the vision of the product? Do they what they're building and why they're building it?
That code would also have to be vetted in case there's anything sensitive in it security-wise..? Also, source code in itself wouldn't tell you about the processes that are in place or not (how easy it is to deploy code, what's the review process like, etc.)
On the other hand, you should ask questions to learn as much as you can about the development practices. Getting answers to the Pragmatic Engineer Test [0] (based on the classic Joel Test [1], which is useful as well) will probably tell you a lot. Learning that code isn't tested (and that there are no plans to add that, or worse, testing is not considered valuable in general), and/or that code isn't versioned, would be obviously informative.
Finally, from personal experience, I'll add that as a freelancer, you typically get more leeway re: asking to see code. Specifically, if a client comes to you to help them with a project, it's much easier to ask to see the existing code to understand what the current state of it is, and to give an accurate assessment of how much work will be required.
[0] https://blog.pragmaticengineer.com/pragmatic-engineer-test/
[1] https://www.joelonsoftware.com/2000/08/09/the-joel-test-12-s...
If seeing the codebase is an important part of your decision (ie not just knowing what stack/libraries are in use) you may wish to apply for an open source oriented company.
It helps candidates to know where they’d be getting into and also serves as a starting point to very interesting conversations with them.
It helps that I work for an open source company so our code is public anyway.
In other cases we saw bad codebases, and asked for 10x more. Which they paid. And it really was 10x more the effort, as it turned out.
"We" is not a single employee, but a contracting company. So our leverage is better, compared to a lone wolf.
Some of the code was the worst I've ever seen. 50 classes in a single file, 10,000 lines long, almost impossible to navigate, due to needless OO "lasagna" layers.
(They sure had lots of unit tests though!)
If you’re considering a tiny startup desperate for developers then YES, it’s an easy ask.
It will not work in any other environments because of the power imbalance.
That's to weed out people who did a 'bootcamp' or watched one youtube video and decided to quit flipping burgers and call themselves a 'senior engineer'.
Tldr: ask to see the code. Interview them, its a two-way street.
Observe your interviewers: is the interview a questions-answers style process, or are you having a conversation? Do they come over as enthusiastic or rather as close to burnout? Those are tell tale signs of how it will be to work with them.