8 ms·
I particularly liked this part: > Knowing very little about USB audio processing, but having cut my teeth in college on 8-bit 8051 processors, I knew what kind
by TehShrike 2y ago
I particularly liked this part:
> Knowing very little about USB audio processing, but having cut my teeth in college on 8-bit 8051 processors, I knew what kind of functions tended to be slow. I did a Ctrl+F for “%” and found a 16-bit modulo right in the audio processing code.
That feeling of saving days of work because you remember a clue from previous experience is so good.
- djoldman 2y agoThose are the times one gets the opposite of imposter syndrome.
- ASalazarMX 2y agoFortunately it's a temporal state, otherwise there's risk of entering the Dunning-Kruger effect. "You did awesome, but don't let it go to your head."
- dylan604 2y agoF-that! That's one of those times where I re-enact the scene from the Bond Golden Eye film where the guy jumps up extending both arms yelling "Yes! I am invincible!" Of course I totally expect the hubris to be short lived, just maybe not with liquid nitrogen https://www.youtube.com/watch?v=fXW02XmBGQw https://www.youtube.com/watch?v=fXW02XmBGQw
- squigz 2y agoI alternate between "I am the best programmer to ever exist" and "I am completely incompetent at this and I should quit" while debugging.
- dylan604 2y agoI've been known to inform people that the person that wrote the incredibly horrendous code that caused whatever problems to occur should be fired immediately knowing good and well that I was the only dev to write any of the code.
- dmd 2y agome, yesterday: What absolute piece of shit asshole wrote this shell script? my wife: Was it you? me: Well obviously
- dctoedt 2y ago> my wife: Was it you? me: Well obviously "Research shows" (I read long ago) that the happiest men are those take their wives' advice — that's certainly been true for my own N=1, for coming up on four decades now. I'd imagine we could replace "wives" with "spouses" and get comparable results.
- saagarjha 2y agohttps://i.kym-cdn.com/photos/images/original/001/275/257/dbc.jpg https://i.kym-cdn.com/photos/images/original/001/275/257/dbc...
- 9659 2y agoIf you are honest, it may not even alternate. Both feelings can exist at the same time.
- Aerbil313 2y agoI prefer "Why did I need to see this subtlest detail to resolve the bug, modern software sucks" and "Why do we not have better tools that would have prevented me from writing this bug in the first place, modern software sucks".
- brailsafe 2y agoThis is very true, and we need these moments. Lately I've been struggling to figure out where my place is, how to maybe get back into freelancing, what I'm technically good at etc... lots of ruminating since I've been out of work for a year. But.. I met someone at the gym who's been struggling with an esoteric problem on an ancient piece of software for over a decade, and they approached me to ask if I could solve it. I said "maybe", sat on it for a few days, and then replicated the issue on my machine and solved their problem in about an hour. I asked for $50 and they gave me double, which was wildly more rewarding than being paid $100k to write react all year, not that that salary is on the table any longer.
- manmal 2y ago> not that that salary is on the table any longer Is the job market so bad right now? I‘m in a privileged position (and not in the US), so have no clue of the state of things.
- brailsafe 2y agoI'm in Canada, but yes it's that bad.
- 9659 2y ago$50 for a one off thing, for a gym buddy is fine. in the blue collar world, that would be a 'case of beer' for helping me out. But in business, you need to charge an honest / fair amount. (sure, sometimes that 1 hour bug fix had $100K of 'value', but we could argue about honest / fair). You mention being an employee at $100K a year. Double that, gives you a contractor rate of $100 an hour. That is the floor of what you should be asking floor; as in the absolute lowest. Another $50 or $100 an hour is still fair and honest in todays economy.
- justinclift 2y agoThere's an opposite to imposter syndrome?
- deleted 2y ago[deleted]
- Jcowell 2y agoYes the kids these days call it being “Him” (or whatever third person singular pronoun you may refer to)
- sn9 2y agoThe term that came to mind was being "cracked".
- justinclift 2y agoNot sure how being crazy is supposed to be the opposite of imposter syndrome?
- sn9 2y agohttps://www.urbandictionary.com/define.php?term=Cracked https://www.urbandictionary.com/define.php?term=Cracked
- aodonnell2536 2y agoNot really a new phenomenon, though. People have been been calling others “The Man” for ages
- nikanj 2y agoThis essentially is why senior engineers get much bigger salaries
- mulmen 2y agoAs a total newbie I saved my company a quarter million dollars in Oracle licensing in a single afternoon by rewriting a PL/SQL function. That change was a few lines of SQL. Seniors don’t have a monopoly on good ideas. Salary is driven by market conditions and nothing else. It is not an approximation of merit or even delivered value.
- close04 2y agoStatistically speaking a senior (more experienced) engineer is more likely to consistently deliver time saving results, while a junior is more likely to occasionally do it, if ever. Proving it’s not a one time thing is what pushes you in the salary and seniority ranking.
- nashashmi 2y agoSenior engineers have less opportunity to write time consumingly careful code because they get paid so much. Much easier to throw new great hardware at it.
- fifilura 2y agoSenior engineers have less time to write code period. And this is what saves the day. Code is a liability.
- JonChesterfield 2y agoThe corporate structures that reward people who prove especially good at building the product with more meetings and less time building the product are perhaps not optimal in their deployment of resources. Maximising the fraction of the product built by people who don't know what they're doing would however explain the emergent properties of modern software.
- drewg123 2y agoIf modulus is expensive, and he's checking a power-of-2, why not just use a bitwise AND. Eg, for positive integers, x % 16 == x & 15. That should be trivially cheap.
- ladberg 2y agoIt wasn't `x % 16` it was `x % y` where x and y are 16-bit integers. A compiler would also have taken care of it if it were just a literal.
- drewg123 2y agoWhoops.. I misread what he was doing.
- xgkickt 2y agoReading the comments, that's kinda what they did, though they had to learn that first and only now realize they only needed one.
- kevin_thibedeau 2y agoAny top-tier C compiler will optimize modular division by a constant into a more efficient operation(s). It is better to keep the intent of the code clear rather than devolve it into increasingly obtuse bit-twiddling tricks the compiler can figure out on its own.
- beebmam 2y agowhy is this not considered a compiler optimization and/or language problem? it seems to me that compiler optimizations for expressive programming languages should be able to handle something like this
- JonChesterfield 2y agoWhat would you hope a compiler to optimise x % y into? Higher level change-the-algorithm aspirations haven't really been met by sufficiently smart compilers yet, with the possible exception of scalar evolution turning loops into direct calculation of the result. E.g. I don't know of any that would turn bubble sort into a more reasonable sort routine.
- vitus 2y agoIf y is always a power of 2 (as suggested in the comments), then I'd expect it to turn into an AND of some sort. And more generally, with older architectures, integer division was much slower than integer multiplication, so compilers would generally transform this into a multiplication plus some shifts [0]. For context in that timeframe, MUL on Sandy Bridge introduces 3-4 cycles worth of latency (depending on the exact variant), compared to DIV introducing 20+ (per Agner Fog's excellent instruction tables [1]). So even computing x - y * (x / y) with the clever math to replace x/y would be much faster than just x%y. (It's somewhat closer today, but integer division is still fairly slow.) [0] https://news.ycombinator.com/item?id=1131177 https://news.ycombinator.com/item?id=1131177 (the linked article 404s now, but it's archived: https://web.archive.org/web/20110222015211/https://ridiculousfish.com/blog/archives/2010/02/15/labor-of-division-episode-1/ https://web.archive.org/web/20110222015211/https://ridiculou...) [1] page 220 of https://www.agner.org/optimize/instruction_tables.pdf https://www.agner.org/optimize/instruction_tables.pdf
- wizzwizz4 2y ago> So even computing x - y * (x / y) with the clever math to replace x/y would be much faster than just x%y. That only works when y is constant. Otherwise, you need to work out what to replace x/y with… which ultimately takes longer than just using the DIV instruction.