Live data from Hacker News

New Grad vs. Senior Dev

ericlippert.com

161–170 of 392 posts

Re: New Grad vs. Senior Dev

#161

> The skipto method is a single x86 machine instruction. That’s not always a good thing, especially on modern hardware. And obviously, the “single instruction” doesn’t mean it’ll take bounded time to execute…

Tangentially to your point, here's something I haven't thought about much: when these instructions get an interrupt, I imagine they've updated (r|e)si and (r|e)di, (r|e)cx etc. to reflect where they are in their copy or scan loop. So if you get a page fault in the middle, then the kernel does enormous amounts of work in response to it, then resumes that single instruction, it resumes in the middle of the loop, not th…

Pretty pointless as said page fault would occur no matter how you access the string. Besides, the page in question would very likely be already present.

Re: New Grad vs. Senior Dev

#162

Imagine that the intern didn't dare to ask such questions. a - he could've gone out thinking that performance doesn't matter. but it certainly does in a piece of code being used daily by thousands of devs. b - he could've thought that the simple implementation is faster but missed the fact that skip is implemented in assembly. c - he could've realized both but missed the why. and these failure scenarios are likely to…

> he could've thought that the simple implementation is faster but missed the fact that skip is implemented in assembly

It’s not; the compiler is just fairly decent at transforming string manipulation routines.

Re: New Grad vs. Senior Dev

#163
post #92
post #57

Earlier quoted context omitted.

The open source intrusion detection system Suricata [1] used aho-corasick until intel released hyperscan [2] in open source. Hyperscan is apparently more performant than aho-corasick. If your language can handle the C libraries, have you considered trying hyperscan to see how it compares? [1] https://suricata-ids.org/ [2] https://www.hyperscan.io/

Based on their use of past tense, I’d assume they aren’t interning there anymore.

I am not, and the company is known for having a fairly strong not-invented-here syndrome.

Re: New Grad vs. Senior Dev

#164
Sometimes it’s not just coding tools/techniques where new grads can benefit from a bit of oldster wisdom, like that one time I convinced a new grad it was wiser to slog through the bureaucratic approval process for a new api than attempt to hack into our company’s Oracle Financials db.

Re: New Grad vs. Senior Dev

#165

Shockingly, InStr( , "docum") = 0 I'm a dev with some grey hair who feels it would have been useful for all that fantastic domain knowledge from Paterson to get documented in a code comment. I'd love to hear if either of them ever went back and did that?

I was looking for this, thank you. I cannot get over when people try and keep all this knowledge in their head. Have they never worked on something written by someone other than themselves? I know it usually isn’t, but it really feels like some kind of hubris that makes people allergic to writing a paragraph block comment in the code.

Re: New Grad vs. Senior Dev

#166
post #66

I see these senior vs non-senior engineer contrasts pop up a lot. I’m not a huge fan of them. It seems that there is a spectrum of skills an engineer could excel at: programming, infrastructure, managing, planning, etc. I’ve known senior engineers who only excel at a particular skill. I’ve also known senior engineers who are moderately good at many but not particularly good at one. In my experience the only differenc…

If you accept the system that promotes an engineer into a senior position, there is no arguing that a senior engineer does posses skills that a junior doesn't. The junior is going to be evaluated in the same system.

Re: New Grad vs. Senior Dev

#167

Earlier quoted context omitted.

Thanks for the context. The example you describe supports the meme better. Sorry for being harsh, I got triggered by that code inside the printer, because I've dealt with a lot of dumb "I don't know how SQL joins work, so I'll use my ORM to do it and filter the data in code" cases early in my career, and I have sort of an allergy to that now.

I see this so much in Rails codebases that at this point the two are nearly synonymous in my mind. But maybe I’ve been cursed to work only on bad Rails projects or something and there’s a universe of them out there that aren’t full of that sort of thing.

There are rails codebases written by people who love both ActiveRecord and SQL and try to optimize both performance AND developer productivity. ;)

Re: New Grad vs. Senior Dev

#168
post #75

Earlier quoted context omitted.

It could be faster than some alternatives under some circumstances. A loop would probably be more code (== icache pressure) and would consume at least a register and a BTB entry.

It's certainly been a while since I last optimized for the original Pentium architecture. Still faintly remember U & V pipes, unexplained causes for stalls, etc. As even nowadays, it would likely depend on the particular algorithm and data set. I'd be surprised if you can't do better than 4 cycles per char for sufficiently long strings. Most likely for short strings, REP SCASB wins due to setup costs. (Actually that…

> The hypothetical faster-than-rep solution would need to process data in 32-bit chunks, faux vector style.

Or with real vector style with vectorized instructions?

Re: New Grad vs. Senior Dev

#169

Most FAANG job interviews would fail you if you did the brute force solution, it seems.

I feel that most will be sympathetic if to you explain why you did something a certain way and showed that you understood the different approaches available.

Re: New Grad vs. Senior Dev

#170
post #75

Earlier quoted context omitted.

It's certainly been a while since I last optimized for the original Pentium architecture. Still faintly remember U & V pipes, unexplained causes for stalls, etc. As even nowadays, it would likely depend on the particular algorithm and data set. I'd be surprised if you can't do better than 4 cycles per char for sufficiently long strings. Most likely for short strings, REP SCASB wins due to setup costs. (Actually that…

> The hypothetical faster-than-rep solution would need to process data in 32-bit chunks, faux vector style. Or with real vector style with vectorized instructions?

The original 1994 Intel Pentium did not have any vectorized instructions.
Post reply on HN