←back to thread

Please stop the coding challenges

(blackentropy.bearblog.dev)
261 points CrazyEmi | 3 comments | | HN request time: 0.6s | source
Show context
agentultra ◴[] No.42149111[source]
> When was the last time you had to debug an ancient codebase without documentation or help from a team?

All the time. 300-400k SLOC in C++. Legacy in the sense that there were no tests of any kind. Little-to-no documentation. Solo developer at the tiny company. Fix bugs and add features while keeping the system available to the tens of thousands of users.

A more recent example: here’s a patch for a critical feature we need. It was written over a year ago. The original author isn’t available anymore. You can write the code from scratch or try to resurrect the patch against master.

Being able to jump into a project and lead people towards some goal is definitely a skill for senior developer positions. Yes, you generally have a team you can lean on and have the ability to do research and all that. But how do you show that you can do all that in an interview?

Agree with the conclusion that a good thing to test for is for problem-solving.

The tech side depends a lot on what you’re doing. Although it gets ridiculous and organizations get lazy with this part. You don’t need to be white boarding graph algorithms for a junior web developer role. If your application is a social networking role and you’re interviewing a senior developer or architect? Definitely. They’re going to be teaching this stuff and need to understand it at a deep level.

replies(25): >>42149161 #>>42149283 #>>42149381 #>>42149490 #>>42149504 #>>42149546 #>>42149679 #>>42150007 #>>42150216 #>>42150233 #>>42150322 #>>42150383 #>>42150537 #>>42151066 #>>42151233 #>>42151287 #>>42151513 #>>42152496 #>>42153372 #>>42153374 #>>42155334 #>>42155491 #>>42157152 #>>42162104 #>>42194406 #
1. dakiol ◴[] No.42150007[source]
Don't understand one thing: I can read any code of any legacy code base, sure. What I cannot do is to asses if the code is supposed to do its job (e.g., the business logic behind it). Is the code I'm reading supposed to calculate the pro-rated salary according to the "law"? Just by reading the code, you cannot know that. You need help, either from other developers who perhaps know the codebase of from product experts that know the business logic. Or documentation, sure, but this is usually a luxury one doesn't have.

So, definitely, I always need help debugging any kind of code (unless it's rather code that doesn't deal with product features).

replies(1): >>42150317 #
2. agentultra ◴[] No.42150317[source]
> What I cannot do is to asses if the code is supposed to do its job

You can, to a degree. If you can get the system under test you can make an assertion about how you think it works and see if it holds. If you know what the "law" is you can test whether the system calculates it according to that specification. You will learn something from making those kinds of assertions.

Working Effectively with Legacy Code by Michael Feathers goes into detail about exactly this process: getting untested, undocumented code people rely on into a state that it can be reliably and safely maintained and extended.

Depending on the situation I often recommend going further and use model checking. A language and toolbox like TLA+ or Alloy is really useful to get from a high-level, "what should the system do?" specification down to, "what does the system actually do?" The results are some times surprising.

You're right that at some level you do need to work with someone who does understand what the system should do.

But you can figure out what the system actually does. And that is de facto what the business actually does... as opposed to what they think it does, logic errors and all.

A good senior programmer, in my opinion, thinks above the code like this.

Update: interviewing for this kind of stuff is hard. Take-home problems can be useful for this kind of thing in the right context. What would you do differently?

replies(1): >>42153533 #
3. polishdude20 ◴[] No.42153533[source]
There's also the likely chance your business doesn't have good documentation on how features should work, there are no tests and the thing you're testing is fairly custom tailored to your business that you need to have someone with knowledge of the product and history of it to tell you "oh yes that's supposed to happen that way".

Sure if there is a law written down or past written regulations your business follows, that's easy. You've got docs.