- 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
Admin
Admin
My thoughts exactly.
Admin
If it works, use it for now then replace it later, have a code review and quit whining. Duh.
Admin
Admin
Yeah, I also didn't notice any check if the date entered makes any sense.
But maybe I was blinded by all the other horrible things in there.
Admin
The thing that strikes me odd about the great Wrong that's apparently been done to web developers here is, where are you guys whenever a PHP or VB example is posted and everyone piles on? Presumably, in the pecking order of programmers, those guys must obviously lie somewhere below web developers.
Of course, "Patrick Bell" doesn't help out his "I'm a real programmer too!" creds by fundamentally mischaracterizing and misunderstanding the C language and its central role in the world of software development. But since he's likely a troll, I'm just assuming that was intentional.
The indignation also ignores the fact that the OP describes himself as a web developer, and that while his opening sentence may smack of elitism, everything he says by-and-large is true.
Admin
What you describe is my point exactly; lack of understanding of how the language works. Expecting a prototypal language to behave like a class based language is going to cause you a headache.
Admin
Admin
Fair enough. but as I've only just started posting comments last week, my response to the "where are you guys when..." is "elsewhere"
The pecking order crack was nice though, so not a complete loss.
Admin
True, since if they were pair programming, no actual code would get written while they repeatedly high-fived each other into a climax, saying things like, "Dude, awesome node.js t-shirt you're wearing today", and "Dude, totally dig the new Octocat sticker on your MBP"
Admin
Let's face it, js is not the best language. Perhaps it's not the worst, but it makes it harder than most languages to develop a large scale, maintainable app in a team environment. That being said, this is an awesome reference for those wishing to expand their mastery of js: http://eleventyone.done.hu/OReilly.JavaScript.The.Good.Parts.May.2008.pdf
I have worked with js for many years and would love not to have to work with it ever again. Unfortunately it is now more popular than ever, so dig we must.
Admin
Even for those ashamed of their laziness, I don't think it is a good idea to hide it behind a lot of incompetence. Remember your javascript code is going to be visible to a lot more people than the code you run on the server side.
Poor client side validation code will make people think you are incompetent and forgot the server side validation. Good client side validation code will make people think you know what you are doing and remember to check most things server side.
Admin
Well obviously both your client side validation and server side validation should be 'good'. We validate on the server side to prevent hacking and bad data entering the db. We validate on the client side to make for a nice user experience. That's it. Just to give the user a better experience, meaning not having to see a page refresh. It seems trivial and redundant for a developer (it is), but it looks more professional and is one of the small things we do to please our clients and keep them coming back for more.
Most developers don't care about UX as much as they should. Given the choice between a development company that makes beautiful, intuitive, poorly coded and possibly insecure web apps, and a development company that makes excellently coded, maintainable, secure, but ugly and difficult to use web apps the client will go with the former every time. So I try to do both. And if you work for someone who requests this redundant validation, perhaps you can step back and understand it's because they like money and want to keep making it.
Admin
wow. please don't apply for a job here
Admin
You mean the people who claim to be programmers but do read that junk every day?
Admin
Done properly means the server side code is written as if the javascript wasn't there in the first place. And when a user gets to the form, types in valid input, and submits, neither the user nor the server sees any difference between a browser with javascript enabled and one with javascript disabled.
There is a high requirement for the quality of that javascript code, because not only is it in plain sight to the power users, and you will be judged on that. But also because before you even start writing the javascript code, you have a functional system. It takes just one stupid mistake in the javascript code where you cannot handle some corner case before you get into a situation where the system overall would have been more functional if you had not written any javascript code in the first place.
I'm not trying to discourage such use of javascript. But only use it if you know exactly what you are doing. If you are going to cut corners, and most IT products do, then that javascript is an obvious corner to cut.
It is neither trivial nor redundant. Writing the same validation twice in two different languages does seem a bit redundant, so a system that can automatically generate both instances of the validation from a common source is a nice feature to have. It can also guarantee that the criteria is in fact identical.Admin
Duplicating your validation code client-side is old-school (even if you have some code-gen way to do it, which probably means you are forced to write your rules in some idiosyncratic DSL).
You can send user input to the server while they are entering it, validate it server-side, dynamically update the page, and the user won't know the difference.
Admin
I went through the whole visa thing some times ago. I think they deliberatly made it that way so that the weak-of-mind commit suicide before finishing the application.
Admin
The code is terrible, for sure, but Joe sounds like a dick.
Admin
I see your Date Selector of the Damned and raise you the Email Script of Doom. 13,000 (YOU READ THAT RIGHT) lines of code to collect inputs from a fairly simple form and drop them into an email. I wept when I started reading that thing. A visit to their forum suggested that in order to get it to run,I should give RWE perms to the command prompt to IUSR. Is a severe beating warranted her?I should think so....
Weeping.
Melissa
Admin
13,000? o.O
That's.... o v e r .... 9 0 0 0 !
Admin
All you people complaining about the OP's "insults to web programmers" need to re-read that first paragraph again, and actually process his words before flying off the handle in an angry rant.
He doesn't speak one single word of disparagement about web programmers in general; he's speaking to the reputation that the industry of web programming has developed because it does actually have an overabundance of bad programmers.
My captcha, 'genitus', reminds me of the story of that guy with the 100lb balls. I did not need that reminder right before going to bed.
Admin
All this super accurate "well technically" arguing is funny because it always starts with: "He doesn't speak one single word of disparagement about web programmers in general" and without a hint of irony finishes with:"...it [i]does actually have an overabundance of bad programmers."[/i] All based on anecdotal evidence and confirmation bias on a site that contains plenty of evidence that bad code is every damn place. "Oh yeah?! well every one of them I've ever met has been..."
Bonus points for the OP being "the one sane man" as well. It seems all the other web developers are the dumb ones, just like every second comment here declares the methodology assertions of the one above it stupid.
Bob:C++ is ....
Tim:Well actually no, because....
Tim:Pfft! You're both idiots since...
Tim:Dumbasses! You could do all that in a line of PERL...
Mark: Don't you know anything?! It's Perl!...
Admin
Wow, wouldn't like to hire your dream company. I'd like to work somewhere that hires only art and design grads as web designers, and doesn't hire 'web developers', but actual software developers - and the best of those are often not CS grads, but Maths or Physics grads.
Websites designed by CS grads look like, well, open-source GUIs, with no usability. I've never found a problem with working from jpegs (with some notes about animations, etc) as GUI specs - though you do need to make sure you've got examples for stuff like drop-downs, and clear descriptions of how animations work.
Admin
Ehem
Manditory
Also why does askmit think that this is spam?
Admin
Well the browser time could be totally wrong
Admin
Also depending on your system settings the date returned could be unparsable server-side. We've had that one happen a few times.
Admin
The model validation code in ASP.Net MVC beautifully does the same validations server side and client side (by automatically decorating the relevant fields with jquery recognizable validation attributes). One of the real selling points.
Admin
I once read a blog post by some guy claiming he tends to employ people that appear lazy. The reason being they think before doing anything to limit the actual work to a minimum. I think I see were he is coming from!
Admin
Comment's too short.
...................
Admin
Admin
I replaced it with 89 lines and some tweaks to the form itself.
Tectite.com if you are interested in viewing this abomination for yourself....
Melissa
Admin
I love this bit (lines 8554–8560):
That's one mother of a script …
Admin
$i_rand = mt_rand(0,16777215); // 16777215 is FFFFFF in hex
gud 2 no
Admin
Parrot comments ?
Oh, and iterating with the initial value... a WTF on a single name + operator, that it not easy to achieve.
Admin
If the page was properly designed the user wouldn't even have the option to pick 30 days for February. A date picker should know how many days are in a given month.
Admin
That will probably work on someone's personal site in a year from now. Would a real site use that code? Not for at least 2+ years.
Admin
or expert sex change depending on how you parse it
Admin
suck my dick bastard