|
But you know that you know nothing, and that's something...
|
|
|
|
|
I think Marc is just looking for "Best Practices" or some method to the madness.
But since I called it Best Practices, which really just means "hey, dev, use a consistent way of doing things that isn't just typing code but actual contains thought", people will freak out.
|
|
|
|
|
There is a whole lot between knowing what Marc knows and not knowing a damn thing about programming.
Unfortunately, it seems people who know nothing about programming still end up programming somehow
How would you react if someone built your house, you pay good money, and your front door could always be opened from the outside (even though it seems to have a lock)?
You'd be furious, sue your contractor and find a new door. You'd probably not trust the rest of the house anymore either (check your walls, foundation, windows, etc.).
I think that's roughly the equivalent of SQL injection.
Yet only one is common practice
|
|
|
|
|
But parameterized values are soooooooo hard!
"There are three kinds of lies: lies, damned lies and statistics."
- Benjamin Disraeli
|
|
|
|
|
RyanDev wrote: I hate that not all programmers are as smart as me.
Should be :
I hate that not all programmers are as smart as I think I am.
|
|
|
|
|
RyanDev wrote: I hate that not all programmers are as smart as me.
Actually, I much prefer programmers that are smarter than me, so I can learn something. Well, I guess that's what CP is for.
Marc
|
|
|
|
|
Indeed.
There are two kinds of people in the world: those who can extrapolate from incomplete data.
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
Marc Clifton wrote: garbage scows.
Reminds me of the time the Klingons called the Enterprise a 'garbage scow'. Wasn't pretty.
Jack of all trades, master of none, though often times better than master of one.
|
|
|
|
|
The Trouble with Tribbles!
Laddie, don't you think you better rephrase that?
Oh, sure. I didn't mean to say that the Enterprise should be hauling garbage. I meant to say that it should be hauled away AS GARBAGE!
<Fists start to fly>
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
Ron Nicholson wrote: Reminds me of the time the Klingons called the Enterprise a 'garbage scow'.
That was exactly the reference. I think the first time that was said was on The Trouble with Tribbles.
Marc
|
|
|
|
|
I have faith.
All it needs is a couple of years, and you'll have fixed most of it.
i.e. All it needs is someone who actually gives a damn.
I wanna be a eunuchs developer! Pass me a bread knife!
|
|
|
|
|
Sounds a lot like the poor code at a place that I used to work. And one of the reasons that I don't work there anymore.
Also the reason for my tag line
Just because the code works, it doesn't mean that it is good code.
|
|
|
|
|
|
DialogResult is null when the dialog box is shown but neither accepted nor canceled.
You just confirmed why I never forayed into WPF. WTF???
Marc
|
|
|
|
|
I usually solve the pitfall by using a viewmodel. Any kind of close event I care about is redirected to a command in the VM, which then fires an event (Either some kind of success event, which has it's specific event args, or whatever I need and care about).
Both the window and caller subscribe to the event - The calling instance gets the data, and the window closes itself.
|
|
|
|
|
But let's agree on the fact that a nullable boolean is a stupid idea. I mean it defeats the sole purpose of a bool, doesn't it?
|
|
|
|
|
Marco Bertschi (SFC) wrote: But let's agree on the fact that a nullable boolean is a stupid idea.
Well, given that a field in a DB record can be null (which in itself is a whole can of worms as to what null means in a field) it makes sense that the language supports nullable value types -- I thought it was a significant improvement in C# when that support was added. So, from that perspective, a nullable bool is just like any other nullable value type, and I don't have a problem with it.
What I do have a problem with is when the null state is used as a valid state. In my opinion, any nullable type that is null when you need to use it for something should result in an exception. By that definition, "nullable" to me (and when I design databases) means "it's OK if we don't know the value of this type right now, but when we use it for something, it darn well better not be null."
The exception to that might be business rules that handle "I don't know."
Marc
|
|
|
|
|
Marc Clifton wrote: Let's use bool? as a 3 state variable instead of a readable enum.
You have to admit, that's almost ingenious before it was mixed in with round of WTF by not making it readable.
I've actually used a triple state boolean before... with yes, no, and maybe for the valid values.
Jeremy Falcon
|
|
|
|
|
Code it as a single bit for extra points!
Sudden Sun Death Syndrome (SSDS) is a very real concern which we should be raising awareness of. 156 billion suns die every year before they're just 1 billion years old.
While the military are doing their part, it simply isn't enough to make the amount of nukes needed to save those poor stars. - TWI2T3D (Reddit)
|
|
|
|
|
Jeremy Falcon
|
|
|
|
|
I often wonder what the Gurus that haunt this website would feel about my code.
if (Object.DividedByZero == true) { Universe.Implode(); }
Meus ratio ex fortis machina. Simplicitatis de formae ac munus. -Foothill, 2016
|
|
|
|
|
On my personal scale of unmaintainable code that's about 15 of 100. The real grandmasters use such things as mere decoration. Their centerpiece is absolutely uncorrectable. make one little change and everything falls apart like a row of dominos.
What they did? Nothing special. They put a part of the application's logic into the data layer as stored procedures. SQL is great to see what's being done, but you get absolutely no clue to what this is supposed to accomplish. Dozens of SPs with no less than 500 lines already make the whole thing unreadable, but that still does not make it uncorrectable.
The final blow comes from a first unexpected direction. On every table are at list 5 - 10 triggers which do really obscure things under even more obscure circumstances and modify things in other tables, which fires even more triggers. To keep the whole trigger avalanche under control, there are columns in the tables to hold status codes instead of data. Let's forget database design for a second and just try to figure out what status 1, 2, 3, -1 and -112 could mean.
It would have been to easy if any documentation had existed at all and to add insult to injury, the mastermind behind that thing would deny any knowledge, but take any 'unjustified' criticism against his life's work personally. Obviously we were all too dumb to see the true ingenuity behind it all.
And now stop complaining.
The language is JavaScript. that of Mordor, which I will not utter here
This is Javascript. If you put big wheels and a racing stripe on a golf cart, it's still a f***ing golf cart.
"I don't know, extraterrestrial?"
"You mean like from space?"
"No, from Canada."
If software development were a circus, we would all be the clowns.
modified 2-Mar-17 3:31am.
|
|
|
|
|
I've never seen it quite that bad, but such bastardized designs (with a native app service component that uses that database, of course) is a big part of why I've been pushing so hard lately to switch to a document store.
If you want to use programmability for BI queries and your analytics...fine. But don't make application code dependent on it.
"There are three kinds of lies: lies, damned lies and statistics."
- Benjamin Disraeli
|
|
|
|
|
CDP1802 wrote: To keep the whole trigger avalanche under control, there are columns in the tables to hold status codes instead of data.
That triggers my "run awayyyyy!" response.
CDP1802 wrote: And now stop complaining.
Indeed.
Marc
|
|
|
|
|
Marc Clifton wrote: That triggers my "run awayyyyy!" response. Most that worked there did just that.
The language is JavaScript. that of Mordor, which I will not utter here
This is Javascript. If you put big wheels and a racing stripe on a golf cart, it's still a f***ing golf cart.
"I don't know, extraterrestrial?"
"You mean like from space?"
"No, from Canada."
If software development were a circus, we would all be the clowns.
|
|
|
|