Really Stumped hour routine

T

Tad McClellan

Bruce Horrocks said:
I felt that the OP presented the data relating to his problem in a
simple and easy to understand way in order to make it easy for the
readers of this group to give him an answer,


Correct.

And it worked. Many people clearly understood what was wanted.

He got a (several?) very good answer: choose a better data structure.

but all he got for it was
criticism.


The OP presented it optimized for easy understanding, the followups
presented it optimized for processing.

Since he wanted an implementation, the progression was already
heading in the Right Direction, towards a working implementation.

It was _constructive_ criticism, he wasn't going about it the best way.

This irked me.

Everybody has problems.
 
B

Bruce Horrocks

you still dont get it

Are you sure? :)
there would of course be no point in reading the params into a hash or
array structure if you still access them as scalars one by one. as soon
as you have the values in a sensible structures, many ways suggest
themselves to solve the problem.

You are referring to a post that I wrote in response to a follow-up post
from Gunnar Hjalmarsson. Please do not use it as an argument against my
original post as that would be to take it out of context.
the $q->Vars solution is not the only one. did you see the proposal by
A. Sinan Unur in where the
form values are read directly into a suitable hash of arrays structure?

I did. His is a model answer: helpful and non-condescending to the OP.

My point is not about the quality of the solutions offered but the way
in which they were offered: namely four posts in a row that were being
condescending to the OP when he was doing his best (IMHO).

Ted sums things up neatly in a later post, namely:
The OP presented it optimized for easy understanding, the followups
presented it optimized for processing.

Since he wanted an implementation, the progression was already heading
in the Right Direction, towards a working implementation.

It was _constructive_ criticism, he wasn't going about it the best way.

Whether the first few responses were constructive criticism or not is
now a matter of opinion so I suggest that we let it lie.

I hope that I have at least caused people to think even if they don't
agree.

Regards,
 
G

gnari

Bruce Horrocks said:
My point is not about the quality of the solutions offered but the way
in which they were offered: namely four posts in a row that were being
condescending to the OP when he was doing his best (IMHO).

about the four in a row, remember there is a propagation time-lag
effect here, so these 4 had probably not seen the other answers
when they wrote theirs.

these answers did not at all sound condescending in my opinion,
but it would be interesting to hear the OP's opinion on this.

also: the fact that so many replied with similar reactions should be
a hint that the point they make is valid, isn't it?
Whether the first few responses were constructive criticism or not is
now a matter of opinion so I suggest that we let it lie.

fine with me.
I hope that I have at least caused people to think even if they don't
agree.

who cares?
I sometimes answer questions here when it strikes my fancy. I do not
really care if some sensitive souls get rubbed the wrong way by
the way I choose to try to help.

gnari
 
J

Joe Smith

Bruce said:
This is the fourth post I've read in this thread criticising the OP's
data structure. Well: webform, webform, webform, webform. And just in
case you didn't get that, I'll say it again: webform.

The OP said that his data came from a *web-form*. Therefore the data
will always arrive as separate scalars from the CGI param call.

So what. The individual fields can be made to look like arrays
(or hashes) and treated as such.

<input type="text" name="student[0]" size="20">
<input type="text" name="stu_id[0]" size="20">
<input type="checkbox" name="delete[0]" value="1">

<input type="text" name="student[1]" size="20">
<input type="text" name="stu_id[1]" size="20">
<input type="checkbox" name="delete[1]" value="1">

It's trivial to parse the results from that into a hash of arrays.
Likewise parsing into a hash of hashes.
-Joe
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Help with code 0
Help with my responsive home page 2
12 hour clock and offset problem 25
Tasks 1
Help with python code! 18
Java Problems (Really Need Help!) 2
help me please 2
Help with Hpricot and collect 0

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,065
Latest member
OrderGreenAcreCBD

Latest Threads

Top