Comment On The Little Button That Could

Today's post is a bit different than most. You see, the code is well written, well commented, and well documented. No less, we shall take a tour through the system which Steve L. maintained for a brief time, that had "The Little Button That Could" ... [expand full text]
« PrevPage 1 | Page 2Next »

Re: The Little Button That Could

2005-07-14 14:56 • by loneprogrammer
Have you considered using Javascr... er... wait.

AJAX

2005-07-14 15:01 • by linicks_fool

Now I know why AJAX, the latest buzzword, is swarming IT.


Remote requests in Javascript has been around and in use for quite a while.


Nothing like an acronym to pour kool-aid.


You go Javascript!

Re: The Little Button That Could

2005-07-14 15:03 • by JThelen
It's like he tried to reinvent the wheel and some how came up with a Platypus or something.

Re: The Little Button That Could

2005-07-14 15:03 • by whojoedaddy
All that for one button press? At least they didn't code their own button like the wtf a few weeks ago.

Re: The Little Button That Could

2005-07-14 15:05 • by Javier G. Lozano

It's like an onion!  Layers upon layers upon layers...

Re: The Little Button That Could

2005-07-14 15:10 • by christoofar
I worked at an outfit that operated exactly like this. 
XML-panacea.  Everything had to be done with XML, even though the
possibility of multiple layers of seperation were minimal... at best,
with the database server sitting beside the application server.



This is a fundamental example of the accidental complexity antipattern
(http://en.wikipedia.org/wiki/Accidental_complexity) and possibly
reinventing the wheel.   I mean really, how many more ways do
we need to invent an invole->call to database->resturn result
paradigm?



I guess the program would have been a bit more interesting if the
button click caused a message to dump into MSMQ, to get picked up by
another server, processed and routed back to a database table, then
have another thread spinlock until the update/approve went through...



Re: The Little Button That Could

2005-07-14 15:10 • by Fregas
38420 in reply to 38416
OH MY GOD! I HAVE SEEN SATAN!!! I HAVE SEEN SATAN!!!!!

Re: The Little Button That Could

2005-07-14 15:12 • by christoofar
38421 in reply to 38419
    //make sure the receiver page accepted it
if (xmlHttp.status != 200)....


Oh God.  My eyes!


Re: The Little Button That Could

2005-07-14 15:13 • by rogthefrog
38422 in reply to 38420

Anonymous:
OH MY GOD! I HAVE SEEN SATAN!!! I HAVE SEEN SATAN!!!!!


WTF do you mean? It uses BOTH Javascript and XML, so it's got to be optimal!


Luddites. Sheesh.

Re: The Little Button That Could

2005-07-14 15:16 • by x-sol (to lazy to login)
They need to put a disclaimer on XML that says "For cross platform data migration and *.ini replacement...."

Re: The Little Button That Could

2005-07-14 15:17 • by Jehos
38424 in reply to 38416
Anonymous:

It's like an onion!  Layers upon layers upon layers...



No, it's like a donkey.  It wears its WTFery right out on its sleve.

Re: The Little Button That Could

2005-07-14 15:17 • by christoofar
38425 in reply to 38422
It's crap like that button that make me cling to winforms.  If you
can't do it on the web with PHP, then it's not worth doing.





Re: AJAX

2005-07-14 15:24 • by ata
38428 in reply to 38412
Anonymous:
Now I know why AJAX, the latest buzzword, is swarming IT.


I suppose it's because it has an 'X' in it. Hell, that's the only reason XML itself is so popular.

Re: The Little Button That Could

2005-07-14 15:25 • by Nayf
38430 in reply to 38425
I wonder if there's a rule that says that if a WTF is a really, really
cool WTF, it passes into the realms of awesome.  I think there's a
fine line in many cases.  This?  This is awesome.  Yes.

Re: The Little Button That Could

2005-07-14 15:30 • by Lumpio-
38431 in reply to 38430
Another WTF is only supporting IE. Either the WTF is the thing about
only supporting IE itself or it's the company/whatever still using IE
for accessing the page.

Re: The Little Button That Could

2005-07-14 15:34 • by triso
Obviously, this is the work of some good-hearted consultant who wants to be sure that her client gets her money's worth.



Lotsa code for Lotsa $.



Re: The Little Button That Could

2005-07-14 15:41 • by Stan Rogers
38437 in reply to 38430
C'mon folks, don't blame AJAX (or, um, "background XML requests", as we
used to call them last week) -- at least the requests don't set off a
clickstorm in IE like adhoc iframed postbacks would. (Oh, and anyone
who would suggest going back for a whole new UI every time a datum
changes really ought to given a 20-year sentence restricting them to a
300 baud strap-on acoustic modem and a rural POTS line. No-one who
gives half a crap about either the customer or the server would do
that. Granted, it works well in single-user testing on localhost or
over a five-foot gigabit LAN cable to a dev server.)



No, the WTFery is in the server-side Goldberg machine. Why would anyone want to simply flick the lightswitch?

Re: The Little Button That Could

2005-07-14 15:43 • by Stan Rogers
38438 in reply to 38437
Oh, the failure to include the Moz-style XmlHTTPRequest version is almost expected -- way too much web stuff is IE-only.

Re: The Little Button That Could

2005-07-14 15:46 • by scheky
38441 in reply to 38431

Lumpio-:
Another WTF is only supporting IE. Either the WTF is the thing about only supporting IE itself or it's the company/whatever still using IE for accessing the page.


 


Well Lumpio, welcome to the real world, where many corps do indeed use IE, both as a browser for their employees and as the only browser supported for internal web apps.  Only needing to support IE may have actually been part of the defined standard architecture for the company, and if so, it would have been a WTF to not take advantage of that fact.


Of course, this code makes my brain hurt...somebody needs an enema.

Re: The Little Button That Could

2005-07-14 15:46 • by andy brummer
I worked on something similar, except every com object method call was
done with a pair of access numbers which referenced an xml document
stored in a database which told the system which output template to use
and how to map query string variables to method parameters.

That was just the beginning.  In order to debug the application I
had to have a minimum of 4 instances of VB6 running in debug mode,
sometimes more.  The state of the request was stored in an XML
document that was never persisted.  Each procedure call added a
node to the document and xsl transforms were loaded from the database
to transform nodes of the document and add the transformed xml back
into the original document in a different node.  Then the new and
updated data were used randomly by different components.

To top it off, it interacted with a SQLServer database, Java web
service, a home grown queue system based on a SQL server table and
Oracle Active Queue.  Plus I was in a design review for the
project before it was started.  Made sure I let everyone know it
was a horrible idea, but they went off and did it anyway only for it to
drop back in my lap 2 years later.

Re: The Little Button That Could

2005-07-14 15:47 • by cm5400
My Friggin Eyes!  I can not believe that... Wait a minute, must have been written by a highley paid consultant that got paid by the line, no WAY would anyone have so many layers in between.  That's like creating a database table for each item of data that you need to store.  WOW, my brain hurts thinking about that POS code, I need an migrane pill now.  I would have ran screeming through the friggin hills, blowing up every bridge on the way if I had to maintain that, and not looked back for one nanosecond.

Re: The Little Button That Could

2005-07-14 15:49 • by Lumpio-
38445 in reply to 38441
scheky: If that's indeed the truth here then the developer has done
nothing wrong - but my post didn't imply that. Using IE is still a WTF.

Re: The Little Button That Could

2005-07-14 16:01 • by Manni

It always has to turn into an anti-Microsoft campaign by some of you, doesn't it? Using IE is a WTF? I have coworkers that use Mozilla, Firefox and Netscape and have their own set of problems.


As for this nugget of Javascript/XML overkill...wow. I had no idea something so simple could be so over-complexified.

Re: The Little Button That Could

2005-07-14 16:26 • by Free

Most poeple who reinvent wheels do it because the don't understand "the wheel".


 


Ending up with a platypus should not be a surprise :D

Re: The Little Button That Could

2005-07-14 16:36 • by j99
It's like someone tried to reinvent the wheel and ended up with a dodecahedron. It still rolls, but is more than a bit clunky.



http://mathworld.wolfram.com/Dodecahedron.html



Re: The Little Button That Could

2005-07-14 17:02 • by foxyshadis
38461 in reply to 38453
Do you guys REALLY want to see what a HASH this guy'd have made of
mozilla-style code? It'd have been entirely new pages with entirely
different code, partly copy-pasted from the old and partly from the
web, including lots of unnecessary "workarounds" he found for NS 3/4
bugs and then workarounds to work around the workarounds, and requiring
a different server for a different xml/db schema. It'd probably involve
a custom xpi being installed too.



I tried pushing FF in my company, but I'm afraid I'll never be able to
do it without some support for group policies (microsoft's or
homegrown). Full privs for everyone and editing everyone's profile
separately are not options to any admin who values her time.

Re: The Little Button That Could

2005-07-14 17:23 • by mitchner
38464 in reply to 38449
Using IE is not a WTF.  The WTF is taking something so simple and
coding it in a browser-specific manner.  If someone is writing an
intranet page that uses of tons of DHTML to build super-fancy menus and
such, maybe IE-only code is OK.  A simple 'submit' button using
IE-only activeX  controls certainly rates as a WTF in my book.

Re: The Little Button That Could

2005-07-14 17:24 • by onyxraven
So we've got ajax style message passing for a simple post, and a
plethora of com objects... thats all pretty good WTFery, but one of the
things I do like is that it sounds like the class that executes the
stored procedure is using ADODB to execute a procedure in the 'standard
method' ... with all of this XML being thrown around, did they not know
that SQLServer2000 speaks pretty good XML itself?



The last company I worked at used primarily XML for web interaction,
using xslt to transform complicated database calls into html for
display.  It was rather clean, and decent seperation of MVC, lots
better than ugly COM objects and crap everywhere.

Re: The Little Button That Could

2005-07-14 17:47 • by wekempf
This architecture sounds very J2EE to me.  Everythin in the Java
world has the same number of abstractions and patterns applied to every
single concept, no matter how simple.  Ever done any Struts coding
combined with Hibernate?  Through in a little AJAX and that sounds
like exactly what was built here.

Re: The Little Button That Could

2005-07-14 19:56 • by EsotericMoniker
38477 in reply to 38467
Anonymous:
This architecture sounds very J2EE to me.  Everythin in the Java
world has the same number of abstractions and patterns applied to every
single concept, no matter how simple.  Ever done any Struts coding
combined with Hibernate?  Through in a little AJAX and that sounds
like exactly what was built here.




I'm not sure what you've been doing with Java but I don't see a lot of
COM, actually I don't see any outside of the MS world.  ActiveX
controls in IE?  Hmm, I'm thinking this is pretty
ASP/ASP.NET'ish.  It is true that Struts + Hibernate can get a bit
complicated with all the configuration files but you have to realize
that's buying you a lot of flexibility in terms of changing components
and not having to go and update a lot of code.  Now weather that
flexibilty is worth a hill of beans in most web apps is a different
question.  This WTF though remains a MS WTF, perhaps you can
rejoice when we have a Java WTF tomorrow.

Re: The Little Button That Could

2005-07-14 20:07 • by rogthefrog
38478 in reply to 38477
I think our friend anonymous meant it reminded him/her of the spirit of J2EE, which is a massive WTF of layers. I doubt s/he meant that today's WTF was J2EE.

Re: The Little Button That Could

2005-07-14 20:40 • by joodie
38479 in reply to 38419
christoofar:
This is a fundamental example of the accidental complexity antipattern
(http://en.wikipedia.org/wiki/Accidental_complexity) and possibly
reinventing the wheel.






Dude, seriously. Stuff doesn't get as complex as that by accident.

Re: The Little Button That Could

2005-07-15 00:06 • by vhawk
I always wanted to know how Microsoft.XMLDOM worked.  Think I will
add this lovely piece of code to my referense set ....  :-)



Re: The Little Button That Could

2005-07-15 03:14 • by Simon
38491 in reply to 38488
> I always wanted to know how Microsoft.XMLDOM worked.

I think this is the proof that, in most cases, it works by throwing extra servers at the problem.

Re: The Little Button That Could

2005-07-15 03:45 • by brazzy
I think a lot of the response here are based on the same kind of
thinking that shows a side-by side comparison of doing formatted output
of a number in C with printf (one line), and doing the same in Java
(quite a few lines) and from there arriving at the conclusion that Java
must be overengineered WTF crap because it takes more lines to do a
trivial thing... completely forgetting (or being unaware) that
formatted number output is pretty DAMN complex if you take into account
different formatting conventions in different countries. Doing that in
C cleanly would take *quite* a few more lines.



My point is this: hello world types of tasks are NOT a correct basis to
judge a system as being over-engineered, having too many layers or too
much abstractions, because layers and abstractions only make sense when
you see the big picture, and can pay off really well there.

Re: The Little Button That Could

2005-07-15 05:03 • by Paul L
38496 in reply to 38493
This example has reminded me that: "Any problem in computer science can be solved with another layer of indirection, except for too many layers of indirection."

Re: The Little Button That Could

2005-07-15 05:24 • by DZ-Jay
Its beautiful!



Come on guys, you have to admit it... its like if someone asked "could
you go to the store and buy me a wheel"; then, not knowing what exactly
a wheel was, they went ahead and tried to make their own; and
accidentally ended up desigining a batmobile!



Sure, when they returned with the batmobile, it really didn't fit in
the original bicycle's front fork, and it was sort of clunky to pedal
it with a huge monster strapped to the front, and it ended up being
expensive, and requiring a bat-cave to house it in and all that.... But
its XML! :)



    dZ.

Re: The Little Button That Could

2005-07-15 05:30 • by DZ-Jay
38498 in reply to 38479
joodie:
christoofar:
This is a fundamental example of the accidental complexity antipattern
(http://en.wikipedia.org/wiki/Accidental_complexity) and possibly
reinventing the wheel.






Dude, seriously. Stuff doesn't get as complex as that by accident.




I agree, you need some deliberate effort to be so blindingly stupid. :)



    dZ.

Re: The Little Button That Could

2005-07-15 05:47 • by DZ-Jay
38499 in reply to 38493
Anonymous:


My point is this: hello world types of tasks are NOT a correct basis to
judge a system as being over-engineered, having too many layers or too
much abstractions, because layers and abstractions only make sense when
you see the big picture, and can pay off really well there.




I guess you're right.  This JavaScript/XML/COM behemoth would
prove very useful and flexible in the future if they ever decide to
change the behaviour of the button, from posting a single query to a
DB, to say, self-diagnosing the entire collection of data center
systems, while computing gyroscopic corrections for geo-stationary
satellite orbits, and brewing coffee for the sysadmin.



We should all design our modules and classes this way -- who knows what
changes will be needed in the future.   Have a function to
compute total line-item price (product_price * qty)? Then definitely
make room for future expansion -- just in case the function is needed
in the future to compute factorials or geometric transformations.



Simplicity is for wimps.



    dZ.





Re: The Little Button That Could

2005-07-15 06:53 • by vhawk
38500 in reply to 38499
DZ-Jay:
Anonymous:


My point is this: hello world types of tasks are NOT a correct basis to
judge a system as being over-engineered, having too many layers or too
much abstractions, because layers and abstractions only make sense when
you see the big picture, and can pay off really well there.




I guess you're right.  This JavaScript/XML/COM behemoth would
prove very useful and flexible in the future if they ever decide to
change the behaviour of the button, from posting a single query to a
DB, to say, self-diagnosing the entire collection of data center
systems, while computing gyroscopic corrections for geo-stationary
satellite orbits, and brewing coffee for the sysadmin.



We should all design our modules and classes this way -- who knows what
changes will be needed in the future.   Have a function to
compute total line-item price (product_price * qty)? Then definitely
make room for future expansion -- just in case the function is needed
in the future to compute factorials or geometric transformations.



Simplicity is for wimps.



    dZ.








Hear hear !!

Re: The Little Button That Could

2005-07-15 07:46 • by Junto

Just a small point, but technically this shouldn't be a WTF. If anyone can get a button on a web page to perform a postback to the server, without posting back the entire page, then you can accuse me of being wrong.


Although I detest the fact that some designer or marketeer has given a "funky" (stupid) name (Ajax) to the concept of client-side "background" postback using XmlHttpRequest, it is undoubtedly a useful concept. See Google Maps if you don't believe me as it uses the same technology (as does Google Suggest). Plus I'm surprised it didn't get called "iJax" as it seems you can make anything cool by sticking an "i" before it these days. In the good old days you used an "e" you know. It is bloody Apple's fault!


Anyway.... though rather clunky and slow, plus Internet Explorer seems to have problems with memory leaks* using XmlHttpRequest, the technology does have a place and valid uses. I just hope that a "i-cool" name doesn't give it the XML treatment. i.e. Everyone uses it for everything because it is the "thing-to-do".


For those of you that are interested:


Google Suggest - http://www.google.com/webhp?complete=1&hl=en


My example of using the Google Map API - http://www.junto.co.uk/Album/Maps/SouthAmerica.aspx


*I haven't looked into the memory leak in detail, but just noticed that the browser got slower and slower while I've was playing around with the Google Maps API . This especially happens over long periods of time, such as when I leave the browser open displaying a map for a coupel of hours doing nothing. This could be due to a problem in Google's JavaScript too though. Either way, it isn't something you use to be super quick, or reliable.

Re: The Little Button That Could

2005-07-15 08:31 • by Mike R
38504 in reply to 38444
cm5400:
My Friggin Eyes!  I can not believe that...
Wait a minute, must have been written by a highley paid consultant that
got paid by the line, no WAY would anyone have so many layers in
between.  That's like creating a database table for each item of
data that you need to store.  WOW, my brain hurts thinking
about that POS code, I need an migrane pill now.  I would have ran
screeming through the friggin hills, blowing up every bridge on the
way if I had to maintain that, and not looked back for one
nanosecond.




No. This time the HPC was paid by the module, under the guidelines of the "more reasonable terms for highly paid consultants".

Re: The Little Button That Could

2005-07-15 08:41 • by DZ-Jay
38505 in reply to 38501
Anonymous:
Although I detest the fact that some designer
or marketeer has given a "funky" (stupid) name (Ajax) to the
concept of client-side "background" postback using XmlHttpRequest, it
is undoubtedly a useful concept. See Google Maps if you don't believe
me as it uses the same technology (as does Google Suggest). Plus I'm
surprised it didn't get called "iJax" as it seems you can make
anything cool by sticking an "i" before it these days. In the good old
days you used an "e" you know. It is bloody Apple's fault!

Anyway.... though rather clunky and slow, plus Internet
Explorer seems to have problems with memory leaks* using
XmlHttpRequest, the technology does have a place and valid
uses. I just hope that a "i-cool" name doesn't give it the XML
treatment. i.e. Everyone uses it for everything because it is the
"thing-to-do".




You missed the point.  Nobody is saying that background
postbacks are a bad idea.  As a matter of fact, most posts in this
thread comment on how it has been there for years, and just now have
become the "latest craze", when christened with a techy-sounding name,
AJAX.


What people are criticizing is the over-use of multiple layers of
abstraction to perform what in essence is (or should be) a simple
procedure.  The punishment should fit the crime, the solution
should fit the problem, and the level of abstraction -- and therefore,
its complexity -- should be in balance with the intricacies and the needs of the overall design.


A hammer is a very useful and versatile tool, and it can be applied
to many other uses beyond its original intention; but I wouldn't use it
to clip my nails or prune my bushes.


    -dZ.





Re: The Little Button That Could

2005-07-15 09:24 • by Nikanj
38506 in reply to 38416
Anonymous:

It's like an onion!  Layers upon layers upon layers...





And it makes grown men cry! :'(




Re: The Little Button That Could

2005-07-15 09:29 • by webcat
38507 in reply to 38501
we can use a hidden frame to achieve the same effect.

Re: The Little Button That Could

2005-07-15 09:30 • by Hank Miller
38508 in reply to 38441
scheky:

Well Lumpio, welcome to the real world, where many corps do indeed
use IE, both as a browser for their employees and as the only browser
supported for internal web apps.  Only needing to support IE
may have actually been part of the defined standard architecture for
the company, and if so, it would have been a WTF to not take advantage
of that fact.


Of course, this code makes my brain hurt...somebody needs an enema.





Sigh...  Shades of a job I had 5 years ago.   They
revealed a new system for developers to reserve test equipment. 
IE only of course.   Nevermind that all development was on
Solaris, only 1 in 3 developers even had a Microsoft windows machine in
their office.  Most had to find someone with IE to reserve
anything needed.   (and long term reservations could not be
for more than a month, with no notice when they expire)   IE
on solaris did not work - I tried.

Re: The Little Button That Could

2005-07-15 10:32 • by Stan Rogers
38510 in reply to 38507
Anonymous:
we can use a hidden frame to achieve the same effect.




You've never done that with multiple asynchronous and timed queries,
have you? Iframe postbacks, particularly in IE, cause the same "click"
as if a user had clicked a link. Do that more than once or twice in a
session, and you get really, truly annoyed users. Do it in an intranet
app used in a cube farm and no-one can hear themselves think anymore.
It works, yes, but that's not the only consideration.

Re: The Little Button That Could [ off-topic: IE click ]

2005-07-15 11:50 • by Steve Wahl
38511 in reply to 38510
Stan Rogers:



Iframe postbacks, particularly in IE, cause the same "click"
as if a user had clicked a link. Do that more than once or twice in a
session, and you get really, truly annoyed users. Do it in an intranet
app used in a cube farm and no-one can hear themselves think anymore.
It works, yes, but that's not the only consideration.




Thanks, Stan.  I'm usually a linux / Firefox user (and, at that,
I'm an embedded C developer, not a web developer), and it's always been
a WTF for me when I use the kids machine, that (a) I can't turn that
damn IE click off, especially when I'm using the system to play music
in the background; and (b) why some web pages kept making these click
noises when I wasn't doing anything.



The lack of a preference for the click is still a WTF, but you explained the second one.

Re: The Little Button That Could

2005-07-15 11:59 • by JThelen
38512 in reply to 38449
Manni:

It always has to turn into an anti-Microsoft
campaign by some of you, doesn't it? Using IE is a WTF? I have
coworkers that use Mozilla, Firefox and Netscape and have their
own set of problems.


As for this nugget of Javascript/XML overkill...wow. I had no idea something so simple could be so over-complexified.





Please manni.. for the children.. don't feed the trolls.

Re: The Little Button That Could

2005-07-15 12:27 • by TWK
Internet Explorer Rules!!



It is so awesome that IE provides full access to COM functions right
through JavaScript.  Think of all of the possibilities this
presents to developers (and hackers).

« PrevPage 1 | Page 2Next »

Add Comment