The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.
What baffled me the most is that all the text in that boilerplate code is hard-coded.
You're either English (and only English) or you're forced to scaffold each and every page and replace it all with your own text or resx files.
I haven't hard-coded text for the past decade or so.
Also, all those Identity classes are Something<TIdentity>, but the UserManager<IdentityUser<TIdentity>> always returns a string for ID (and isn't based on an interface so you can't implement your own!?)
I have seen a lot of unreadable code. Most of the time if I want to use it I try to make it readable, at least for me. Out of all the times I have done that, there was only one instance where I found the results to be slower than the original. That was quite a while ago and compilers have come a long way since then.
"They have a consciousness, they have a life, they have a soul! Damn you! Let the rabbits wear glasses! Save our brothers! Can I get an amen?"
In the past I have written code that seemed readable at the time but when I came back to it a few months later was unintelligible to me! it worked fine but how I did it, I have no idea!
My experience is more like
In the past I have written code that seemed readable at the time but when I came back to it a few months later was unintelligible to me! It looks like it has never worked, but how I ever thought it was OK, I have no idea!
I have inherited a body of code from a guy who retired about 10 years ago and then died. He was a grade A a-hole to work with while he was here. After he left his code bounced from person to person, with none of them making any changes, until it arrived on my desk. I have spent a couple hundred hours over the last year just looking at it in the course of diagnosing issues. I am currently about to make my first change in it due to a hardware obsolescence problem.
This is all C, running on Windows as a command-line app. The code was deliberately written so that A-hole was the only person who could maintain it. Identifiers are of minimal length. There are global values with single lower-case character names. While there are dozens of .C source files, none of them have matching .H files. All external references are explicitly specified everywhere. Function prototypes are not used - anywhere. Magic numbers abound. Pointer arithmetic is used unnecessarily and unwisely. There's more, but I don't want to frighten you children.
He cultivated a mythos surrounding his code, claiming that it was difficult and performance-intensive, and that was why other people couldn't handle it. His management believed it.
I have spent the last two weeks figuring out how to address this obsolescence issue. When I'm done, I will have replaced <100 lines of code with around 40.
Writing unreadable code is inexcusable and should be grounds for termination with utmost prejudice.
I've found there are cases where code is bound to be ugly no matter what. Either the interface the code must integrate with is nasty (using the unfortunately undocumented soc/spi_master.h on the ESP-IDF), or the algorithm is horrific (LALR table generation) and there's little choice, plus comments only get you so far because you'd have to explain the entire thing you're coding against (like the LALR algorithm, or you'd have to document the undocumented interface as well as your own code)
So for certain things, I forgive ugly code, as long as it is otherwise well written.
Does the recent case with Oracle and Google(?) exempt you from this licensing scheme? I thought it was decided that an API couldn't be copyrighted, just its implementation. Regardless, it is bizarre for an API to infect users with an undesirable license.
I'm basically resorting to something like that, but for production I need to use the hardware SPI controller w/ DMA for performance reasons. I think I can get there with my current route, even though it's not ideal.
"Asdfg". "Hjkl". "Uiop". Do girls love it when you talk Qwerty to them?
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!