|
|
I agree. but honestly they are getting tougher or my brain is getting mushier so time doesn't matter.
cheers,
Super
------------------------------------------
Too much of good is bad,mix some evil in it
|
|
|
|
|
EXAMINEES? You didn't specify the number of letters, but I think it fits.
Sent from my Amstrad PC 1640
Never throw anything away, Griff
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
In all seriousness, it's probably because Tim is good at 'em - and living in Canada he has to post 'em late at night (today's he posted at half past midnight his local time).
We could ban him from answering them, but that's not really civilized and IMHO he's doing his best to get them posted at a reasonable time.
Sent from my Amstrad PC 1640
Never throw anything away, Griff
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
A clue for his mini CCC, moustache sounds like a nag about my posting time (6)
We can’t stop here, this is bat country - Hunter S Thompson RIP
|
|
|
|
|
With seconds to lose, Agnes backs winner for toaster (9)
|
|
|
|
|
With seconds to lose, (remove "S")
Agnes AGNE
backs winner CHAMP
for toaster
CHAMPAGNE
Sent from my Amstrad PC 1640
Never throw anything away, Griff
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
Yup
|
|
|
|
|
At first glance real application (new) code from someone else always looks complicated, and one has to work with it for a while to find it, eventually, simpler. And sometimes I wonder if with old age and worst memory I suffer from that more.
Yesterday I mentioned some code looks excessively complicated for no reason, i.e. it does very simple task, and I got an incredulous look from a fellow developer... Maybe I was wrong?
First I am always confused by the double layer of obfuscation where getting something from the db goes through 2 pass-through layers, each hidden behind their own interface, that return "data model". Thanks god for Go To implementation and also sometimes some property are not named like the columns, or swapped around, tricky...
I guess I am getting old here..
But then I stumbled on that (code simplified for sake of "clarity")!
And I knew I was right, it's not just me, code was complicated!
void DoSomething()
{
foreach (var d in Data)
{
if (MustDo(d.Code))
{
}
}
}
bool MustDo(string code)
{
if (BigCondition)
{
return GetData(code)?.Should ?? false;
}
return false;
}
AData GetData(string code) => Data.FirstOrDefault(x => x.Code == code);
clearly this is over complicated and can be rewritten
void DoSomething()
{
foreach (var d in Data)
{
if (BigCondition && d.Should)
{
}
}
}
And there is much much more of it...
Well I guess that's why they pay me!
modified 23-May-19 21:41pm.
|
|
|
|
|
I do notice how everyone else's code is over-complicated, outdated, and needs re-writing
«Where is the Life we have lost in living? Where is the wisdom we have lost in knowledge? Where is the knowledge we have lost in information?» T. S. Elliot
|
|
|
|
|
You too, hey!?!
|
|
|
|
|
I often note that my own code is outdated, overcomplicated and needing rewriting.
|
|
|
|
|
I do like looking at my clean, simple, maintainable code.... but then I have to move on, and as I press the enter key I add yet another line of code to the maintenance nightmare.
|
|
|
|
|
It takes longer... but it still happens occasionally.. mostly because I do thing completely differently later...
|
|
|
|
|
Being paid per line of code has all sorts of ramifications.
|
|
|
|
|
You're missing the Code==code check part. But yes, it does look like it's overly complicated and can be simplified.
|
|
|
|
|
I am not!
We got an item from a list.
We pass the id (aka code) of the object to another method
the other method use the id to lookup the (original) item from the list
I can simplify by directly using the original item
|
|
|
|
|
That requires some knowledge of the domain - the fact that Code is unique within the list. If that wasn't the case, then your simplification would have subtly changed the behaviour.
Edit: As already pointed out below[^].
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Super Lloyd wrote: And there is much much more of it...
apart from adding layers of "really useful" stuff another favorite weenie passtime is implementing the very latest language features regardless if it makes sense useful or not. Even if doing so they manage not to not break the code they do ensure it becomes incompatible with people using older versions of the dev platform.
shitloads of unmoderated stuff on github is constantly "updated" to use the very latest features of c# (or whatever language), and it's just too bloody bad for people using that if they are still on vs2015 or earlier.
like idiot kiddies that feel a strong need to mount a wing on their car, 75% of the time it does nothing because their POS car is too useless to have it matter, and 24.9% of the time it'll actually reduce / retard safety and performance.
my rules for using open/other peoples code/source/hell other peoples anything:
- always copy and use local version only. (reference/acknowledge the origin in comments only)
- if/when possible/time replace it with own code ... (other peoples code is always sh*t.)
- only ever update if there is a very strong reason ... (small problems fix it yourself).
- don't use just because it's there and looks cool. ... (today's cool is tomorrows dog vomit.)
Why? Well delivering applications, packages and even complete systems to clients:
- stability is 1,000 times more important than being the latest thing out there.
... and that saves me a shitload of 3AM Friday night headaches I don't need
Message Signature
(Click to edit ->)
|
|
|
|
|
Lopatir wrote: like idiot kiddies that feel a strong need to mount a wing on their car
Great analogy!
"Go forth into the source" - Neal Morse
|
|
|
|
|
I have noticed that most of those wings go on front-wheel drive cars and a wing on the rear end doesn't help those a whole lot and they don't help any car at lower speeds ie., the vast majority of driving.
This reinforces your point even more - the added accessories might look nice but are of very little real value.
"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?"
|
|
|
|
|
Come to the C++ world and really experience the love. Some 'post-modern' C++ doesn't even look like C++, because it sort of isn't. It's really Templates with C.
Explorans limites defectum
|
|
|
|
|
Well, technically your version is slightly different. If there are more then one item in Data with a given Code then the original version will (probably buggy) use the first one to determine .Should.
So, your point is well proved. Better performance (O(n), as opposed to O(n^2)) and bug free. Easier to read and maintain.
|
|
|
|
|
if (BigCondition) should be moved outside the loop though.
Wout
|
|
|
|
|
Does any other code call the MustDo method?
".45 ACP - because shooting twice is just silly" - JSOP, 2010 ----- You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010 ----- When you pry the gun from my cold dead hands, be careful - the barrel will be very hot. - JSOP, 2013
|
|
|
|