- 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
unless indexing is still on: the search engine could come along before the file deletes itself or it could finds files that haven't been deleted because of popup-blockers ...
Admin
Hmmm.
Pick has a function to send email?
Why not use that function?
Admin
WTF level problem and WTF level solution. I like that! Can I have more cake?
Admin
"A simple bit of ASP at the end of the file which caused the file to delete itself when it was run, and that problem was solved as well!"
That's so inspector gadget of you!
This message will self-destruct in 10 seconds.
Admin
So your solution to the WTF was to make the WTF worse by adding yet another technology (AJAX) to a very poorly constructed bit of functionality?
Just DO IT $%^#& RIGHT!
Admin
I think it's the PICK Operating System. It has a built-in database and uses a BASIC dialect. I knew someone who wrote PICK-BASIC.
PICK's closest relative is the MUMPS Operating System.
I have no idea how anyone got an ASP server to speak PICK!
Admin
Ah, PICK... Pick Basic was my first production language... My first quine... Back when I was TRWTF!
Admin
What happens if a search engine drops by while the initial request is being processed? It hasn't been deleted yet, so it gets loaded and executed again.
Now, I'm not sure on the exact consequences when the second execution tries to delete the file again. I suspect the current request would throw an exception and be terminated. Not a big deal, except that it might add a bit of noise in your log files.
More importantly though, the mails would still get sent twice.
Of course quick ugly workarounds are sometimes the only acceptable solution, but in this case, 1: the quick fix didn't actually fix the problem (just made it happen less often), and, 2: wasn't actually significantly quicker to code than a proper solution.
Admin
(1) Sometimes you just have to bite the bullet and hack. This is a perfectly good hack (with the almost certain exception of the Alice-in-Wonderland Delete Me option). Less often is better than nothing.
As noted by the OP:
(2) At least it puts a boil plaster over the single place of occurrence. Even after a year working in a large-scale WTF environment, I've never been too happy about chasing down the hundreds of dependencies and fixing this sort of thing "the right way." The key here is to submit a proposal to fix it "the right way" to a trusted boss. Of course, given less than a month, you probably don't have a trusted boss.
Yes, it's horrible, but so is the mere concept of having Javascript over ASP over PICK. I'm going to avoid cheese tonight and hope that the nightmares are merely gruesome rather than life-threatening.
Let's face it, the real solution is to abandon the whole mess and rewrite it from scratch. And in case anybody quotes Spolsky at me: in this case, people who live in foggy creeks shouldn't throw hailstones.
I suspect, btw, that if the OP (or Alex) hadn't used the phrase "leveraging my knowledge of AJAX," but had instead been more self-deprecatory and said "biting the biggest Big One I'd ever bitten in my life," some of you clever dicks out there might have been more understanding.
Admin
So they use a hack to trigger the script (pop up a new window), and when that doesn't work, the solution is to use an AJAX request instead? If the AJAX works, why not try it first, and only fall back on the hacky, less reliable popup window only if that fails?
Admin
He had confidently learned to use the word "leverage" as a verb, though. It's LEVER!!!!
Perhaps he meant: "Note quite confidence enough in my first month to refactorage the codedness to callage the internal emailing routineness, I leveraged my knowledge of AJAX to solution the problematic."
Admin
Gods, I hate know-it-alls....
Dictionary.com Unabridged (v 1.1) - Cite This Source - Share This lev·er·age
Audio Help /ˈlɛvərɪdʒ, ˈlivər-/ Pronunciation Key - Show Spelled Pronunciation[lev-er-ij, lee-ver-] Pronunciation Key - Show IPA Pronunciation noun, verb, -aged, -ag·ing. –noun ... –verb (used with object) 5. to exert power or influence on. 6. to provide with leverage. 7. to invest or arrange (invested funds) using leverage.
Admin
Well, the site is called "The Daily WTF", not "The Daily WTF and solutions". :P
But as far as the ASP thing goes, I agree, who cares what you're coding in, a good programmer will be able to adapt between languages easily, after all, the key to programming is being able create the logic to solve problems and perform tasks, not knowing the syntax of a particular language.
CAPTCHA: pecus <== WTF?
Admin
Hit reply instead of quote :P
Admin
When I see things like this, I wonder how it handles NoScript.
On my browser, you cannot open windows or use JavaScript without my permission.
Admin
Yeh, but we're writing code in the real world, tiger.
Hulver has my sympathies, because I'm in a similar position to him with my current work (although not using ASP thank God...)
Any given day I'll have 7-8 different, large projects to work on. When an error like this comes my way, I check it quickly, sigh at the guy who managed our intranet before me, and if I can, fix it properly.
If I can't (and most of the time I can't), I hack a 5 minute solution and I add it to my to-do list.
Every few weeks, I get a glorious, blissful day where I have a few hours free. I use that time to bring as much of our intranet code up to par: documented, standardised, error-checking, browser agnostic.
I just don't have time to make everything a perfect solution the very minute I receive it.
And if I keel over dead tomorrow, at least there's some documentation for the next guy saying "this is a nasty hack, it does this, and it needs replacing".
Admin
"Post Office" is capitalized ? "How often to" ? "Check you mails" ?
You sound like a toddler trying to speak the language.
Admin
The bulk of the work obviously isn't in finding the right way to do it in general. It sounds like the programmer already knew that.
The real cost is in analysing the existing wtfy system thoroughly enough to understand all that is going on and ensuring that the fix doesn't break something else.
If you think that this is any small task for someone new to the project then you're either a genius who needs not feer the worst wtf or you've been quite fortunate in what you've been asked to maintain.
Admin
OK, I code in the "real world," and I see this philosophy employed all the time.
"I'll put in a quick hack now, and later we'll do it right."
Except, let's be honest, it rarely works out that way. Usually the hacks pile up until one of the following happens:
You're only in the position of needing to use a quick hack because your predecessor used one, probably for the same reason. Don't perpetuate the cycle. Do it right, become a better developer in the process, teach your managers to have realistic expectations, and leave a system that someone else will want to maintain.
If you need to learn PICK to solve the problem, then learn PICK (whatever it is). If it means taking longer than your boss expected, explain why. Research is a valid part of the job. Insist on doing it right, or leave. If you're not willing to do all that, that's fine, but you lose the right to complain about WTFs, because you are the WTF.
There are occasions when the survival of the company depends on a quick and dirty solution, but not that many. 99 times out of 100, it's just an excuse.
Admin
Yeah, that's what you did. You "leveraged" know knownledge.
Admin
Awesome reply!
*Puts on armor, and braces for the massive flame-flood the question is going to release.
Guys, I have a question.
I am working on an ASP.Net website, the development of which is plodding along at an unacceptably slow pace because of my lack of ASP.Net expertise (though I am well-versed in ASP - which might be irrelevant), and the fact that everything needs to be done enterprise-ily in .Net.
The website is still in very early development (only the database, and some data-entry forms have been created).
I am thinking of porting the application to PHP, using the CodeIgniter framework. The reason being that I have gained significant experience on PHP in the past few months.
I feel confident that coding in PHP will accelerate development by an order of magnitude, and as long as I follow best-practices (the PHP framework is helping by allowing me to use MVC, reusing libraries, etc.), I can develop a decent, maintainable, robust website.
As I was examining the existing SQL Server database, and wondering how I could port it into MySQL, I realized something scary - most of the stuff I'd taken for granted in MSSQL, like relationships, stored procs, etc., have little or no support in MySQL.
And now, the question:
Is PHP a feasible, logical solution for what I have in mind? Will MySQL destroy any chances I have of writing a decent, robust website? Or if I make sure to follow best-practices while designing the database, will it be just as good as a database in MSSQL?
Admin
I'm glad to see another developer who knows that hack-upon-hack is the cause of so much pain in the programming world. "This is the real world" should not be an excuse to code badly. It is actually the reason to do it properly!
I am not fortunate in my experiences (quite the opposite). I'm not sure if therefore it makes me a genius. But I am sick of dealing with the fall-out from those developers who think that nasty hacks are a necessary evil and, in some cases, think they are 1337 coders because they were able to bodge together a fix that, although it works for now, creates a bigger headache for the next guy.
Admin
Admin
Admin
Well of course PHP/MySQL are a feasible option. What you really want is our opinions on if it's worth it.
I think that if you are having trouble with ASP.NET you probably don't correctly understand all of the technologies/methodologies employed in those projects. I had the same problem when first trying to write a J2EE project.
PHP will be faster in the short term but , an ASP.NET app should be better in the long run as a maintainable app. Even if you abide by good design in PHP, the next guy probably won't. That's what makes stuctured languages so important. Lastly since you've already got SQL server available I see no reason to punish yourself with such a downgrade.
My main suggestion is to rethink your ASP.NET approach. The "enterprisy" features should be an asset, not a liability. Drastically different models of coding can be difficult to adjust to but if you understand it correctly and really embrace it, it shouldn't take long before it becomes second nature. Once you are properly adjusted, I bet you'd thank yourself for sticking it out.
Admin
The solution is a WTF in itself. Instead of just removing the dumb auto-generated ASP files and sending e-mails immediately, more code was added to handle this stupidity.
Admin
Thanks for your reply!
Hm...I think you nailed it regarding the "not correctly understanding all of the technologies..." bit. I do realize that, and in fact, that's what I'm afraid of - that I'll have to invest a lot of time and energy to learn ASP.Net, and its associated enterprisy (ok, "enterprisy") features. But then would it be worth it?
Couldn't I accomplish the same using PHP (assuming I'm not doing this, because I'm just a lazy-ass looking for shortcuts)? What are the significant advantages of using ASP.Net over PHP?
I've heard of answers like execution speed, security, rock-solid stability, development speed, and platform-independence. I would think all of these also apply (in greater extents, sometimes) with PHP (applying sane coding practices)?
Regarding the part about the next guy not necessarily following good design, wouldn't you say that's a risk even an ASP.Net development faces?
Again, I'm not trying to troll or to look for the easy way out - I'm looking for a compelling reason for either choice.
Oh, btw, I'm using Web Developer 2008 express and MSSQL Server Express - so there's no investment in terms of money for the platform.
Admin
Self-realizing WTF begins to learn at a geometric rate.
Admin
Admin
Directory indexing executes the files it encounters?!? WTF!??!
Admin
Poke, Poke, Sizzle, Sizzle, "Out, vile jelly!" [Idiot screaming in pain].
Admin
what a f+cked up solution. put in an img or link tag referencing the emailing asp file instead. faster than the '5 min' fix and works on browsers w/javascript disabled.
talk bout a n00b fixing anothers n00b code..
Admin
oh right, shitty crud applications in PHP.. my mistake ;)
Admin
Admin
Admin
Nonono.... you must never use the GET HTTP method for something like this! Replace using GET with using POST, a search engine would never issue a POST command. The idea of POST is exactly that: for requests that do things (like sending an email).
Admin
98.754% of nit-wits write numbers pulled out of their ass as though they were precise measurements.
Admin
ZOMG...I may know who this is and where he's working.
hulver, is your office on the frontage road of an interstate that had a major bridge collapse in the past year?
Are dogs allowed in your office?
Am I working where you used to work, and vice versa?
Admin
Did you go to the Hollywood Upstairs REST School?
Admin
Nope, I'm in the UK. This sort of WTFery is global I'm afraid.
Admin
Why in the world would you choose JavaScript to perform this menial job? Never use a web based language if you can get away with it, and in this case I'm betting you can.
Guess you missed security, the day it was taught?
Admin
I cannot stress enough how important it is not to just find a solution to the problem. You need to know how to find AN ACCEPTABLE solution. (And, as sometimes is the case, if your knowledge of possible solutions isn't enough, you need to find new solutions... or hand over/share the problem with someone who has these solutions.)
I've seen too many projects were single programmers went on a solo-flight, dead set on solving the problem or die trying, just to come back with a system they could only maintain by moving on to the next job...
If you're new to the technology and uncertain, get help!
Admin
Admin
Admin
Oh, perfect. Your answer comes the day after I've decided to go with PHP!
Anyways, I've deluded myself into thinking that I can write a decent, scalable app in PHP. I'll let you know when to say "I told you so", once I'm featured on TDWTF. Keep your eyes peeled.
Admin
OMG, the REAL WTF here is why not use ASP code directly to send an email. why do it like this, its totally useless. what if the user has disabled javascript?
Admin
And you're the first idiot.
Admin
we are paypalhandbag.com offer AAA top quality handabgs and wallet online sell accept paypal payment and save your 40% money,free shipping and fast deliver.
Louis Vuitton is Top brand of handbags, it's shortened to LV,is an international french fashion specializing in leather handbags,shoes, watches, jewellery, accessories and sunglasses.
Known the world over for its iconic LV monogram and logo, Louis Vuitton is one of the most recognizable brands in the world.
if you like louis vuittons products pls visit to our company website,we supply best prices and quality to you.if you also need other prodcuts we also can offer to you.
just click our website address doing happy and easy order. we are accept paypal and credit card payment.
http://www.paypalhandbag.com
Admin
Cheap jerseys,wholesale jerseys,cheap NFL Jerseys,Wholesale NHL Jerseys,MLB Jerseys,Cheap MLB Jerseys,NBA Jerseys,Cheap NBA Jerseys,Cheap AUTHENTIC Jerseys,Authentic NFL Jerseys,NFL Youth Jerseys