The "Good news, everybody: we’re safe from Skynet!" Rant
-
@apapadimoulis said in The "Good news, everybody: we’re safe from Skynet!" Rant:
@thecpuwizard said in The "Good news, everybody: we’re safe from Skynet!" Rant:
@apapadimoulis - Can I get permission to republish?
Wow. That's as old-fashioned as usable software.
You're supposed to blockquote the entire thing now, come up with a more click-baity title, put a link at the way bottom, and share it on your MEDIUM.
...then post a comment on yours saying "hi, great article, I enjoyed it so much that I've republished it on my blog. can you also link back to me?"
...or is that too 90s?
-
@gąska said in The "Good news, everybody: we’re safe from Skynet!" Rant:
that's what we need. A GUI for stringing together building blocks. Not GUI for making the building blocks - this is pointless because the only people able to use it efficiently would be those who could just as well write it in programming language.
You've just described everything that's wrong with SQL Server Integration Services. By the time you edit the Data Flow object and point-and-click where all the columns should go, you may as well have just typed in what you wanted in a programming language. What @dkf said also applies.
-
@gurth said in The "Good news, everybody: we’re safe from Skynet!" Rant:
Even worse is Windows Live Mail, which can’t auto-indent quoted text. There just isn’t even an option to make it do that, I discovered when looking into this
But, if they allowed users to make indented quotes, then users could possibly use them to create indented quote pyramids!
-
@dragoon said in The "Good news, everybody: we’re safe from Skynet!" Rant:
@blakeyrat said in The "Good news, everybody: we’re safe from Skynet!" Rant:
(Although in our case it was because the data model in the DB was already settled, and that's harder to change than just PHP classes.)
Never understand why changing the DB is so hard, but than again. I don't Oracle, so maybe that is why.
If the database schema changes, then there are tons of possibilities for it to break SQL that's been written against it.
Even on stuff that you wouldn't necessarily think, like "add a column that defaults to NULL and with no constraints"... what happens if somebody did a
SELECT *
? Now you're returning data that they didn't expect, which might break their report...
-
@anotherusername At that company, using
SELECT *
wouldn't have passed code review. Always specify the columns you need in the order you need, guyz.
-
@magus said in The "Good news, everybody: we’re safe from Skynet!" Rant:
refresh
GG Microsoft and iFramely.
-
@tsaukpaetra That's really rather dumb.
-
@magus said in The "Good news, everybody: we’re safe from Skynet!" Rant:
@tsaukpaetra That's really rather dumb.
Also:
Really? That's all they have for a description?
...
Oh wait, that's not the description, because why would you put a product's description beneath the title? Instead you should put something nonsensical, like text that says the developer thinks their product is ACCESSIBLE!
I bet the dev didn't even do anything for that, just left a default checkbox in the meta data page.
-
@anotherusername
Two things wrong here:- Select * is fucking stupid
- If you are doing Select *, nothing is unexpected.
-
@tsaukpaetra said in The "Good news, everybody: we’re safe from Skynet!" Rant:
@magus said in The "Good news, everybody: we’re safe from Skynet!" Rant:
refresh
GG Microsoft and iFramely.
"Your explicitly automated request seems to be automated!"
-
@apapadimoulis said in The "Good news, everybody: we’re safe from Skynet!" Rant:
@dreikin said in The "Good news, everybody: we’re safe from Skynet!" Rant:
And maybe you don't really need a whiteboard. Just everyone has a laptop/tablet with a pen (or touch, maybe) interface, and a way for everyone to view and work on the same drawing. Also put it in front of everyone via projector/front-of-room screen if everyone's in the same room. Concurrency could be handled by some digital equivalent of handing a marker around to people currently viewing/editing the shared document.
And this is exactly what some clever developer told some idiot product manager --- hey guys we can totally make this. Except, they can't. They will never will be able to. As an industry, we have lost the ability to make basic, usable instant messaging software... what makes you think we'll ever be able to make such a complicated piece of collaboration software?
And even if they do, I mean, we need the space. The space is important, it's there for a reason. There is a reason we like thinking while writing on whiteboards or paper. There is also the ease of tweaking a whiteboard/paper-based systems -- it's easy and you can see the effect almost immediately.
This was exactly my point with the bullet journal: I don't do there anything I couldn't have done on a fucking iPhone, but it wouldn't be usable on a fucking iPhone and I would never do it there.
-
@kt_ said in The "Good news, everybody: we’re safe from Skynet!" Rant:
but it wouldn't be usable on a fucking iPhone
On an Android phone, on the other hand...
-
@tsaukpaetra It's really bare-bones, but all the kanji buttons have furigana at least.
-
@timebandit said in The "Good news, everybody: we’re safe from Skynet!" Rant:
@kt_ said in The "Good news, everybody: we’re safe from Skynet!" Rant:
but it wouldn't be usable on a fucking iPhone
On an Android phone, on the other hand...
Why do you need to use the other hand with an Android phone? What did these incompetent UX designers from Google come up with this time around?!
-
@dragoon there are probably better examples of (non-obvious) pitfalls that you could encounter, but I don't write enough SQL to know them.
-
@blakeyrat said in The "Good news, everybody: we’re safe from Skynet!" Rant:
@anotherusername At that company, using
SELECT *
wouldn't have passed code review. Always specify the columns you need in the order you need, guyz.I've heard people say that many times, and never understood it. About 75% of the time (I won't say "all the time" because I know that exceptions abound, but the vast majority of the time) when you're SELECTing data, "the columns you need" is the entire set of columns in the table--because the table was designed with that exact set of columns to meet that specific need--and "the order you need them in" is irrelevant. So why not use
select *
when it's appropriate, which is the majority of the time, and designate specific columns when that's appropriate?
-
@masonwheeler said in The "Good news, everybody: we’re safe from Skynet!" Rant:
@blakeyrat said in The "Good news, everybody: we’re safe from Skynet!" Rant:
@anotherusername At that company, using
SELECT *
wouldn't have passed code review. Always specify the columns you need in the order you need, guyz.I've heard people say that many times, and never understood it. About 75% of the time (I won't say "all the time" because I know that exceptions abound, but the vast majority of the time) when you're SELECTing data, "the columns you need" is the entire set of columns in the table--because the table was designed with that exact set of columns to meet that specific need--and "the order you need them in" is irrelevant. So why not use
select *
when it's appropriate, which is the majority of the time, and designate specific columns when that's appropriate?Because if you use * and then someone adds a new column or a set of columns, one of two things can happen:
- The query will start having performance issues.
- Your query will start failing.
- Or both.
-
@masonwheeler said in The "Good news, everybody: we’re safe from Skynet!" Rant:
So why not use select * when it's appropriate, which is the majority of the time, and designate specific columns when that's appropriate?
You don't want a completely unrelated change elsewhere make you have to go back and fix the code here. As long as your changes to the table schema don't affect the specific columns that bit of code is touching, you'll never have to edit it.
It's also an efficiency thing. Don't ask for data you're not going to use. So even if you're literally correct that you're using 100% of the columns you got via
SELECT *
now, after you add to that schema you may be asking the DB server to give you more data than you need, slowing everything down.
-
@kt_ I also figure it varies per the language you're working in. In some languages, like PHP, you get records as associative results so the order doesn't matter. In others, like C, you get an array and you want to specifically know which field each array member is going to be. Various activities may affect the ordering of the columns in the table, and not all database engines support reordering columns.
-
@kt_ Yes, I've heard that theory plenty of times before. Never once seen it actually happen in practice, because of an extension of what I said earlier: The reason you added a column is because the purpose that the table serves--the same purpose for which you're querying all columns--is expanding in scope.
-
@masonwheeler said in The "Good news, everybody: we’re safe from Skynet!" Rant:
@kt_ Yes, I've heard that theory plenty of times before. Never once seen it actually happen in practice, because of an extension of what I said earlier: The reason you added a column is because the purpose that the table serves--the same purpose for which you're querying all columns--is expanding in scope.
This doesn't mean you need this data and also it doesn't mean that you haven't become dependent on the order or the actual set of data later on, maybe by someone else's doing.
-
@masonwheeler If you've got a FOO_BARS table which you're selecting data from in order to create a list of FooBar objects, then
select *
may be suitable since like you say, you will probably need about everything. If you're doing more targeted work, or if you're including joins, gains may be larger, the set of not-really-needed columns is larger, and different database optimizations come into play.I know I've got one or two queries out there which end up querying an index instead of the table it is based on. That's an optimization, and it doesn't work if you're
select
ing*
.
-
@pleegwat said in The "Good news, everybody: we’re safe from Skynet!" Rant:
@masonwheeler If you've got a FOO_BARS table which you're selecting data from in order to create a list of FooBar objects, then
select *
may be suitable since like you say, you will probably need about everything. If you're doing more targeted work, or if you're including joins, gains may be larger, the set of not-really-needed columns is larger, and different database optimizations come into play.My point exactly
I know I've got one or two queries out there which end up querying an index instead of the table it is based on.
Wait, what?
That's an optimization, and it doesn't work if you're
select
ing*
.Why wouldn't it?
-
@masonwheeler said in The "Good news, everybody: we’re safe from Skynet!" Rant:
@pleegwat said in The "Good news, everybody: we’re safe from Skynet!" Rant:
@masonwheeler If you've got a FOO_BARS table which you're selecting data from in order to create a list of FooBar objects, then
select *
may be suitable since like you say, you will probably need about everything. If you're doing more targeted work, or if you're including joins, gains may be larger, the set of not-really-needed columns is larger, and different database optimizations come into play.My point exactly
Have you ever written a stored proc in your life? For example, to activate a User? What would you need their first name for, in this scenario?
-
@masonwheeler
That really depends on the DB design. At the first company I ever worked at we had mailing, physical, billing address fields for our customers. These were all in the same table along with other contact information. Adding additional columns for new contact types would not effect our billing run.edit: where did all those commas come from?
-
@masonwheeler said in The "Good news, everybody: we’re safe from Skynet!" Rant:
@pleegwat said in The "Good news, everybody: we’re safe from Skynet!" Rant:
I know I've got one or two queries out there which end up querying an index instead of the table it is based on.
Wait, what?
Because the query only refers to two columns in that table, and both of them are in the index. And I've heard mention that MSSQL actually allows storing extra columns in the index to make that optimization more effective.
Imagine you've got a FOO table, which contains ID and NAME columns in addition to other properties. For some query, you are querying BARs which refer to FOOs by ID and you want to return the name as well. So you join in FOO (or use a
(SELECT NAME FROM FOO WHERE ID=BAR.FOO_ID)
) and since you don't select other properties you don't need the database can give you that information from the index, rather than hitting the larger base table.I get the impression though that you are restricting yourself to a different database access paths where you'd query the BARs, turn them into objects, query the FOOs, turn them into objects as well, and linking it together in application code 'so I have all properties if I need them'. And in your application that may make sense.
Our UI guys do that as well, since the configuration table model lines up with their object model and their UI. But in the backend we need to convert that to different paradigms, which involves SQL beyond
select * from table
.
-
@kt_ said in The "Good news, everybody: we’re safe from Skynet!" Rant:
@polygeekery said in The "Good news, everybody: we’re safe from Skynet!" Rant:
@kt_ said in The "Good news, everybody: we’re safe from Skynet!" Rant:
Also, because why would anyone want to scroll through possibly hundreds of lines of previous replies?
...and thousands of lines of signatures telling you to delete it if you are not the intended recipient.
Oh yeah. I have such a signature, too! I mean, my work e-mail, but still -- I do!
I think my company's email server automatically adds them for recipients outside the company.
-
@xaade said in The "Good news, everybody: we’re safe from Skynet!" Rant:
@sloosecannon said in The "Good news, everybody: we’re safe from Skynet!" Rant:
I think the kids nowadays (at least in the US) use crap like Snapchat and Instagram and crap...
Anything to make it more about ME ME ME.
Social media is like everyone standing on their own street corner with a megaphone.
Not quite sure why we bother adding "media" to it. Should just call it Public Media.
Or "Public Me".
-
@kt_ said in The "Good news, everybody: we’re safe from Skynet!" Rant:
Have you ever written a stored proc in your life? For example, to activate a User?
As a matter of fact, yes, I've done exactly that.
What would you need their first name for, in this scenario?
You don't. Which was my point: there are times when you don't need all the columns, in which case you select the ones you do need, but in the majority of cases you do want everything, so saying "NEVER EVER EVAR USE SELECT *" is just silly. It's a simple matter of "use the right tool for the job."
-
@pleegwat said in The "Good news, everybody: we’re safe from Skynet!" Rant:
I get the impression though that you are restricting yourself to a different database access paths where you'd query the BARs, turn them into objects, query the FOOs, turn them into objects as well, and linking it together in application code 'so I have all properties if I need them'. And in your application that may make sense.
Not "restricting myself" so much as "acknowledging the simple fact that basic CRUD accounts for the majority of database operations."
-
@boomzilla said in The "Good news, everybody: we’re safe from Skynet!" Rant:
@blakeyrat said in The "Good news, everybody: we’re safe from Skynet!" Rant:
There's no math "behind" programming. (What does "behind" even mean in this context?)
Writing a program is a mathematical activity. You probably only think of math as doing calculations. This is abstract math, though.
In other words, it's applied logic, critical thinking, pattern recognition, and even lateral thinking all rolled together.
-
@tsaukpaetra said in The "Good news, everybody: we’re safe from Skynet!" Rant:
@magus said in The "Good news, everybody: we’re safe from Skynet!" Rant:
@tsaukpaetra It worked for Mario and one of the Belmonts.
Yeah, but we couldn't just out right say "Hey, treat this like Mario 64!". It might have been more obvious if we duplicated the wavy-picture effect, but then again, legal stuff...
Is the wobbly-picture effect trademarked or something?
You could also try having some other sort of energy reaction when an avatar gets close enough to an "active" painting, like maybe a faint path of particles moving from the avatar into the painting or a ring of glowing energy around the border of the painting.
-
@dragoon said in The "Good news, everybody: we’re safe from Skynet!" Rant:
@anotherusername
Two things wrong here:- Select * is fucking stupid
- If you are doing Select *, nothing is unexpected.
I use it in common table expressions where I'm selecting from another common table expression that didn't use
select *
. Which of course means that I've really explicitly defined the columns, of course.
-
@masonwheeler said in The "Good news, everybody: we’re safe from Skynet!" Rant:
About 75% of the time (I won't say "all the time" because I know that exceptions abound, but the vast majority of the time) when you're SELECTing data, "the columns you need" is the entire set of columns in the table
I doubt this is true. My ORM does this all the time, of course, but I very rarely use all of the columns whenever I load an object.
-
@masonwheeler said in The "Good news, everybody: we’re safe from Skynet!" Rant:
@pleegwat said in The "Good news, everybody: we’re safe from Skynet!" Rant:
@masonwheeler If you've got a FOO_BARS table which you're selecting data from in order to create a list of FooBar objects, then
select *
may be suitable since like you say, you will probably need about everything. If you're doing more targeted work, or if you're including joins, gains may be larger, the set of not-really-needed columns is larger, and different database optimizations come into play.My point exactly
I know I've got one or two queries out there which end up querying an index instead of the table it is based on.
Wait, what?
That's an optimization, and it doesn't work if you're
select
ing*
.Why wouldn't it?
If you only select stuff in a single index, then the DB doesn't need to read from the table at all. It only has to read the index. This can save a lot of I/O, depending on the specifics.
-
@djls45 said in The "Good news, everybody: we’re safe from Skynet!" Rant:
@tsaukpaetra said in The "Good news, everybody: we’re safe from Skynet!" Rant:
@magus said in The "Good news, everybody: we’re safe from Skynet!" Rant:
@tsaukpaetra It worked for Mario and one of the Belmonts.
Yeah, but we couldn't just out right say "Hey, treat this like Mario 64!". It might have been more obvious if we duplicated the wavy-picture effect, but then again, legal stuff...
Is the wobbly-picture effect trademarked or something?
You could also try having some other sort of energy reaction when an avatar gets close enough to an "active" painting, like maybe a faint path of particles moving from the avatar into the painting or a ring of glowing energy around the border of the painting.Yeah, some kind of indicator would definitely help. I'm not a designer though so we'll have to wait and see.
-
@anotherusername said in The "Good news, everybody: we’re safe from Skynet!" Rant:
@gurth said in The "Good news, everybody: we’re safe from Skynet!" Rant:
Even worse is Windows Live Mail, which can’t auto-indent quoted text. There just isn’t even an option to make it do that, I discovered when looking into this
But, if they allowed users to make indented quotes, then users could possibly use them to create indented quote pyramids!
From what I read, MS intended to implement it in some future version, but those plans got shelved
-
@masonwheeler said in The "Good news, everybody: we’re safe from Skynet!" Rant:
in the majority of cases you do want everything
That very much depends on what you're doing. I would say the majority of my database queries return a subset of the columns in the table I'm querying, or have a few columns from multiple JOINed tables. It's pretty rare outside of ad hoc queries in SSMS that I ever get back all columns of a table
-
@boomzilla said in The "Good news, everybody: we’re safe from Skynet!" Rant:
I use it in common table expressions where I'm selecting from another common table expression that didn't use
select *
. Which of course means that I've really explicitly defined the columns, of course.I also wouldn't feel quite as awful about doing
select *
on a view, on the grounds that the view definition wouldn't need to change just because the underlying table definitions change. Would probably still enumerate the columns explicitly though.Do ORMs do
select *
much? They certainly seem to be at least partially to blame for many of the other DB usage antipatterns that crop up…
-
@gurth said in The "Good news, everybody: we’re safe from Skynet!" Rant:
From what I read, MS intended to implement it in some future version, but those plans got shelved
Well, it just means that many of MS's email clients have the sort of behaviour (when it comes to reply mangling) that reminds of the bad old days when Lotus Notes started to really do email that could be exchanged with other organisations.
-
@dkf said in The "Good news, everybody: we’re safe from Skynet!" Rant:
Do ORMs do
select *
much? They certainly seem to be at least partially to blame for many of the other DB usage antipatterns that crop up…I can only really speak about Hibernate. Technically, it doesn't
select *
, but it explicitly selects all the mapped fields. I don't think it's a major problem in this case, since you're usually only talking about a handful of records that are fetched like that. You can also tune the way it batches up requests, which solves more important problems than column bloat. I imagine you only get into real problems when it fetches LOBs that you don't always need.
-
@timebandit said in The "Good news, everybody: we’re safe from Skynet!" Rant:
@gąska said in The "Good news, everybody: we’re safe from Skynet!" Rant:
@weng and that's what we need. A GUI for stringing together building blocks
Eh.... could you imagine having to mine blocks to gather the resources to build basic code snippets to stack together to make a program...
"Hey jeff, I ran out of diamond. I really need another switch statement"
"There's some diamond left in that mining tunnel behind you. After that, we'll have to spawn a new world."
-
@xaade said in The "Good news, everybody: we’re safe from Skynet!" Rant:
@timebandit said in The "Good news, everybody: we’re safe from Skynet!" Rant:
@gąska said in The "Good news, everybody: we’re safe from Skynet!" Rant:
@weng and that's what we need. A GUI for stringing together building blocks
Eh.... could you imagine having to mine blocks to gather the resources to build basic code snippets to stack together to make a program...
"Hey jeff, I ran out of diamond. I really need another switch statement"
"There's some diamond left in that mining tunnel behind you. After that, we'll have to spawn a new world."You do have to mine the red stone that you use to make circuits.
-
@dkf said in The "Good news, everybody: we’re safe from Skynet!" Rant:
Well, it just means that many of MS's email clients have the sort of behaviour (when it comes to reply mangling) that reminds of the bad old days when Lotus Notes started to really do email that could be exchanged with other organisations.
Now you mention that, it made me remember some of my first experiences with Internet email, using WP Office on the Unix system of the college I was in in the early ’90s. After being told by people on a mailing list that I should quote messages, I couldn’t find how to do that (whereas on the BBS’es I was used to, it was a simple task). On asking a sysadmin, he said that the way to do that was to save the message, reply to it, then load the saved message into the reply, and add >’s by hand.
I’m assuming, given that I’ve never used it, that Lotus Notes was of this kind of standard too?
-
Well, yeah, in actual minecraft.
I meant, if minecraft was a gui for programming, and the different blocks represented different syntax.
-
@djls45 said in The "Good news, everybody: we’re safe from Skynet!" Rant:
@tsaukpaetra said in The "Good news, everybody: we’re safe from Skynet!" Rant:
@magus said in The "Good news, everybody: we’re safe from Skynet!" Rant:
@tsaukpaetra It worked for Mario and one of the Belmonts.
Yeah, but we couldn't just out right say "Hey, treat this like Mario 64!". It might have been more obvious if we duplicated the wavy-picture effect, but then again, legal stuff...
Is the wobbly-picture effect trademarked or something?
You could also try having some other sort of energy reaction when an avatar gets close enough to an "active" painting, like maybe a faint path of particles moving from the avatar into the painting or a ring of glowing energy around the border of the painting.Or make it like a modern game, with text at the top of the screen saying "Press X to stick your head in the painting", a graphic showing the commonly used action buttons with X highlighted and labelled "Stick head in painting", and a GPS arrow directing you to the painting. And on the load screen, make sure one of the tips is "Stick your head in paintings using X." Maybe a disembodied voice telling you to stick your head in the painting as well.
-
@xaade Programming could look weird in the next 10 years. I don't think it'll look like blocks, but some seriously weird visual stuff may become possible.
-
@magus given that programming with emoji is already a thing, it's hard to imagine the next 5 years not being full of that doesn't make sense to anyone.
-
p { font-family: Wingdings; }
-
@magus
E_
_NOT_FOUND