Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
Jethro
Jun 1, 2000

I was raised on the dairy, Bitch!

QuarkJets posted:

For sure, that's garbage fire design. But I don't know of any SQL engine that's immune to garbage fire designers
It's the "low barrier to entry" problem. Since MySQL is (and has been for a long time) totally free and pre-installed in a lot of environments, a larger proportion of the people who would choose MySQL as their RDBMS would make that kind of bad design. If you know better than to have oft-repeated strings as part of the key, you probably know better than to use MySQL in the first place (for the other issues that make MySQL something to avoid if you can).

Adbot
ADBOT LOVES YOU

Thermopyle
Jul 1, 2003

...the stupid are cocksure while the intelligent are full of doubt. —Bertrand Russell

A lot of coding horrors stem from developers either not knowing they don't know enough or not caring and just wanting to get it out the door.

I know very little about SQL, but when I have to write it, I research the poo poo out of what I'm writing because I know I have lots of gaps in my understanding.

But really, when I see SQL my eyes start to glaze over. I think it's mainly because I find it aesthetically unpleasing to read and write. Also, I feel like a big dummy when I call code aesthetically pleasing or not.

Vanadium
Jan 8, 2005

SQL looks so high-level that I feel when two statements that have the same effect differ in efficiency, it's 90% the query planner being wrong, not the developer

Presto
Nov 22, 2002

Keep calm and Harry on.

Ghost of Reagan Past posted:

I'm sure Presto is very different from an actual database but hey.
Yes, for starters you can't trust me to remember anything.

Munkeymon
Aug 14, 2003

Motherfucker's got an
armor-piercing crowbar! Rigoddamndicu𝜆ous.



PhantomOfTheCopier posted:

Good thing we don't care about data integrity, consistency, or durability!

Yes, that's implied when you use MySQL.

QuarkJets posted:

For sure, that's garbage fire design. But I don't know of any SQL engine that's immune to garbage fire designers

The consultants that put together the schema I'm working with right now managed to gently caress up real hard on SQL Server. Adding _fk to a column name is not the same as a real foreign key, guys :negative:

To be a little bit fair to them, they were turning a spreadsheet-based process into a centralized software system, so I'm sure most of the requirements were peppered with the word 'optional' which does translate into 'nullable column' if you're simple.

MisterZimbu
Mar 13, 2006

Munkeymon posted:

Yes, that's implied when you use MySQL.


The consultants that put together the schema I'm working with right now managed to gently caress up real hard on SQL Server. Adding _fk to a column name is not the same as a real foreign key, guys :negative:

To be a little bit fair to them, they were turning a spreadsheet-based process into a centralized software system, so I'm sure most of the requirements were peppered with the word 'optional' which does translate into 'nullable column' if you're simple.

Table names prefixed with "tbl" is a good indicator that you're in for a world of horror when you start looking at the database.

My favorite thing that I saw is the CRM/billing system we use- "time spent on task" is in two columns - Hours and Minutes. So if you run the reports out of the box for total time spent on a project, it will dutifully report back that it took 200 hours and 800 minutes to complete the project :eng99:

Hammerite
Mar 9, 2007

And you don't remember what I said here, either, but it was pompous and stupid.
Jade Ear Joe
having worked with both Oracle and MySQL, given a choice between the two I'd choose MySQL.

MisterZimbu
Mar 13, 2006

Hammerite posted:

having worked with both Oracle and MySQL, given a choice between the two I'd choose MySQL.

having worked with both Oracle and MySQL, given a choice between the two I'd :yotj: over to a place that let me use MSSQL

Hammerite
Mar 9, 2007

And you don't remember what I said here, either, but it was pompous and stupid.
Jade Ear Joe

MisterZimbu posted:

having worked with both Oracle and MySQL, given a choice between the two I'd :yotj: over to a place that let me use MSSQL

This is also a reasonable answer

Volguus
Mar 3, 2009

MisterZimbu posted:

having worked with both Oracle and MySQL, given a choice between the two I'd :yotj: over to a place that let me use MSSQL

I've worked with various databases over the years (not a DBA, just a developer) and Oracle always seemed to be a step ahead of MS in terms of features and capabilities of their tools. Yes, Oracle is a gigantic bully which makes a lot of people nowadays try to avoid them (for good reason) but the database itself was always top notch. MSSQL always seemed to be just playing catch-up. Plus that MSSQL client of theirs is a WTF in and of itself. Have they improved so much lately? Because company-behaviour-wise I highly doubt that Microsoft is much more of a saint than Oracle.
For smaller projects MySQL and PostgreSQL were always very good choices.

Munkeymon
Aug 14, 2003

Motherfucker's got an
armor-piercing crowbar! Rigoddamndicu𝜆ous.



MisterZimbu posted:

Table names prefixed with "tbl" is a good indicator that you're in for a world of horror when you start looking at the database.

:stare: how did you know?

CPColin
Sep 9, 2003

Big ol' smile.
One vendor-supplied database here prefixes all the tables with "t". They're versioned, so they all have equivalents prefixed with "V_t". For some reason, there's also "VERSION_t". But that's still better than one of the other vendors, which used "sS_", "sU_", "t_", "tB_", "tE_", "tU_", "w_", "x_", "xB_", "xP_", and many, many more! (No, there do not appear to be any semantics behind the prefix choices.)

At least SSMS will happily autocomplete based on the middle of the table name and not just the start of it.

iospace
Jan 19, 2038


gently caress Oracle.

The Phlegmatist
Nov 24, 2003

Thermopyle posted:

My default belief about most software running on embedded-ish devices is that it's a fragile house of cards with minimal testing.

I'm not sure how justified that belief is.

My experience with durable medical equipment is basically:

It runs Linux/BSD/QNX: nice, real programmers probably worked on this

It runs Windows Embedded: usually good but proceed with caution

It runs Windows XP/Windows 98 and also it connects to the network, because of course they all do: hope nobody dies!!

iospace
Jan 19, 2038


The Phlegmatist posted:

My experience with durable medical equipment is basically:

It runs Linux/BSD/QNX: nice, real programmers probably worked on this

It runs Windows Embedded: usually good but proceed with caution

It runs Windows XP/Windows 98 and also it connects to the network, because of course they all do: hope nobody dies!!

I started twitching.

I loving hate you, so much.

(I had to deal with Windows XP Embedded, namely setting it up for testing)

Munkeymon
Aug 14, 2003

Motherfucker's got an
armor-piercing crowbar! Rigoddamndicu𝜆ous.



Oh hey speaking of databases, I just had to clean up a sproc where someone 'optimized' it by forcing two fulltext scans of a huge (for this DB), denormalized table by doing a like '%@firstName%' into a temp table twice instead of inner-joining and letting the drat query planner do that on a tiny subset of the rows. I should post the whole thing because it's a mess of conditional string building followed by an exec, but that's hard enough to read I don't think anyone would bother to pick out the other horrors.

Munkeymon
Aug 14, 2003

Motherfucker's got an
armor-piercing crowbar! Rigoddamndicu𝜆ous.



Vanadium posted:

SQL looks so high-level that I feel when two statements that have the same effect differ in efficiency, it's 90% the query planner being wrong, not the developer

Ehhhh, disagree. It's just a different level of misunderstanding what you're doing based on ignorance than
C code:
int a = 65535;
for (int i = 0; i >= 65535; ++i);
/*same effect; much different efficiency*/
that, yeah, the high-level-ness(?) exacerbates but it's still mostly the developer misusing the tool.

Spatial
Nov 15, 2007

Thermopyle posted:

My default belief about most software running on embedded-ish devices is that it's a fragile house of cards with minimal testing.

I'm not sure how justified that belief is.
Embedded development in four steps:

Hardware: Each block is designed and tested in isolation but not in any way resembling how the software will use it. There are no use cases so nobody has any idea what the thing will have to do, therefore it must do everything. There are 20,000 knobs to turn but just two documentation types: nonexistent and wrong. Some blocks are copied and pasted from the last product to save time. They didn't work in that one either.

Software: Each module is designed in a way that doesn't even pretend to regard how the customer would use the device, producing an API as torturous to use as it is ugly. Team knows nothing but C89 and half of them are electronic engineers brain-damaged by years of LabView who do not know what a unit test is. There are no usage models or use cases or user stories. The overall architecture is based on how it was in the previous product because it worked last time. It didn't work last time.

The system: Doesn't exist. There is a collection of pieces and maybe it all works together. It's technically possible but nobody is in charge of this minor triviality.

Customer applications: Makes product demonstrations and handles support. Has to use the device for real with no special knowledge. They're the only ones who must confront the full grotesque reality of our creation, which they will see for the first time when the second batch of parts is completed. The first batch went to the main customer who has been asking them questions for the last two weeks. Severe alcoholism.

Ghost of Reagan Past
Oct 7, 2003

rock and roll fun

Thermopyle posted:

A lot of coding horrors stem from developers either not knowing they don't know enough or not caring and just wanting to get it out the door.

I know very little about SQL, but when I have to write it, I research the poo poo out of what I'm writing because I know I have lots of gaps in my understanding.

But really, when I see SQL my eyes start to glaze over. I think it's mainly because I find it aesthetically unpleasing to read and write. Also, I feel like a big dummy when I call code aesthetically pleasing or not.

I honestly really love SQL, but I could not make a career out of it. My brain can't fit the relational algebra.

Writing SQL feels like I'm writing Future Software(TM), though.

Zaphod42
Sep 13, 2012

If there's anything more important than my ego around, I want it caught and shot now.

Thermopyle posted:

A lot of coding horrors stem from developers either not knowing they don't know enough or not caring and just wanting to get it out the door.

I know very little about SQL, but when I have to write it, I research the poo poo out of what I'm writing because I know I have lots of gaps in my understanding.

But really, when I see SQL my eyes start to glaze over. I think it's mainly because I find it aesthetically unpleasing to read and write. Also, I feel like a big dummy when I call code aesthetically pleasing or not.

That's why ORMs are great; so you can just talk OOP to the DB and skip all that ugly SQL.

But its still important for debugging database poo poo or designing new schema.

CPColin posted:

One vendor-supplied database here prefixes all the tables with "t". They're versioned, so they all have equivalents prefixed with "V_t". For some reason, there's also "VERSION_t". But that's still better than one of the other vendors, which used "sS_", "sU_", "t_", "tB_", "tE_", "tU_", "w_", "x_", "xB_", "xP_", and many, many more! (No, there do not appear to be any semantics behind the prefix choices.)

At least SSMS will happily autocomplete based on the middle of the table name and not just the start of it.

I'm not gonna say what it was exactly but a company I used to work for did something very similar to this. Man that poo poo got old.

But also some random tables wouldn't.

Eleeleth
Jun 21, 2009

Damn, that is one suave eel.

Zaphod42 posted:

That's why ORMs are great; so you can just talk OOP to the DB and skip all that ugly SQL.

Now you have 2 problems.

Phobeste
Apr 9, 2006

never, like, count out Touchdown Tom, man

Thermopyle posted:

My default belief about most software running on embedded-ish devices is that it's a fragile house of cards with minimal testing.

I'm not sure how justified that belief is.

It's either that or heavily tested with HIL setups and occasionally formal proofs. Nothing in between

QuarkJets
Sep 8, 2008

Jethro posted:

It's the "low barrier to entry" problem. Since MySQL is (and has been for a long time) totally free and pre-installed in a lot of environments, a larger proportion of the people who would choose MySQL as their RDBMS would make that kind of bad design. If you know better than to have oft-repeated strings as part of the key, you probably know better than to use MySQL in the first place (for the other issues that make MySQL something to avoid if you can).

But these would be problems for tons of databases, MySQL is just more widely available and free. If Oracle came installed in all of the common linux distros you'd be encountering all of the same idiot designer problems but naming a different application

For whatever it's worth, I find that MySQL is totally fine for all kinds of applications so long as you're not doing something complicated or delicate like building a financial transaction system.

putin is a cunt
Apr 5, 2007

BOY DO I SURE ENJOY TRASH. THERE'S NOTHING MORE I LOVE THAN TO SIT DOWN IN FRONT OF THE BIG SCREEN AND EAT A BIIIIG STEAMY BOWL OF SHIT. WARNER BROS CAN COME OVER TO MY HOUSE AND ASSFUCK MY MOM WHILE I WATCH AND I WOULD CERTIFY IT FRESH, NO QUESTION
Uh, just learn SQL guys. It's not that complicated for 99% of usages. Yeah occasionally you'll need to do something complicated, but the idea that so many of you don't understand how to read/write SQL is surprising to me, I thought that was a pretty rudimentary part of being a developer.

Xarn
Jun 26, 2015

a hot gujju bhabhi posted:

Uh, just learn SQL guys. It's not that complicated for 99% of usages. Yeah occasionally you'll need to do something complicated, but the idea that so many of you don't understand how to read/write SQL is surprising to me, I thought that was a pretty rudimentary part of being a developer.

Uh, just learn ASM guys. It's not that complicated for 99% of usages. Yeah occasionally you'll need to do something complicated, but the idea that so many of you don't understand how to read/write ASM is surprising to me, I thought that was a pretty rudimentary part of being a developer.
:v:



I actually can do basic SQL fine (relational thinking is easy, translating it to SQL syntax is harder), and probably would get better at it quickly enough, but so far I haven't had a reason to, as my career and interests are way different. This means that I can't really blame embedded-ish people for being bad with SQL any more than I can blame Java EE business devs for being bad at low level stuff.

lifg
Dec 4, 2000
<this tag left blank>
Muldoon

a hot gujju bhabhi posted:

Uh, just learn SQL guys. It's not that complicated for 99% of usages. Yeah occasionally you'll need to do something complicated, but the idea that so many of you don't understand how to read/write SQL is surprising to me, I thought that was a pretty rudimentary part of being a developer.

Xarn posted:

Uh, just learn ASM guys. It's not that complicated for 99% of usages. Yeah occasionally you'll need to do something complicated, but the idea that so many of you don't understand how to read/write ASM is surprising to me, I thought that was a pretty rudimentary part of being a developer.
:v:

Both true. Both useful.

Ghost of Reagan Past
Oct 7, 2003

rock and roll fun
The real problems with SQL come in not with simple queries, but complex things where you're trying to optimize the query, staring at EXPLAINs, and designing databases generally. Where I work there were database decisions made about 6 years ago that are still biting everyone in the rear end, and when you're optimizing those queries you're having to stare deep into the face of madness.

Knowing enough SQL to get the job done is different from actually knowing SQL and understanding databases.

Volguus
Mar 3, 2009
I can completely confirm this. I "know" SQL. I am perfectly capable in creating/fixing and sometimes even optimizing a SQL query. But once I did a bit of pair programming with a DBA and he was helping me and my team optimize certain tables and queries and the overall health of our application. I realized that I do not know SQL. That poo poo is loving magic when you get to the bottom of it. Can it be learned? Of course. Do we? Am I? Eh ... not really, just enough to get by, since I really do have other interests and priorities. And by the way, that DBA needs a job too you know. If you have a DBA, and you know your application will need to handle relatively large datasets, use him/her from the start. He's worth his weight in gold.

Volguus fucked around with this message at 16:28 on Nov 14, 2017

Plorkyeran
Mar 22, 2007

To Escape The Shackles Of The Old Forums, We Must Reject The Tribal Negativity He Endorsed

Xarn posted:

Uh, just learn ASM guys. It's not that complicated for 99% of usages. Yeah occasionally you'll need to do something complicated, but the idea that so many of you don't understand how to read/write ASM is surprising to me, I thought that was a pretty rudimentary part of being a developer.
:v:

If you find yourself looking at asm a lot, then yes, you should just go ahead and learn it and it won't take all that long.

There's nothing wrong with not knowing SQL or whatever if it's just not a big part of what you do on a regular basis, but I've encountered an oddly large numbr of developers who do write a lot of SQL and really do need to know it but refuse to take the step past cargo-culting existing queries.

Xarn
Jun 26, 2015

Plorkyeran posted:

If you find yourself looking at asm a lot, then yes, you should just go ahead and learn it and it won't take all that long.

There's nothing wrong with not knowing SQL or whatever if it's just not a big part of what you do on a regular basis, but I've encountered an oddly large numbr of developers who do write a lot of SQL and really do need to know it but refuse to take the step past cargo-culting existing queries.

Fair, but I think that applies to pretty much every part of a programmer's knowledge.

Dylan16807
May 12, 2010
Writing good SQL is often more an exercise in working around a really cranky JIT than code quality. Two queries that are fundamentally stating the same actions can have massive performance differences based in picky little things the query planner recognizes.

Rubellavator
Aug 16, 2007

I once got really annoyed trying to figure out why my query wasn't using some index to join two tables and that was when I discovered that the optimizer actually uses different plans based on table statistics. For example, the table I was joining on only had 3 rows of test data so the optimizer ignores the index.

MisterZimbu
Mar 13, 2006

Volguus posted:

I can completely confirm this. I "know" SQL. I am perfectly capable in creating/fixing and sometimes even optimizing a SQL query. But once I did a bit of pair programming with a DBA and he was helping me and my team optimize certain tables and queries and the overall health of our application. I realized that I do not know SQL. That poo poo is loving magic when you get to the bottom of it. Can it be learned? Of course. Do we? Am I? Eh ... not really, just enough to get by, since I really do have other interests and priorities. And by the way, that DBA needs a job too you know. If you have a DBA, and you know your application will need to handle relatively large datasets, use him/her from the start. He's worth his weight in gold.

In my experience the DBA is either a goddamn genius or an incompetent buffoon who should have all their computers taken away. There's no in-between.

I think it's because of the fact that everyone who would be in-between is smart enough to know they are not nearly smart enough to be a DBA.

putin is a cunt
Apr 5, 2007

BOY DO I SURE ENJOY TRASH. THERE'S NOTHING MORE I LOVE THAN TO SIT DOWN IN FRONT OF THE BIG SCREEN AND EAT A BIIIIG STEAMY BOWL OF SHIT. WARNER BROS CAN COME OVER TO MY HOUSE AND ASSFUCK MY MOM WHILE I WATCH AND I WOULD CERTIFY IT FRESH, NO QUESTION

Xarn posted:

I actually can do basic SQL fine (relational thinking is easy, translating it to SQL syntax is harder), and probably would get better at it quickly enough, but so far I haven't had a reason to, as my career and interests are way different. This means that I can't really blame embedded-ish people for being bad with SQL any more than I can blame Java EE business devs for being bad at low level stuff.

If you can do basic SQL fine then you're not the target of what I said.

putin is a cunt
Apr 5, 2007

BOY DO I SURE ENJOY TRASH. THERE'S NOTHING MORE I LOVE THAN TO SIT DOWN IN FRONT OF THE BIG SCREEN AND EAT A BIIIIG STEAMY BOWL OF SHIT. WARNER BROS CAN COME OVER TO MY HOUSE AND ASSFUCK MY MOM WHILE I WATCH AND I WOULD CERTIFY IT FRESH, NO QUESTION
I'm not trying to suggest everyone become SQL experts (I'm absolutely NOT) but at least be able to read it and maybe write some basic stuff. I mean it's a pretty expressive syntax.

Absurd Alhazred
Mar 27, 2010

by Athanatos

a hot gujju bhabhi posted:

I'm not trying to suggest everyone become SQL experts (I'm absolutely NOT) but at least be able to read it and maybe write some basic stuff. I mean it's a pretty expressive syntax.

I have never had need for relational databases at work. If I ever find the need, I'll learn it. Otherwise, my headspace is way better served learning algorithm design, netcode, assembly, graphics pipelines, image formats, and other topics that are relevant to what I do.

Carbon dioxide
Oct 9, 2012

a hot gujju bhabhi posted:

Uh, just learn SQL guys. It's not that complicated for 99% of usages. Yeah occasionally you'll need to do something complicated, but the idea that so many of you don't understand how to read/write SQL is surprising to me, I thought that was a pretty rudimentary part of being a developer.

Xarn posted:

Uh, just learn ASM guys. It's not that complicated for 99% of usages. Yeah occasionally you'll need to do something complicated, but the idea that so many of you don't understand how to read/write ASM is surprising to me, I thought that was a pretty rudimentary part of being a developer.

Uh, just learn Japanese guys. It's not that complicated for 99% of usages. Yeah occasionally you'll need to do something complicated, but the idea that so many of you don't understand how to read/write Japanese is surprising to me, I thought that was a pretty rudimentary part of being a weeaboo.

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe

Xarn posted:

Uh, just learn ASM guys. It's not that complicated for 99% of usages. Yeah occasionally you'll need to do something complicated, but the idea that so many of you don't understand how to read/write ASM is surprising to me, I thought that was a pretty rudimentary part of being a developer.

this but unironically

Volguus
Mar 3, 2009

Carbon dioxide posted:

Uh, just learn Japanese guys. It's not that complicated for 99% of usages. Yeah occasionally you'll need to do something complicated, but the idea that so many of you don't understand how to read/write Japanese is surprising to me, I thought that was a pretty rudimentary part of being a weeaboo.

https://www.ted.com/talks/shaolan_learn_to_read_chinese_with_ease

Adbot
ADBOT LOVES YOU

Thermopyle
Jul 1, 2003

...the stupid are cocksure while the intelligent are full of doubt. —Bertrand Russell

a hot gujju bhabhi posted:

If you can do basic SQL fine then you're not the target of what I said.

Who is the target?

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply