Re: two dropdown menus
Matt Kruse wrote:[color=blue]
> Richard Cornford wrote:[color=green]
>> You comments so far centre on the way my script is not configurable
>> to every permutation of possible deployment.[/color]
>
> My comments point out common requirements for developers around the
> world trying to implement a date-picker popup. Having had my date
> picker available for qutie some time, and having received hundreds of
> suggestions and feature requests,[/color]
What proportion have you fulfilled? Did you notice the post today form
someone who wants to drag select a range of dates? I wonder how that
would work for month/year spanning ranges but I can see it being a very
realistic requirement. For example, an Intranet application for booking
holidays where nobody would ever be entitled to more than, say, 8 weeks
off at a stretch, and so the interface would never have to span more
than 3 months of dragged selection.
<snip>[color=blue]
> ... . Surely no one can meet all requirements that anyone might
> have. But solving the vast majority of typical requirements is
> definitely possible.[/color]
Surly it is entirely possible to meet all requirements that anyone might
have (assuming that they are technically achievable) because no matter
what those requirements may be they will be specific and finite. Your
problem is that it is not practical to meet all possible requirements in
one piece of javascript all at the same time.
[color=blue]
> My point in raising those questions was to show that your
> solution is very specific to a single set of requirements,[/color]
As it was designed to be.
[color=blue]
> and therefore not very useful to very many people.[/color]
As long as it is useful in the context for which it was created then it
is doing its job.
<snip>[color=blue]
> This is not to knock
> your solution - it may be _perfect_ for someone. The point is to
> examine what 'value' each of our aproaches offers to potential
> developers who wish to implement a date picker.
>
> If someone wishes to implement a date picker using your philosophy of
> javascript development, they would need to download your code,[/color]
Someone using my "philosophy of javascript" would have no need to be
downloading my example. They would start by reading their specification,
then design their script, then they would write it themselves.
[color=blue]
> fully understand it (and it is unreadable to most people),[/color]
That would do nobody any harm, but it is not necessary.
[color=blue]
> then customize it to add the required functionality.[/color]
It would almost certainly be more efficient (in terms of time to
implement and the resulting code) to design the script for the
requirements that apply to it than try to customise a script designed
with different requirements.
[color=blue]
> This could be very time-consuming.[/color]
Trying to reverse engineer a script that you don't understand and then
get it to do something other than what it was designed to do would be
very time consuming. You will be hard pressed to find anyone
recommending that as a development strategy.
However, given a repertoire of well tried and tested low level
functions/components/objects, an understanding of the design issues and
a familiarity of common patterns in implementation, creating a specific
script for the context and specification doesn't have to be that time
consuming at all.
[color=blue]
> Or, they could download my library, customize the display with a few
> lines of code using built-in parameters and methods, and have their
> requirements met in a few minutes. And have the date picker work on a
> wider range of browsers.[/color]
Assuming that there specification was achievable within the inevitably
limited features of your library. Otherwise they stand a very good
chance of not being able to find them implemented in any library and
either having to find an expert to implement it for them or wishing they
had learnt how to do it themselves.
[color=blue]
> At the expense of an additional few kb of code 'bloat'.
>
> If you were a non-expert developer ...[/color]
As I said, amateurs can do as they like, they have no responsibility to
others. Professional and non-expert do not sit well together, though I
cannot deny that web development is full of people for whom "non-expert
developer" would be a very good title (but I doubt they would appreciate
it).
Server-scripting some years ago, a client decided that one of our web
applications needed a facelift beyond what could be accommodated in the
style sheets. They commissioned a firm of HTML designers to create
templates for all of the interface pages and then had us install the
server-side logic into the templates.
Not in itself a bad idea, but the HTML designers unfortunately fell into
a category that would deserve the title "non-expert". At the time I had
been playing with GIF files and their format, and had written a
loss-less batch GIF re-compressor. It did no more than identify which
colours where actually used in a GIF image and re-arranged to color
table and image to color table mappings so that the table was a size
that accommodated all of the colours used, but was no bigger,
re-encoding the image using that new color table. Running the images
directory that came with the HTML templates through my re-compressor
reduced the total size of that directory to (literally) 1/10 of the size
that it was originally (without changing the color of a single pixel in
any of the images within it). The originals had all been created with
256 item color tables (the maximum for GIF) regardless of the number of
colors used.
The images themselves had been created without any grasp of what was
appropriate for their application. A common background color carried
over from the HTML to the images, and expressible in the CSS as a
six-character hex color value, was reproduced in the images as a four
color random dither pattern. GIF colors are 24 bit, it could have been
one flat color instead of a pattern of four, and if it had been the GIF
compression algorithms would have packed those background regions down
to a tiny fraction of there actual size (and the color tables could have
been even smaller as well). Just in the images alone we were looking at
total bandwidth wastage of two orders of magnitude.
The HTML was no better; tables within tables within tables. Our project
manager looked at all this and said: "it is what the client has provided
and we are not being paid to fix it", so we did our jobs and delivered
to schedule. The client withdrew the site after a month and reverted to
the old one because they were fed up with fielding complaints from their
users that the new version was too slow to be useable (making the whole
exercise a total waste of money for them).
And that is what you get from professionals who turn out to be
"non-expert developers"; script bloat on top of image bloat on top of
HTML bloat. It doesn't do the users any good, and it doesn't do the
clients any good, no matter how convenient it may be for those
"profession als" never to have to learn the skills they purport to be
selling.
<snip>[color=blue]
> You have offered a solution which meets the requirements of very
> very few developers. I have offered a solution which meets the
> requirements of thousands of developers.[/color]
I have no interest in meeting the requirements of thousands of
developers. I have an interest in meeting the requirements of a
specification, and doing the best job of that I can of that.
<snip>[color=blue][color=green]
>> I notice that you assert that this additional flexibility can be
>> accommodated in 5K.[/color]
>
> Your code is 23k, mine is 34k. So, I estimated wrong - an additional
> 11k is required. But that also adds many more features than what I
> noted ;)[/color]
When I look at you calendar example page I find it importing a 58K JS
file. Because it has dependencies on - PopupWindow -, -date - and -
AnchorPosition - (oddly your dependency list for CalendarPopup doesn't
list - date - but uses its functions anyway). While examining my file
would reveal that my date picker code employs:-
InitializeMe
getElementWithI d
associateObjWit hEvent
getSimpleExtPxI n
HideCovered (needs getSimpleExtPxI n (or equivalent interface))
compatModeTest
getWindowState (needs compatModeTest)
- as independent low-level components that it is depended upon. As low
level components they stand a reasonable chance of also finding
themselves
being used by other non-date picker code in any actual deployment. In
much the same way as you might argue that - PopupWindow -, -date - and -
AnchorPosition - could. Though the lower the level of the component the
more likely it is to find use in other code.
But for purposes of comparison it would be more reasonable to compare
your 58K deployment code against my 23K, or your 35K date picker
specific code against my 15K date picker specific code. With those
numbers we see a difference exceeding the size of the smaller.
Although a more meaningful comparison would run both through a JS
minimiser of some sort and compare what come out to provide a measure of
unavoidable differences, as large blocks of comments don't really need
to be being sent to the user, and so impacting on bloat comparisons
(unless copyright restrictions require them to remain)). And the
minimiser would have to be a version that re-wrote identifiers so that
the differences in identifier naming styles was also removed from the
comparison.
But it remains the case that I can produce a date picker implementing
any specific features required, including any not already covered by
your library, and come up with something more or less the same size,
because different requirements would displace the code need for other
approaches. While if your library wants to cover new requirements it
needs additional features and you have no choice but make it bigger.
Richard.
Matt Kruse wrote:[color=blue]
> Richard Cornford wrote:[color=green]
>> You comments so far centre on the way my script is not configurable
>> to every permutation of possible deployment.[/color]
>
> My comments point out common requirements for developers around the
> world trying to implement a date-picker popup. Having had my date
> picker available for qutie some time, and having received hundreds of
> suggestions and feature requests,[/color]
What proportion have you fulfilled? Did you notice the post today form
someone who wants to drag select a range of dates? I wonder how that
would work for month/year spanning ranges but I can see it being a very
realistic requirement. For example, an Intranet application for booking
holidays where nobody would ever be entitled to more than, say, 8 weeks
off at a stretch, and so the interface would never have to span more
than 3 months of dragged selection.
<snip>[color=blue]
> ... . Surely no one can meet all requirements that anyone might
> have. But solving the vast majority of typical requirements is
> definitely possible.[/color]
Surly it is entirely possible to meet all requirements that anyone might
have (assuming that they are technically achievable) because no matter
what those requirements may be they will be specific and finite. Your
problem is that it is not practical to meet all possible requirements in
one piece of javascript all at the same time.
[color=blue]
> My point in raising those questions was to show that your
> solution is very specific to a single set of requirements,[/color]
As it was designed to be.
[color=blue]
> and therefore not very useful to very many people.[/color]
As long as it is useful in the context for which it was created then it
is doing its job.
<snip>[color=blue]
> This is not to knock
> your solution - it may be _perfect_ for someone. The point is to
> examine what 'value' each of our aproaches offers to potential
> developers who wish to implement a date picker.
>
> If someone wishes to implement a date picker using your philosophy of
> javascript development, they would need to download your code,[/color]
Someone using my "philosophy of javascript" would have no need to be
downloading my example. They would start by reading their specification,
then design their script, then they would write it themselves.
[color=blue]
> fully understand it (and it is unreadable to most people),[/color]
That would do nobody any harm, but it is not necessary.
[color=blue]
> then customize it to add the required functionality.[/color]
It would almost certainly be more efficient (in terms of time to
implement and the resulting code) to design the script for the
requirements that apply to it than try to customise a script designed
with different requirements.
[color=blue]
> This could be very time-consuming.[/color]
Trying to reverse engineer a script that you don't understand and then
get it to do something other than what it was designed to do would be
very time consuming. You will be hard pressed to find anyone
recommending that as a development strategy.
However, given a repertoire of well tried and tested low level
functions/components/objects, an understanding of the design issues and
a familiarity of common patterns in implementation, creating a specific
script for the context and specification doesn't have to be that time
consuming at all.
[color=blue]
> Or, they could download my library, customize the display with a few
> lines of code using built-in parameters and methods, and have their
> requirements met in a few minutes. And have the date picker work on a
> wider range of browsers.[/color]
Assuming that there specification was achievable within the inevitably
limited features of your library. Otherwise they stand a very good
chance of not being able to find them implemented in any library and
either having to find an expert to implement it for them or wishing they
had learnt how to do it themselves.
[color=blue]
> At the expense of an additional few kb of code 'bloat'.
>
> If you were a non-expert developer ...[/color]
As I said, amateurs can do as they like, they have no responsibility to
others. Professional and non-expert do not sit well together, though I
cannot deny that web development is full of people for whom "non-expert
developer" would be a very good title (but I doubt they would appreciate
it).
Server-scripting some years ago, a client decided that one of our web
applications needed a facelift beyond what could be accommodated in the
style sheets. They commissioned a firm of HTML designers to create
templates for all of the interface pages and then had us install the
server-side logic into the templates.
Not in itself a bad idea, but the HTML designers unfortunately fell into
a category that would deserve the title "non-expert". At the time I had
been playing with GIF files and their format, and had written a
loss-less batch GIF re-compressor. It did no more than identify which
colours where actually used in a GIF image and re-arranged to color
table and image to color table mappings so that the table was a size
that accommodated all of the colours used, but was no bigger,
re-encoding the image using that new color table. Running the images
directory that came with the HTML templates through my re-compressor
reduced the total size of that directory to (literally) 1/10 of the size
that it was originally (without changing the color of a single pixel in
any of the images within it). The originals had all been created with
256 item color tables (the maximum for GIF) regardless of the number of
colors used.
The images themselves had been created without any grasp of what was
appropriate for their application. A common background color carried
over from the HTML to the images, and expressible in the CSS as a
six-character hex color value, was reproduced in the images as a four
color random dither pattern. GIF colors are 24 bit, it could have been
one flat color instead of a pattern of four, and if it had been the GIF
compression algorithms would have packed those background regions down
to a tiny fraction of there actual size (and the color tables could have
been even smaller as well). Just in the images alone we were looking at
total bandwidth wastage of two orders of magnitude.
The HTML was no better; tables within tables within tables. Our project
manager looked at all this and said: "it is what the client has provided
and we are not being paid to fix it", so we did our jobs and delivered
to schedule. The client withdrew the site after a month and reverted to
the old one because they were fed up with fielding complaints from their
users that the new version was too slow to be useable (making the whole
exercise a total waste of money for them).
And that is what you get from professionals who turn out to be
"non-expert developers"; script bloat on top of image bloat on top of
HTML bloat. It doesn't do the users any good, and it doesn't do the
clients any good, no matter how convenient it may be for those
"profession als" never to have to learn the skills they purport to be
selling.
<snip>[color=blue]
> You have offered a solution which meets the requirements of very
> very few developers. I have offered a solution which meets the
> requirements of thousands of developers.[/color]
I have no interest in meeting the requirements of thousands of
developers. I have an interest in meeting the requirements of a
specification, and doing the best job of that I can of that.
<snip>[color=blue][color=green]
>> I notice that you assert that this additional flexibility can be
>> accommodated in 5K.[/color]
>
> Your code is 23k, mine is 34k. So, I estimated wrong - an additional
> 11k is required. But that also adds many more features than what I
> noted ;)[/color]
When I look at you calendar example page I find it importing a 58K JS
file. Because it has dependencies on - PopupWindow -, -date - and -
AnchorPosition - (oddly your dependency list for CalendarPopup doesn't
list - date - but uses its functions anyway). While examining my file
would reveal that my date picker code employs:-
InitializeMe
getElementWithI d
associateObjWit hEvent
getSimpleExtPxI n
HideCovered (needs getSimpleExtPxI n (or equivalent interface))
compatModeTest
getWindowState (needs compatModeTest)
- as independent low-level components that it is depended upon. As low
level components they stand a reasonable chance of also finding
themselves
being used by other non-date picker code in any actual deployment. In
much the same way as you might argue that - PopupWindow -, -date - and -
AnchorPosition - could. Though the lower the level of the component the
more likely it is to find use in other code.
But for purposes of comparison it would be more reasonable to compare
your 58K deployment code against my 23K, or your 35K date picker
specific code against my 15K date picker specific code. With those
numbers we see a difference exceeding the size of the smaller.
Although a more meaningful comparison would run both through a JS
minimiser of some sort and compare what come out to provide a measure of
unavoidable differences, as large blocks of comments don't really need
to be being sent to the user, and so impacting on bloat comparisons
(unless copyright restrictions require them to remain)). And the
minimiser would have to be a version that re-wrote identifiers so that
the differences in identifier naming styles was also removed from the
comparison.
But it remains the case that I can produce a date picker implementing
any specific features required, including any not already covered by
your library, and come up with something more or less the same size,
because different requirements would displace the code need for other
approaches. While if your library wants to cover new requirements it
needs additional features and you have no choice but make it bigger.
Richard.
Comment