- Feature Articles
- CodeSOD
- Error'd
- Forums
-
Other Articles
- Random Article
- Other Series
- Alex's Soapbox
- Announcements
- Best of…
- Best of Email
- Best of the Sidebar
- Bring Your Own Code
- Coded Smorgasbord
- Mandatory Fun Day
- Off Topic
- Representative Line
- News Roundup
- Editor's Soapbox
- Software on the Rocks
- Souvenir Potpourri
- Sponsor Post
- Tales from the Interview
- The Daily WTF: Live
- Virtudyne
Admin
Rule number one of showcasing your work: remove all non-functional buttons.
People can see the feature is "done" and no amount explaining can convince them otherwise.
Admin
If you remove them you may forget to finish them, I'd just leave them there but disabled. But yeah, good point.
Admin
Or make them pop up a dialog saying “Not yet implemented”.
And never implement functionality that lets you delete everything with one click. No production interface ever ought to have that capability; too Belgiuming hazardous…
Admin
Admin
While it appears to be de rigueur to give a junior dev a lambasting for having a dangerously incomplete button on a page, TRWTF is Tim, butting in on a dev session unannounced and unscheduled, pressing buttons at random on a still-under-development application.
It happens all the time. Happens to me on a regular basis, someone comes waltzing up to tell me an unfinished web page looks rubbish because I haven't done the styling. It's the same mentality that has people swanning onto a building site and complaining that the floor's all muddy and the joists are visible.
Admin
I think the real WTF is to have a dev machine connected to an actual production database, especially if it's not read-only access.
Admin
I would agree to an extent. I don't think there is ever a reason to have a button that does an unconstrained delete on a database, even if you are developing (unless the button has a label along the lines of "Wipe Table"). But at the same time, Tim has the bigger WTFs. Why would you click a delete button on an incomplete interface without checking first, and more to the point, why are your developers working on production? That is just asking for trouble!
Admin
The look on some people's faces after you exclaim "A-HA! Crashed! Excellent!" is priceless, though.
Admin
Particularly as Tim knows the app is connected to the Production database, he is bound to be careful of a button saying "Delete". As a junior dev, it is not Scott's call to involve in configuration (mis)management.
Admin
Raise your hand who never had similar "delete" accident on production :smile:
Admin
Me with bank production database login:
http://s3.amazonaws.com/images.hitfix.com/assets/8675/scrooge-mcduck-e1363347903905-640x362.jpeg
Admin
:wave:
Though I had to fight tooth and nail recently for that, because someone wanted to start using the application already despite it being deep in test phase, so they tried to just push everyone to prod and shut the dev environment down, because why manage two servers when you can manage one?
I told them to go fuck themselves, I'm not pointing my potentially buggy application at production, especially not while I'm developing it, especially not when I have no idea where I can put test data so that they don't interfere, and if they shut down our dev environment I'll just stop doing features and start making mocks.
Then, of course, it turned out some people have been using the test version of the application running on the dev database to do their reports anyway, so...
Admin
Please, the problem is not the button, the query or the PM. TRWTF is the whole database setup. Not only the delete, but guy was also running not optimized queries and inserting dummy data. Just plain stupid.
Admin
Well, yeah...if you have warning you're going to be showcasing your work...
No kidding. That's TR :wtf: here...testing, once again, in production. Sigh. When will they learn?
There's no reason for it, but it can happen in development code. Here's a goodie of mine in Rexx that nearly destroyed the testing database.
Now, you noticed the missing continuation comma right off, right? The one that meant the "update" did not have a "where" clause? Neither did I. Fortunately, I was saved by the fact that "code" was a key of a unique index and setting all the rows of the table to the same value for "code" wasn't possible (failed). But that is why I now do this with all my Rexx queries:
(If a continuation comma is left out, this becomes an expression with imbalanced (), which causes the script to fail with a syntax fault.)
Anyway, the important lesson here is that we learn this stuff by experience.
Admin
Well, let's just say I learned how dangerous "ON DELETE CASCADE" can be.*
*It was technically correct, but I accidentally made the foreign key point to the "cache" table that was re-created from the actual table every month. TRWTF is that MySQL doesn't support proper materialized views…
Admin
You know similar "this could destroy everything" moments have happened to you from time to time; you just didn't have someone show up and actually hit the Big Red Button at the worst possible moment. Right?
Admin
That depends... are you referring to in your day job or on a toy project?
If the former... raises hand
Then again, for the past 10+ years, I always write a
DELETE
statement as aSELECT
statement first to see what it will affect.Admin
Admin
Is
,
in Rexx like_
in VB?!Admin
Well, that depends on your religion, mostly. It has a few ugly moments, of which continuation comma is one of the worst.
But as a glue language, like TCL, it's pretty powerful; I've done some pretty heavy scripts in it.
Yes..and no. It is used the same way, to continue statements (last non-blank on a line). But to make it miserable, comma also is used as a parameter separator in "call" and function references:
That's four parameters, with continuation comma on the end of the first two lines; the other commas are parameter separators. Really easy to sort that out, isn't it?
Rexx is often clever in its structure, but Mr. Cowlishaw should have been made to suffer for his choice of continuation characters.
SQL statements are some of the worst because they're often long. Otherwise, you don't need to use continuation all the time.
Admin
TRWTF is newbie developer given access to build a new app and test on a production database with no supervision
Admin
I inherited a script which I foolishly ran without arguments. Whoever had programmed it didn't think of this case, because without arguments the script simply deleted everything rather than the specified subset (I think it was by date).
We didn't have best practises. The script directly called from the production server. As root user.
I restored the data from the dev server. Nobody ever found out.
The part I'm still trying to remember is the syntax. The where clause (in MySQL) would have been intact but for the empty value. Maybe it was wrapped in a LIKE '% + string + %' or something.
Admin
This quote just got better:
Admin
Admin
So he did have a delete-everything button, even if just transiently. ;)
Admin
raises hand
In my now almost 15 years doing development and maintenance on data acquisition systems i have done:
segfaulted the main data logging server program (writing and reading fro GPIB) by asking for channel 0 (the program had no bounds check on the array containing the channels it knew) and at that time, i was quite new and did not know the system well, so had to call the senior dev (it was evening) in order to find out how to start it again (no measurements could be performed while the server program was not running).
Rebooted the main database server unintentionally (was only off line for 30 seconds, but boy did it feel like a long time.....)
as well as:
rm * (as root, on one of the data acquisition servers, and while in /etc. ) it was intended to be in an other window, but luckily we DO have good backups and only a few noticed that one :-)
Admin
FML, most of my server-type stuff takes orders of magnitude longer to reboot. Lets see, about 5 minutes from cold boot for the file server, two minutes after that to start the embedded media and web services, three minutes after that for Domain services (if it's not doing Windows Updates), and at least five minutes for everything else after that (other toys and VMs et al).
Admin
The button was irrelevant. It'd have happened sooner or later. Untested software connected to the production database = death.
Admin
30 seconds? What DBMS were you using?
Goddamned. SQL Server won't boot in 30 seconds on the world's fastest computer and SSD even if it didn't have to go through and double-check the transaction log. Unless your database was minuscule, on a SQL Server box I'd expect close to 30 minutes before it was ready to go again.
Admin
Little known technology called "Load .csv file to RAM". :trolleybus:
Admin
Along that line, we're using a proprietary read-only key-value store which is ready for use after less than a millisecond.
Admin
I've developed a super-fast database for my product, it's called "having no customers at all".
Admin
The primary is on oracle, which can be slow as molasses at times. The key-value stores are cache, and much faster, especially for those binaries where it completely replaces the database connection.
Admin
Even a many-GB Progress database server will start up in under a minute, but that's partially because it does a lazy startup. The first thing it does is bring up a broker, which spawns extra server processes on demand.
Admin
Well we are not that database intensive. All our research data are stored in normal flat text files in order for the data to be always readable and not prone to vendor lock-in. The efect is that we have the data online even for experiments done 10 years ago even though the data has been moved to new hardware twice since aquisition.
Our main database in our department (which is the only ones I have access to) is a postgresql on a linux system running on consumer hardware worth roughly 800 Euro. The data is roughly 300 MB, and I expect that the type of RDBMS does not matter much for such a small db.
The database handles user permissions and safety information for our test systems as well as our reservations system and work request system ans other small administrations systems with the important part being the user permissions (without that dab running no-one could log in to our test systems and change conditions for anyone of our 70+ experimental systems.....)
Admin
Hey, it works for James Bond. Swanning into Q's lab to play with all the newest toys.
Admin
The worst is spending $50,000 on an HP server with all the bells and whistles just to spend the same five minutes watching the POST screen as on a $500 server. Meanwhile my HP desktop would be logged in within 10 seconds. HP really badly needs to work on their server hardware boot times.
Admin
TIL a new word: "swanning": to move or go about in a casual way. Never heard it before.
Thanks, TDWTF!