Live data from Hacker News

Subverting the software interview (2021)

nliu.net

31–40 of 80 posts

Re: Subverting the software interview (2021)

#31

> You have a tendency to overengineer things. Overengineering is an actual problem. For a tiny example, I'll see things like: enum MAGIC = 67; // explanation ... foo(MAGIC); The use of MAGIC is the only one, and is far removed. A better solution is: foo(67); // explanation because it improves locality. I also see things like an object fleshed out with all kinds of member functions that are never used.

I think I can see what you're getting at that you view this as a premature abstraction, but I don't think I'd call it over engineering. I'd call it a stylistic difference.

If `MAGIC` was sufficient to understand what the significance of the number was and `// explanation` was the citation or derivation, then I'd be fine with this, especially if there were a bunch of other constants with explanations with similar derivations or citations (eg a bunch of trig or constants from the same standard); then it'd be preserving a different sort of locality.

If `MAGIC` wasn't sufficient to capture the purpose of the constant & such a name wasn't readily available, so that you're always going to want to read `// explanation` (rather than only in the case you think the value is wrong), then I'd agree with you.

Concrete(ish) examples: if 67 terminated the Foo section of the Bar binary file format, even if we only used it once, I'd prefer to see END_OF_FOO rather than read a comment. Reading comments is context switching, at least for me. Names help me stay in the headspace of the programming language.

If 67 was the result of an ad-hoc calculation which only made sense in the context of this particular program (how many angels can dance on the head of an Acme brand pin executing our trademarked choreography) while, and so there wasn't a great name for that calculation, or at least not a name that would make sense unless you've already read the derivation, then I'd agree in that case.

That being said, I have absolutely seen overengineering or misengineering cause real problems.

Re: Subverting the software interview (2021)

#32
post #19

Earlier quoted context omitted.

You could have at least clicked on the LinkedIn link before assuming the author was a guy... https://www.linkedin.com/in/naomi-w-liu/

The name Naomi might have been a dead giveaway.

It can be a male name, here's a random example I found in Google: https://earth.stanford.edu/events/energy-seminar-naomi-hiros...

Re: Subverting the software interview (2021)

#33

> You have a tendency to overengineer things. Overengineering is an actual problem. For a tiny example, I'll see things like: enum MAGIC = 67; // explanation ... foo(MAGIC); The use of MAGIC is the only one, and is far removed. A better solution is: foo(67); // explanation because it improves locality. I also see things like an object fleshed out with all kinds of member functions that are never used.

In a code review, I’d given a junior programmer advice to avoid magic constants and use defines instead (c, not c++).

Resubmission came back with:

  #define SEVENTEEN 17
Last I spoke with him, he was a Java instructor.

Re: Subverting the software interview (2021)

#34

Earlier quoted context omitted.

> validate his code > by Naomi Liu

A name does not imply sex. Even if it did, the parent wrote multiple paragraphs and you get hung up on something as inconsequential as this. Take a day off.

[dead]

Re: Subverting the software interview (2021)

#36
post #24
post #2

Probably didn't pass the interview. The implementation was rather simplistic and low quality. Here's a better enterprise version: https://github.com/EnterpriseQualityCoding/FizzBuzzEnterpris... Though the fact that it was written some years ago might be a weakness. Some interviewers might prefere a more modern, distributed solution.

What about observability?

I was thinking of making a modern distributed spaghetti version some time.

FizzService, BuzzService, FizzBuzzService, CountingService, etc

Re: Subverting the software interview (2021)

#40

Another in this genre: https://aphyr.com/posts/342-typing-the-technical-interview

Quoting from aphyr as it still brings me joy and might encourage others to read through the interview pages there,

> “In Lisp,” you offer. “We often write domain-specific languages to solve new problems.”

> “C is not a DSL!”

> “If you insist.” Keep going anyway.

Post reply on HN