• (cs) in reply to Mung Kee
    Mung Kee:
    Jeff S:
    Mung Kee:
    Anonymous:
    Mung Kee:
    I loathe when people prefix HTML widget names with "sel" or "txt", as if the server code has any interest in whether  it's a  goddamn  text box or select box.


    hungarian warts are there to help programmers not the code and in writing the server side portion it'd probably be useful to know what type of control a value came from, especially if you're recreating the form and want to set the selected item in a select dropdown.


    I maintain, why does the server give a damn about what kind of control it is?  All the server needs to know is the front end needs the selected value and a list of possible values.  It's the GUI's burden to compare the selected value with the items in the list, to determine how to render the widget.

    To repeat:  hungarian notion is used to help the PROGRAMMER (you know, a person) remember what datatypes different variables are, not for a "server". 

    From your other post: the object form1 is a perfectly valid reference for the javascript, since the context it is running in is the document.



    When I said the server, I was implying the server-side code.  When you use ASP to interact with the database, they are one in the same.  In the Java world, JSP pages are often considered the front end, since they usually do very little of the heavy lifting.  Typically you would adopt or write some MVC architecture (such as Struts or JSF) in which a controller interacts with business objects and passes the result of those interactions to a JSP page.  Someone, far more experienced with M$ technologies than I, can probably say whether this paradigm exists in that camp.

    RE: defining form1, I stand corrected.  'document' is assumed.



    Perhaps this will shed some light:  You are correct that the names of the fields will be submitted to the server and act as strings, or perhaps as keys on a hash or associative array, but what you are missing is that they are also used to address the widget from client-side scripting.  Since their names become essencially pointers to the widget object, knowing their type is useful, given that different types of widgets can have different properties, methods, attributes, etc.

    I hope this clears it up.

        -dZ.

  • Masklinn (unregistered) in reply to DZ-Jay
    John Smallberries:
    Guess what, Einstein? In ASP.Net, the Id is used as the basis for the client-side and server-side identifier.

    Fair enough... now why the hell would you ID a label since you don't actually use it for anything? Does ASP.net require you to ID every single HTML element out there?

    Well, the UI developer cares about it, and she would like a meaningful name. This is especially handy if a function expects a certain type (javascript being loosely typed).

    If by "UI dev" you mean javascript dev, he or she already has the information, and your very specs/documentations should define the correspondance between IDs and elements if one considers that he needs them, since IDs are unique for a given page (and usually coherent throughout the application)

    If your "UI dev" is a designer, he or she will use the outputted page's code anyway, even though i'll agree that documentation may be useful. Form styling being a pain in the ass and an awfully precisely hand crafted pile of donkey poo, she/he'll have all the classes and IDs of your form burned into her/his retinas before long anyway

    DZ-Jay:
    So why do people prefix variables in those languages?

    One wonders about that, especially when they're merely repeating the object's inherent characteristics (like it's type)

  • (cs) in reply to christoofar
    christoofar:

    Wouldn't that be 'Form submtted'? :)



    Brillant!!!


    I guess that's better than "Form.Sumbit()" (which I've seen in actual code)

  • (cs) in reply to Mung Kee

    Mung Kee   -- I do need to complement you on your avatar -- it fits perfectly with your rather angry posting style!

    Then again ... maybe your posts have actually been quite calm, thoughtful and reasonable, but subconciously I have been putting aggressive inflections on the text as I've read it due to the avatar?  I may have to revisit!



  • (cs) in reply to Mung Kee
    Mung Kee:
    Ytram:

    Personally for me it's because you usually have several controls of each type that you need to do something with.  As an example, we localize all of our labels, so I can easily access each label with intellisense by prefixing them all with "lbl".  When I'm filling text boxes with data, I just hit this.txt and intellisense will show me all of the controls prefixed with txt.


    What is this intellisense you speak of?


    Hey!
  • (cs) in reply to Masklinn
    Anonymous:
    John Smallberries:
    Guess what, Einstein? In ASP.Net, the Id is used as the basis for the client-side and server-side identifier.

    Fair enough... now why the hell would you ID a label since you don't actually use it for anything? Does ASP.net require you to ID every single HTML element out there?



    If you want to dynamically generate a page, then YES.  Even the contents of labels change -- in fact, sometimes more than anything else -- when your HTML is dynamically generated using ASP.NET.   Look at this page, right now -- 99% of the text you see right now is a label that has been dynamically created or altered by ASP.NET.

  • (cs) in reply to x-sol (to lazy to login)
    Anonymous:

    Mung Kee:
    Jeff S:

    It's one thing if something someone is doing causes you more work (i.e., some of those database "designs" out there  ...) but does this really affect you one way or another?  How much productivity is lost when a form's names have prefixes?


    It does effect everyone on the project because it's poor design.  If the server component has no interest in the way in which a component is rendered on the client, don't give him any knowledge of it.  Though I know it's not true, I'm beginning to think that few people approach design of an application as it is multiple, mutually exclusive, layers.

     

    You need to chill out the buddy. I mean look at your avatar you look like some mad dog.....

    Lets say I haven't worked on my app (WEB APP) in 3 years and I have to make some validation changes because someone finally found that validation flaw I didn't catch. I open my god awful php, or jsp code or even better perl, up and I find the spot where the glitch is it named Address I assume it's a textbox because  I don't remember and let's say I don't have access to all the code for somereason.

    OH! BLING BLING! That was a Drop down list and I treated it like a textbox now that entire page is broken and my long time client fires me for being an edit. Not very likely but I have seen things like that happen.

    That's why I love ASP.Net it stomps all over every other weak ass spliced n hacked glue language out there.

    Yes I validate my data in js and in codebehind... you know how reliable js is ...



    The avatar is Samir from Office Space.  Ever seen it?

    I think we pretty much covered miscommunication in language architectures (you typically operate on object instances of the HTML widgets in ASP code).  In Java and Perl, its a hash.  A list of name value pairs.  An HTML select box only submits one value...the selected one.  A radio button group only submits one value...the selected one.

    What's a spliced and hacked glue language, or did you make that up?  Have you ever developed a significant application using another language or is this your first job?  If you're unaware of all the wonderful languages and platforms out there then you are surely missing out.  Each one of them may have their own caveates, but to learn them is always rewarding.

  • (cs) in reply to DZ-Jay
    DZ-Jay:
    Mung Kee:

    P.S.
    I loathe when people prefix HTML widget names with "sel" or "txt", as if the server code has any interest in whether  it's a  goddamn  text box or select box.  Let's hang him, then we'll stab him...and then we'll kill him.


    Hum... I thought this was for the benefit of the developer, and for the sake of consistency.  I wasn't aware that code written in C#, Java, Delphi, or VB or any other language had any "interest" in the variable types either... So why do people prefix variables in those languages?

        -dZ.



    If you've read on in the thread, you'll see that I said I have seen variables named strFirstname and intZip in Java code.  It was primarily "sel" (meaning a select box) that I have a problem with on the server side.  Typically I, like most of us, do develop an application end to end so I dont rely on a UI person and its not an issue.  I just don't see the value in it. 
  • (cs) in reply to Mung Kee

    I can't believe this naming discussion went on for so many posts, when it should have ended long ago.

    Perhaps I can help to bring it to an end, because if you look at it from above it really is easy.

    You have a server that is responsible to provide form data, accept form data and perhaps store it away or process it in some way.

    You have a client that is responsible to to show the user a form filled with data and accept the users input.

    To make both interact you have an (transportation) interface, that allows

    • the server to send data
    • the client to receive data
      and
    • the client to send data
    • the server to receive data

    Now if this transportation interface where some kind of proprietary network protocol, no one here would recommend, that the protocol should encapsulate any implementation details from either server or client side.

    But this discussion is not about a proprietary network protocol, but about HTML/HTTP client server interaction, where most frameworks use the HTML form control's name for that interface, because that is what the browser is required to do per spec (and here this browser behavior is part of the client side).

    Now while naming the control's should actually be only of interest to the "GUI" developer (a.k.a. web designer in this case) it may become part of the transportation interface due to the mentioned browser behavior.

    Mung Kee's position is, that because the transportation interface should not reflect GUI decisions, you should never name your controls in a way, that their type is reflected in the transportation interface (and that's also my position and I think, as it is good design, it should be everybody's position).

    However, others have the opposite opinion, and .... uhmm ... and I really really tried to see to their point and defend it here as at least sometimes sensible, but actually I can't. Even if you use frameworks, that generate HTML code for you and hide the request/response cycle involved in web apps and therefor the transportation interface, I can't see ANY reason to name data fields by the associated GUI elements.

    Well, now that I've written this post, I think I'll fail to end this discussion, but I still can't believe it went on for so long in the first place.

    cu
  • (cs) in reply to Masklinn

    <font size="2">

    Anonymous:
    John Smallberries:
    Guess what, Einstein? In ASP.Net, the Id is used as the basis for the client-side and server-side identifier.
    </font>

    <font size="2">Fair enough... now why the hell would you ID a label since you don't actually use it for anything? Does ASP.net require you to ID every single HTML element out there?


    Yes, because it is still a server-side object instance (you can accept the default, label1, lable2, but that's just nasty). Also, If I need to manipulate it on the client, I need to know its name (identifier).
    </font><font size="2">
    Anonymous:
    </font>

    <font size="2">Well, the UI developer cares about it, and she would like a meaningful name. This is especially handy if a function expects a certain type (javascript being loosely typed).</font>

    <font size="2">If by "UI dev" you mean javascript dev, he or she already has the information, and your very specs/documentations should define the correspondance between IDs and elements if one considers that he needs them, since IDs are unique for a given page (and usually coherent throughout the application)</font><font size="2">


    I mean "anyone who may need to reference the element, now or in the future".
    </font>

    <font size="2">

    Anonymous:
    </font>
    <font size="2">If your "UI dev" is a designer, he or she will use the outputted page's code anyway, even though i'll agree that documentation may be useful. Form styling being a pain in the ass and an awfully precisely hand crafted pile of donkey poo, she/he'll have all the classes and IDs of your form burned into her/his retinas before long anyway

    Uh, doubtful. Most UI/js designers/devs I've worked with appreciate a little help.
    </font>

    <font size="2">
    Anonymous:
    </font>
    <font size="2">
    DZ-Jay:
    So why do people prefix variables in those languages?
    </font>

    <font size="2">One wonders about that, especially when they're merely repeating the object's inherent characteristics (like it's type)</font>

    <font size="2">

    I agree. For typed languages, it's redundant. For the case where an element is generated on a server, then referenced in a loosely-typed language on the client, I think it has merit.
    </font>
  • (cs) in reply to DZ-Jay
    DZ-Jay:

    Perhaps this will shed some light:  You are correct that the names of the fields will be submitted to the server and act as strings, or perhaps as keys on a hash or associative array, but what you are missing is that they are also used to address the widget from client-side scripting.  Since their names become essencially pointers to the widget object, knowing their type is useful, given that different types of widgets can have different properties, methods, attributes, etc.

    I hope this clears it up.

        -dZ.


    I wasn't missing that at all.  I have done quite a bit of JavaScript and DHTML over the years and am well aware of the JavaScript DOM (cross-browser).  My underlying assumption here is that the GUI developer should know that "firstname" is a text field in a form.  If it's an issue of too many fields on the form, you need to design it as a workflow and not a single screen.  It's not that difficult to remember what HTML widget is used for 10-20 pieces of data. 

    As you'll see in a later post if you can rationalize "sel" prefixing a select box name lets do it on DB tables and everything in between.
  • (cs) in reply to eagle

    <font size="2">

    eagle:
    </font><font size="2"> I can't see ANY reason to name data fields by the associated GUI elements.


    </font><font size="2">
    eagle:
    naming the control's should actually be only of interest to the "GUI" developer


    I believe you answered your own question.
    </font><font size="2">
    </font><font size="2"></font>

  • (cs) in reply to eagle

    Eagle -- nice post, I couldn't agree more.

    The debate seems to be more about whether or not programmers who decide that they like to prefix things occasionally shoud be fired, shot, or worse; and whether or not it really truly affects the enterprise and overall productivity.

    being the spineless bastard that I am, I feel that if the guy writing the html/javascript likes to use prefixes, which mean sthat the form submitted will have a name/value pair of "txtName" instead of "Name",  how much of my time and productivity should I spend ranting, raving and complaining to anyone that will listen about it, when it literally means I have to type 3 more characters on they keyboard now and then. 

    Would I prefer "name" ?  Sure! Would I use "Name". Absolutely!  Might I even suggest that the html guy uses "name" also?  You bet!  But will I rant and rave and complain and call people "retarded" and question their programming skill and try to get people fired and assume that this "txtName" object has caused massive productivity issues?

    Nah .... I'll get over it.


  • (cs) in reply to Jeff S
    Jeff S:
    Mung Kee   -- I do need to complement you on your avatar -- it fits perfectly with your rather angry posting style!

    Then again ... maybe your posts have actually been quite calm, thoughtful and reasonable, but subconciously I have been putting aggressive inflections on the text as I've read it due to the avatar?  I may have to revisit!





    Admittedly, at times they are/were both.  Many times I post something that is sarchastic and meant as a joke that can come off as angry, but sometimes I can definitely post something is meant to be a flame.  Who doesn't?  I have never met an engineer who hasn't gotten heated about something for which he has conviction.
  • (cs) in reply to DZ-Jay
    DZ-Jay:
    Mung Kee:
    Ytram:

    Personally for me it's because you usually have several controls of each type that you need to do something with.  As an example, we localize all of our labels, so I can easily access each label with intellisense by prefixing them all with "lbl".  When I'm filling text boxes with data, I just hit this.txt and intellisense will show me all of the controls prefixed with txt.


    What is this intellisense you speak of?


    Hey!


    Sorry dude, you weren't around!  We needed one.
  • (cs) in reply to John Smallberries
    John Smallberries:
    <font size="2">
    eagle:
    </font><font size="2"> I can't see ANY reason to name data fields by the associated GUI elements.


    </font><font size="2">
    eagle:
    naming the control's should actually be only of interest to the "GUI" developer


    I believe you answered your own question.
    </font><font size="2">
    </font>


    You know the difference between a data field (in OO-languages also called member, in procedural languages often called variable, and in databases often called column) and a control, don't you?

    The whole point here is, that the browser uses the control's name also as the name of the data field, when sending data back to the server. Now if you think it is good design to write design-dependent server side code, then go on, keep naming your HTML controls by their (control) type, but if you (as Mung Kee) think you should write your server side code independent from the design (e.g. to make it reusable), then refrain from doing so, and instead name your controls after the data they handle.

    cu


  • (cs) in reply to Mung Kee
    Mung Kee:
    I have never met an engineer who hasn't gotten heated about something for which he has conviction.

    Finally something I agree with!

    uh... with which I agree.
  • (cs) in reply to Jeff S
    Jeff S:
    Eagle -- nice post, I couldn't agree more.

    The debate seems to be more about whether or not programmers who decide that they like to prefix things occasionally shoud be fired, shot, or worse; and whether or not it really truly affects the enterprise and overall productivity.

    being the spineless bastard that I am, I feel that if the guy writing the html/javascript likes to use prefixes, which mean sthat the form submitted will have a name/value pair of "txtName" instead of "Name",  how much of my time and productivity should I spend ranting, raving and complaining to anyone that will listen about it, when it literally means I have to type 3 more characters on they keyboard now and then. 

    Would I prefer "name" ?  Sure! Would I use "Name". Absolutely!  Might I even suggest that the html guy uses "name" also?  You bet!  But will I rant and rave and complain and call people "retarded" and question their programming skill and try to get people fired and assume that this "txtName" object has caused massive productivity issues?

    Nah .... I'll get over it.




    I'm not a huge fan of what-if programming* but suppose we want to change the UI altogether.  Maybe we want to expose it as a web service instead of an ASP/JSP/PHP page.  What does "selTitle" or "txtFirstName" mean then?  Nothing, because it's out of context.  The point is, you never really know for sure whats going to happen with your app down the road, so let's not muck it up with things that are there only to jumstart a GUI developers brain.

    *what-if programming - v. - The act of programming in which upwards of 75% of the code is written for "might-be scenarios" that will never be realized
  • (cs) in reply to eagle
    eagle:
    The whole point here is, that the browser uses the control's name also as the name of the data field, when sending data back to the server. Now if you think it is good design to write design-dependent server side code, then go on, keep naming your HTML controls by their (control) type, but if you (as Mung Kee) think you should write your server side code independent from the design (e.g. to make it reusable), then refrain from doing so, and instead name your controls after the data they handle.

    How the fuck is the ASP page, whose sole purpose is to generate the client-side HTML, going to be "reused" to do something else?

    Once the server-side page scrapes the submitted form, it will construct/fill a business class instance with the data. At that time, the abstraction to the business tier can occur, and the business object's members name's can reflect that.


  • (cs) in reply to Mung Kee
    Mung Kee:
    Jeff S:
    Eagle -- nice post, I couldn't agree more.

    The debate seems to be more about whether or not programmers who decide that they like to prefix things occasionally shoud be fired, shot, or worse; and whether or not it really truly affects the enterprise and overall productivity.

    being the spineless bastard that I am, I feel that if the guy writing the html/javascript likes to use prefixes, which mean sthat the form submitted will have a name/value pair of "txtName" instead of "Name",  how much of my time and productivity should I spend ranting, raving and complaining to anyone that will listen about it, when it literally means I have to type 3 more characters on they keyboard now and then. 

    Would I prefer "name" ?  Sure! Would I use "Name". Absolutely!  Might I even suggest that the html guy uses "name" also?  You bet!  But will I rant and rave and complain and call people "retarded" and question their programming skill and try to get people fired and assume that this "txtName" object has caused massive productivity issues?

    Nah .... I'll get over it.




    I'm not a huge fan of what-if programming* but suppose we want to change the UI altogether.  Maybe we want to expose it as a web service instead of an ASP/JSP/PHP page.  What does "selTitle" or "txtFirstName" mean then?  Nothing, because it's out of context.  The point is, you never really know for sure whats going to happen with your app down the road, so let's not muck it up with things that are there only to jumstart a GUI developers brain.

    *what-if programming - v. - The act of programming in which upwards of 75% of the code is written for "might-be scenarios" that will never be realized


    I still don't see where we are disagreeing or where anything I wrote contradicts anything you've said...  The "txt" prefix of "txtName" means nothing to the ASP page even BEFORE your "what-if" scenerio, as you've mentioned over and over.

    But again, remember the point of that ASP page is to accept a post from an HTML page.  Whether you like it or not, they are tightly bound.  There are other technologies -- web services, for example -- that you should be using if you want to think about writing a generic page that accepts requests from various sources -- even non-HTML forms -- and does things with it. 
  • Random guy who did some ui stuff (unregistered) in reply to Mung Kee
    Mung Kee:
    Anonymous:

    What the hell kind of slippery-slope argument is that?
    It's a perfectly legitimate one.  If you use prefixes to HTML widget names to describe what a piece of data's UI representation is, why not use prefixes on your database to describe what type of data it is?  By your response, your solution is half-assed.  Lets name every to ensure that it describes itself, lest anyone get confused what the firstName text field's type might be.

    If the column names had to be named the same as the form controls, that would be a good reason to keep naming conventions out of your form.  In that case the burden on the UI programmer is less than the burden of dealing with stupid column names.
    If you consider my table def stupid, as do I, then the same principles apply to text fields.  My DB example does exactly what the other examples do.

    But someone, somewhere, takes form data and puts it in the database.  Asking that guy to not explode in a ball of rage when passed 'txtLastName' is a bit different than naming your columns after ui controls.
    This forum is here to discuss irregularities or peculiar implementations.  That's what I was doing when I mentioned this.  There are plenty of people here that subscribe to my perspective.  There are also many people here that aren't as disciplined or knowledgable in software architecture and design or just don't care.  These people certainly serve a purpose in some software companies but good design is good design.  If you like to use solely your ASP to interact with the database, by all means go for it.  It may suit your needs and it may fulfill all the business requirements, but it won't be good design.

    Prefixing the database column names and prefix UI controls is not the same thing.  In the database case, you're describing the data type with a prefix.  In the UI case, you're describing the data representation.  Both of these are adding information to your variable names, but not the same information.

    As I mentioned before, I'd rather have the advantages of lbl, txt and sel in my html IF I was writing a lot of code to manipulate it.  But this has nothing to do with wanting type names on my database schema. 

    Thus, thinking hungarian notation on column names is stupid does not require you to think that representation names on UI objects are stupid.  Obviously the real problem is with the HTML standard, that doesn't allow you to simply rename postdata with a name different than the object it came from.

    After typing that I realize I only assume HTML can't do that (simply).  If it can, then your position is the correct one.

    "This forum is here to discuss irregularities or peculiar implementations.  That's what I was doing when I mentioned this."

    It seemed to me that the "discussion" was becoming an "ad-hominem flamewar," which is why I suggested that the serverside coders would burst into flame at "txtLastName."  And yes, I know that it takes two sides to flame.

  • (cs) in reply to hank miller
    hank miller:

    Variable names are a clue, but that is all - no compiler enforces them.


    AFAIK, that's not entirely correct. Didn't FORTRAN originally actually use the first letter of the variable name to determine the type?
  • (cs) in reply to Jeff S
    Jeff S:

    But again, remember the point of that ASP page is to accept a post from an HTML page.  Whether you like it or not, they are tightly bound.  There are other technologies -- web services, for example -- that you should be using if you want to think about writing a generic page that accepts requests from various sources -- even non-HTML forms -- and does things with it. 


    They are not (or shouldn't be anyway) tightly bound.  Here is an example.  I just finished an application that had to post securely, to a remote third-party application using Java.  I could easily have queried the database for relevant data, passed it to a JSP page, with a form, and set it to post onload using JS, as many of their clients do.  But since there was no need for a VIEW (of MVC/Model2) for this application, my better design sense told me I should programatically post it.  In this case, the server expected fields named only after the data they represent and the front end was not coupled with the server side code in any way.
  • (cs) in reply to Mung Kee
    As you'll see in a later post if you can rationalize "sel" prefixing a select box name lets do it on DB tables and everything in between.


    I'm really not getting this line of reasoning...  How do we go from prefixing(or postfixing) our UI controls in the presentation layer down to doing the same thing at the storage level?  Obviously there is abstraction between the two layers(dear God, please let there be), so we have objects that we instantiate, take properties from that object and populate a web form.  Are you saying from some twisted reasoning that those properties should be prefixed the same way?  Why?  They're not text boxes, they're going to be other objects or value types.

    I really think that this whole discussion has primarily been a miscommunication about different web development platforms.  ASP.NET identifies almost every control you place on a page.  Those controls have server side objects representing them.  So when I place a label on a web form, it also gets declared in my code behind, same for pretty much every other control.  A lot of the controls have HTML equivalents that can be used without having this code behind object, but most of the time that the objects are used, are because they are being manipulated in some way.  Labels and text boxes have their text properties changed in the code behind.  Drop downs and list boxes have their data sources bound to, and buttons have events wired up in the code behind.

    I'm not going to talk about perl and php platforms because I have no experience with them.  However, I find prefixing controls very useful in ASP.NET development, and I don't see why there is a HUGE uproar about this.  I do not see the HARM in doing this, and I definitely don't see the reasoning behind the statement that our database columns should be prefixed with the control types that are used in the presentation layer to represent those columns.

    Strangely enough, as I mentioned earlier, I do not care for hungarian notation in anything lower than the presentation layer. 
  • (cs) in reply to Random guy who did some ui stuff
    Anonymous:

    Prefixing the database column names and prefix UI controls is not the same thing.  In the database case, you're describing the data type with a prefix.  In the UI case, you're describing the data representation.  Both of these are adding information to your variable names, but not the same information.


    Of course they aren't using the same information.  They are using application layer specific terminology to describe themselves.  They can't use the same information.  You are using "sel", "txt", "rad" to describe your widgets in HTML and I'm using "VCHAR20", "DTIME" and "NUM" prefixes to describe my widgets in the database.  How am I wrong?
  • (cs) in reply to Ytram
    Ytram:
    ...and I definitely don't see the reasoning behind the statement that our database columns should be prefixed with the control types that are used in the presentation layer to represent those columns.

    Of course I don't promtoe this cockeyed DB table idea.  I was just using it to highlight what I perceive to be an absurdity of using the same priciples on the client.  Apparently M$ (shorthand) interpetation of separation between the client and the web layer is different than Sun's.  ASP.NET gives you server-side represenations of the HTML widgets while Java gives you a hash.  That doesn't mean you HAVE to name a field with the prefix, does it?
  • (cs) in reply to Mung Kee
    Mung Kee:
    Ytram:
    ...and I definitely don't see the reasoning behind the statement that our database columns should be prefixed with the control types that are used in the presentation layer to represent those columns.

    Of course I don't promtoe this cockeyed DB table idea.  I was just using it to highlight what I perceive to be an absurdity of using the same priciples on the client.  Apparently M$ (shorthand) interpetation of separation between the client and the web layer is different than Sun's.  ASP.NET gives you server-side represenations of the HTML widgets while Java gives you a hash.  That doesn't mean you HAVE to name a field with the prefix, does it?


    No, I don't HAVE to name them with a prefix, but what is the harm?  I find it more useful, my co-workers find it more useful, and we all use it(this is at three different companies, two small ones, one very large).    It has been referred to in this thread as a crutch, but a crutch is something that you rely on that actually slows you down or impedes performance.  There is no performance benefit or penalty on using this naming convention, and at least for me personally, I find it speeds up my development(especially when combined with IDE sugar like Intellisense).
  • (cs) in reply to Mung Kee
    Of course I don't promtoe this cockeyed DB table idea.


    I know you're not promoting it, I'm just not getting the connection.  That's like saying since I put my cereal in a ceramic bowl, that my cereal must be made of ceramic.
  • (cs) in reply to Ytram
    Ytram:
    Mung Kee:
    Ytram:
    ...and I definitely don't see the reasoning behind the statement that our database columns should be prefixed with the control types that are used in the presentation layer to represent those columns.

    Of course I don't promtoe this cockeyed DB table idea.  I was just using it to highlight what I perceive to be an absurdity of using the same priciples on the client.  Apparently M$ (shorthand) interpetation of separation between the client and the web layer is different than Sun's.  ASP.NET gives you server-side represenations of the HTML widgets while Java gives you a hash.  That doesn't mean you HAVE to name a field with the prefix, does it?


    No, I don't HAVE to name them with a prefix, but what is the harm?  I find it more useful, my co-workers find it more useful, and we all use it(this is at three different companies, two small ones, one very large).    It has been referred to in this thread as a crutch, but a crutch is something that you rely on that actually slows you down or impedes performance.  There is no performance benefit or penalty on using this naming convention, and at least for me personally, I find it speeds up my development(especially when combined with IDE sugar like Intellisense).


    I could also develop a client server application instead.  That would speed up development wouldn't it?  It just wouldn't be as maintainable, extensible or well designed.
  • (cs) in reply to Mung Kee
    Mung Kee:
    Ytram:
    Mung Kee:
    Ytram:
    ...and I definitely don't see the reasoning behind the statement that our database columns should be prefixed with the control types that are used in the presentation layer to represent those columns.

    Of course I don't promtoe this cockeyed DB table idea.  I was just using it to highlight what I perceive to be an absurdity of using the same priciples on the client.  Apparently M$ (shorthand) interpetation of separation between the client and the web layer is different than Sun's.  ASP.NET gives you server-side represenations of the HTML widgets while Java gives you a hash.  That doesn't mean you HAVE to name a field with the prefix, does it?


    No, I don't HAVE to name them with a prefix, but what is the harm?  I find it more useful, my co-workers find it more useful, and we all use it(this is at three different companies, two small ones, one very large).    It has been referred to in this thread as a crutch, but a crutch is something that you rely on that actually slows you down or impedes performance.  There is no performance benefit or penalty on using this naming convention, and at least for me personally, I find it speeds up my development(especially when combined with IDE sugar like Intellisense).


    I could also develop a client server application instead.  That would speed up development wouldn't it?  It just wouldn't be as maintainable, extensible or well designed.


    Ok, so we've made the jump from presentation layer container names having the same name as database column names.  Now we're making the jump from naming conventions you don't like being the same as re-writing the application with a completely different architecture.  How in the hell does the naming convention I use keep an application from being maintainable, extensible, or well designed?
  • (cs) in reply to Ytram
    Ytram:
    Of course I don't promtoe this cockeyed DB table idea.


    I know you're not promoting it, I'm just not getting the connection.  That's like saying since I put my cereal in a ceramic bowl, that my cereal must be made of ceramic.


    I can see how you could perceive it that way.  Forget about the fact that ASP pages can put data into the database (or that you can put cereal into your bowl).  What I was saying was, if I use these prefixes to help describe my HTML widgets, while Im writing my JavaScript, why can't i use prefixes to help describe the database fields, so when I see them in my Java/Perl/C/VB/etc code I can immediately tell what the validation should be?
  • Random guy who did some ui stuff (unregistered) in reply to Mung Kee

    The only thing you were "wrong" in was your initial claim -- that if you describe your widgets with prefixes, you should be ok with describing databases with prefixes.

    The choice to add a prefix to a variable is dependent on the tradeoff between things you gain from the prefix versus compromises you have to make elsewhere (in this case, the application layer).  The benefits from "sel" is different from "dtime,"   and so are the compromises.

    Thus, the statement, "why not carry it to the presentation layer and name columns like DTIME_OMFG" implies that these two things are identical and should be either both done or neither done.  I claim they are NOT identical and that statement was a slippery slope argument designed to make the reader think "Wow, Hungarian notation in database columns is stupid.  And that's the same as prefixing widget types, so I prefixing widget types is stupid too."

    Trying to play logic police here, hopefully without being a dick or introducing new logical fallacies.

     

  • (cs) in reply to Mung Kee
    Mung Kee:

    I could also develop a client server application instead.  That would speed up development wouldn't it?  It just wouldn't be as maintainable, extensible or well designed.

    First you're saying a certain HTML naming convention is tantamount to naming DB attributes the same way, now you're saying it's analogous to a completely differeent architecture? Sorry, your hyperbole ain't workin'.
  • Random guy who did some ui stuff (unregistered) in reply to Mung Kee

    //sucks at forums

    Meant to quote this.

    Mung Kee:
    Anonymous:

    Prefixing the database column names and prefix UI controls is not the same thing.  In the database case, you're describing the data type with a prefix.  In the UI case, you're describing the data representation.  Both of these are adding information to your variable names, but not the same information.


    Of course they aren't using the same information.  They are using application layer specific terminology to describe themselves.  They can't use the same information.  You are using "sel", "txt", "rad" to describe your widgets in HTML and I'm using "VCHAR20", "DTIME" and "NUM" prefixes to describe my widgets in the database.  How am I wrong?

     

  • (cs) in reply to Random guy who did some ui stuff
    Anonymous:

    The only thing you were "wrong" in was your initial claim -- that if you describe your widgets with prefixes, you should be ok with describing databases with prefixes.

    The choice to add a prefix to a variable is dependent on the tradeoff between things you gain from the prefix versus compromises you have to make elsewhere (in this case, the application layer).  The benefits from "sel" is different from "dtime,"   and so are the compromises.

    Thus, the statement, "why not carry it to the presentation layer and name columns like DTIME_OMFG" implies that these two things are identical and should be either both done or neither done.  I claim they are NOT identical and that statement was a slippery slope argument designed to make the reader think "Wow, Hungarian notation in database columns is stupid.  And that's the same as prefixing widget types, so I prefixing widget types is stupid too."

    Trying to play logic police here, hopefully without being a dick or introducing new logical fallacies.


    I didn't say all or none, forst of all.  You say the benefit/tradeoff is different, but you never say how.  They both allow you to immediately recognize information about the [thing] that you wouldn't otherwise know if it were named FIRST_NAME of firstname.

    How do the tradeoffs differ?

    P.S.
    You can try to use psychology to explain my wording if you please, but aren't all our statements "designed" to be compelling in some way?  If one is not trying to compel, one should probably keep one's mouth shut, because there is likely no value in the statement.

  • (cs) in reply to Mung Kee
    Mung Kee:
    Ytram:
    Of course I don't promtoe this cockeyed DB table idea.


    I know you're not promoting it, I'm just not getting the connection.  That's like saying since I put my cereal in a ceramic bowl, that my cereal must be made of ceramic.


    I can see how you could perceive it that way.  Forget about the fact that ASP pages can put data into the database (or that you can put cereal into your bowl).  What I was saying was, if I use these prefixes to help describe my HTML widgets, while Im writing my JavaScript, why can't i use prefixes to help describe the database fields, so when I see them in my Java/Perl/C/VB/etc code I can immediately tell what the validation should be?


    Because those prefixes don't describe what type of object the database column is.  They tell the programmer what type of control it is.  On top of that, the columns in the database could be used in multiple controls.  Perhaps I fill a drop down with multiple values from one column, and then on the next page I fill a text box with one value from the same column.

    Again, I have to state that this is a personal preference.  I am not advocating that you should do it this way, and I don't see why you are strongly advocating against it.  My personal preference is not going to break any kind of design, extensibility, or maintainability.  If my co-workers hated it also, I would stop doing it, but I would probably do my personal coding the way I like.
  • (cs) in reply to Ytram
    Ytram:
    Mung Kee:
    Ytram:
    Of course I don't promtoe this cockeyed DB table idea.


    I know you're not promoting it, I'm just not getting the connection.  That's like saying since I put my cereal in a ceramic bowl, that my cereal must be made of ceramic.


    I can see how you could perceive it that way.  Forget about the fact that ASP pages can put data into the database (or that you can put cereal into your bowl).  What I was saying was, if I use these prefixes to help describe my HTML widgets, while Im writing my JavaScript, why can't i use prefixes to help describe the database fields, so when I see them in my Java/Perl/C/VB/etc code I can immediately tell what the validation should be?


    Because those prefixes don't describe what type of object the database column is.  They tell the programmer what type of control it is.  On top of that, the columns in the database could be used in multiple controls.  Perhaps I fill a drop down with multiple values from one column, and then on the next page I fill a text box with one value from the same column.

    Again, I have to state that this is a personal preference.  I am not advocating that you should do it this way, and I don't see why you are strongly advocating against it.  My personal preference is not going to break any kind of design, extensibility, or maintainability.  If my co-workers hated it also, I would stop doing it, but I would probably do my personal coding the way I like.


    They don't describe what type of object it is, since it's not an object.  But, like "selCountry" tells the JavaScript developer what attributes can be used to describe the widget (text value, length, enabled, etc.), my prefixes describe the type of data and the max length.  I say, on some perverse level, it's very intuitive.  <HAHA>

    On top of that, the columns in the database could be used in multiple controls.
    My prefixes, though rediculous, don't disallow multiple controls from using the data. 
  • (cs) in reply to Mung Kee

    They don't describe what type of object it is, since it's not an object.  But, like "selCountry" tells the JavaScript developer what attributes can be used to describe the widget (text value, length, enabled, etc.), my prefixes describe the type of data and the max length.  I say, on some perverse level, it's very intuitive.  <HAHA>

    On top of that, the columns in the database could be used in multiple controls.
    My prefixes, though rediculous, don't disallow multiple controls from using the data. 


    Ok, so no we're going to go over semantics.  Replace object with data type if you prefer, but the point is still there.  You are saying that if you're prefixing control names, then that prefix should propagate down to the database column name.  So if I happen to fill a text box with the value from one column in one row from one table, that column should be named "txtWhatever" since my form control is "txtWhatever".

    I had a question about something you mentioned earlier.  You said that you can understand the use of prefixes in an MFC application.  Why would it be any different for an ASP.NET application?
  • (cs) in reply to Jeff S
    Jeff S:
    I don't want to insult you further by suggesting that you go back and actually read what I've written (all of it, in all my posts in this thread, and not just snippets), so I won't, which means that I guess our discussion must end here.  I do hope (and I mean this in all sincerity, not as an insult) that you handle the management of your programming team with better communication, patience, comprehension to details, and understanding than you have demonstrated here.


    Oh sure - you contradict what you said in the snippet I posted in some of your other posts but that merely shows that you're not a very good thinker. That doesn't show anything.

    You asked for concrete proof why I drew the conclusion I did.
    I cited my reasoning, along with your offending text.
    Then, you told me that the snippet wasn't good enough.

    It's clear that not only are you a poor employee but you're also an inconsistent thinker. There's no use having a conversation who is inconsistent so, take care. I hope you get fired soon because you don't have the gumption to speak up when you see a better way to do things. [Of course, maybe you're just not capable of seeing better ways to do things. Regardless, you've got a lot of problems.]
  • (cs) in reply to Ytram
    Ytram:

    They don't describe what type of object it is, since it's not an object.  But, like "selCountry" tells the JavaScript developer what attributes can be used to describe the widget (text value, length, enabled, etc.), my prefixes describe the type of data and the max length.  I say, on some perverse level, it's very intuitive.  <haha>

    On top of that, the columns in the database could be used in multiple controls.
    My prefixes, though rediculous, don't disallow multiple controls from using the data. 


    Ok, so no we're going to go over semantics.  Replace object with data type if you prefer, but the point is still there.  You are saying that if you're prefixing control names, then that prefix should propagate down to the database column name.  So if I happen to fill a text box with the value from one column in one row from one table, that column should be named "txtWhatever" since my form control is "txtWhatever".

    I had a question about something you mentioned earlier.  You said that you can understand the use of prefixes in an MFC application.  Why would it be any different for an ASP.NET application?
    </haha>


    No, the column should be named using it's own layer specific terminology.

    I can understand it in an MFC application because the business logic and the view (the controls) are more often than not in the same classes.  My original point (what seems ike 10 years ago) was that the business logic should not have any specific knowledge of the front ned.  I gather that, as with Swing, client server is more widely accepted in MFC than in web applications.


  • (cs) in reply to Mung Kee
    Mung Kee:

    No, the column should be named using it's own layer specific terminology.

    To clarify, if the HTML uses "sel" to say that it's a select box, then we use VCHAR20 to say that it's varchar of 20 character length.  Sadly, I have seen many tables with the prefix "TBL_", as if I didnt know it was a table when I opened Toad or ran a query on it.
  • (cs) in reply to Mung Kee
    I can understand it in an MFC application because the business logic and the view (the controls) are more often than not in the same classes.  My original point (what seems ike 10 years ago) was that the business logic should not have any specific knowledge of the front ned.  I gather that, as with Swing, client server is more widely accepted in MFC than in web applications.


    I haven't coded with Swing in quite some time(never done MFC), but if I remember correctly, the basic layout of a form class is like so:

    public class FormName implements (whatever listener you want)
    {
        Form Member1
        Form Member2
        ...
        Form MemberN

        Methods
    }

    This is essentially the same way win forms work with C# as well.  In addition to that, ASP.NET code behinds look similar to this as well.  ASP.NET development is a metaphor of window form development(and I'll be the first to admit it's not a very good one), but you will see all of your controls listed as global members of the code behind, and they are manipulated using these server objects.  The asp.net page, in a well designed system at least, will either access the Business Entity layer directly, or via a user process layer.

    I will again state my opinion that this disagreements in this discussion have mostly stemmed from the fact that some of us are talking about web development with experience in ASP.NET and others are coming from a Java, perl, etc background.
  • Random guy who did some ui stuff (unregistered) in reply to Mung Kee
    Mung Kee:
    Anonymous:

    The only thing you were "wrong" in was your initial claim -- that if you describe your widgets with prefixes, you should be ok with describing databases with prefixes.

    The choice to add a prefix to a variable is dependent on the tradeoff between things you gain from the prefix versus compromises you have to make elsewhere (in this case, the application layer).  The benefits from "sel" is different from "dtime,"   and so are the compromises.

    Thus, the statement, "why not carry it to the presentation layer and name columns like DTIME_OMFG" implies that these two things are identical and should be either both done or neither done.  I claim they are NOT identical and that statement was a slippery slope argument designed to make the reader think "Wow, Hungarian notation in database columns is stupid.  And that's the same as prefixing widget types, so I prefixing widget types is stupid too."

    Trying to play logic police here, hopefully without being a dick or introducing new logical fallacies.


    I didn't say all or none, forst of all.  You say the benefit/tradeoff is different, but you never say how.  They both allow you to immediately recognize information about the [thing] that you wouldn't otherwise know if it were named FIRST_NAME of firstname.

    How do the tradeoffs differ?

    P.S.
    You can try to use psychology to explain my wording if you please, but aren't all our statements "designed" to be compelling in some way?  If one is not trying to compel, one should probably keep one's mouth shut, because there is likely no value in the statement.

    >>How do the tradeoffs differ?

    Pros to using "sel", "txt", etc: 

    Programmer uses a style he is familiar with

    Arguably useful typechecking for javascript

    Potentially faster code completion over postfix (lblLastName / txtLastName is better than LastName/LastNameLabel for code completion)

     

    Cons:

    Server-side processing contains reference to presentation.  Changing presentation name requires changing server-side processing.

    Pros to using DTIME_FOO:

    Programmers writing SQL should never mess up a column data type

    Cons:

    Programmers writing SQL have to type extra crap.

    There are probably other things to put as pros and cons, I've never tried it some I'm not really sure. 

    P.S.
    You can try to use psychology to explain my wording if you please, but aren't all our statements "designed" to be compelling in some way?  If one is not trying to compel, one should probably keep one's mouth shut, because there is likely no value in the statement.

    There is a difference between statements designed to compel and statements designed to mislead.  Everyone wants people to listen to what they say, and everyone wants to convice other people they are right.  You see the statement "why not carry it to the presentation layer and name columns like DTIME_OMFG" as a way to convince people you are right, and I claim it is logically flawed.  I apologize for implying that you were intentionally being misleading, as it is obvious you believe it to be true.  I have attempted to point out why I think they are different above.  I also thought you were being intentionally misleading by picking the most verbose SQL naming convention as possible, where a better parallel would be "datLastLogin" and "txtFirstName" instead of "DTIME_LAST_LOGIN" and "VARCJAR20_FIRST_NAME."

    I think there are situations in which breaking a little bit of the layer-based design can be beneficial, especially in smaller systems.  I agree that this makes your design worse, but if it makes your coding easier, it can be worth it, in my opinion.

     

     

     

     

  • x-sol (to lazy to login) (unregistered) in reply to Mung Kee
    Mung Kee:
    Anonymous:

    Mung Kee:
    Jeff S:

    It's one thing if something someone is doing causes you more work (i.e., some of those database "designs" out there  ...) but does this really affect you one way or another?  How much productivity is lost when a form's names have prefixes?


    It does effect everyone on the project because it's poor design.  If the server component has no interest in the way in which a component is rendered on the client, don't give him any knowledge of it.  Though I know it's not true, I'm beginning to think that few people approach design of an application as it is multiple, mutually exclusive, layers.

     

    You need to chill out the buddy. I mean look at your avatar you look like some mad dog.....

    Lets say I haven't worked on my app (WEB APP) in 3 years and I have to make some validation changes because someone finally found that validation flaw I didn't catch. I open my god awful php, or jsp code or even better perl, up and I find the spot where the glitch is it named Address I assume it's a textbox because  I don't remember and let's say I don't have access to all the code for somereason.

    OH! BLING BLING! That was a Drop down list and I treated it like a textbox now that entire page is broken and my long time client fires me for being an edit. Not very likely but I have seen things like that happen.

    That's why I love ASP.Net it stomps all over every other weak ass spliced n hacked glue language out there.

    Yes I validate my data in js and in codebehind... you know how reliable js is ...



    The avatar is Samir from Office Space.  Ever seen it?

    I think we pretty much covered miscommunication in language architectures (you typically operate on object instances of the HTML widgets in ASP code).  In Java and Perl, its a hash.  A list of name value pairs.  An HTML select box only submits one value...the selected one.  A radio button group only submits one value...the selected one.

    What's a spliced and hacked glue language, or did you make that up?  Have you ever developed a significant application using another language or is this your first job?  If you're unaware of all the wonderful languages and platforms out there then you are surely missing out.  Each one of them may have their own caveates, but to learn them is always rewarding.

     

    PERL and PHP let me take bits and parts of other laguages including syntax and put it all in one big mess of code standard nightmare

  • (cs) in reply to Mung Kee
    Mung Kee:

    Of course you can have more than one layer, but this question was of course rhetorical.  I guess I'm not sure where you get 'heavily complex, browser-dependend client-side scripting' from what I said.  My position is that you should have limited JavaScript on the client. 

    I guess it takes a lot of JavaScript to hide every detail of how the HTML page is made from the server.  In my imagination I see the picture of a static(*) HTML page that uses AJAX to fetch all data from the server and build the actually displayed page.

    (*) Of course the behaviour is dynamic, but the HTML source is always the same, not the kind you get from an old-fashioned web application where the server fills a template with actual data.
  • (cs) in reply to ammoQ
    ammoQ:
    Mung Kee:

    Of course you can have more than one layer, but this question was of course rhetorical.  I guess I'm not sure where you get 'heavily complex, browser-dependend client-side scripting' from what I said.  My position is that you should have limited JavaScript on the client. 

    I guess it takes a lot of JavaScript to hide every detail of how the HTML page is made from the server.  In my imagination I see the picture of a static(*) HTML page that uses AJAX to fetch all data from the server and build the actually displayed page.

    (*) Of course the behaviour is dynamic, but the HTML source is always the same, not the kind you get from an old-fashioned web application where the server fills a template with actual data.


    And an AJAX page is the poster child for widgets on demand. When you post from a sufficiently complex AJAX app (and there is room for good, old-fashioned posting), you may know what the form target is (CGI script, code-behind page, whatever -- let's not even pretend to know what the target platform is) and what data you want to move there, but you don't necessarily know what widgets will be in play at the time. It's probably the worst-case scenario for a widget prefix argument.
  • (cs) in reply to Richard Nixon

    Richard Nixon:
    Jeff S:
    I don't want to insult you further by suggesting that you go back and actually read what I've written (all of it, in all my posts in this thread, and not just snippets), so I won't, which means that I guess our discussion must end here.  I do hope (and I mean this in all sincerity, not as an insult) that you handle the management of your programming team with better communication, patience, comprehension to details, and understanding than you have demonstrated here.


    Oh sure - you contradict what you said in the snippet I posted in some of your other posts but that merely shows that you're not a very good thinker. That doesn't show anything.

    You asked for concrete proof why I drew the conclusion I did.
    I cited my reasoning, along with your offending text.
    Then, you told me that the snippet wasn't good enough.

    It's clear that not only are you a poor employee but you're also an inconsistent thinker. There's no use having a conversation who is inconsistent so, take care. I hope you get fired soon because you don't have the gumption to speak up when you see a better way to do things. [Of course, maybe you're just not capable of seeing better ways to do things. Regardless, you've got a lot of problems.]

    Yes, the snippet wasn't good enough.  You drew wild, inaccurate conclusions based on a very vague sequence of 2 sentences I wrote, using vague terminology like "not crying" about things ... now, instead ofmaking up your own little stories and assumptions about what I was referring to, why don't you calm down, take a little bit of time to actually read my posts, and see if you can figure it out. I'll give you a clue -- I spelled it out, literally, at least 4 or 5 times.  Feel free to point out any inconsistencies that you like, as long as you don't take my statments and go off on wild assumptions and put words in my mouht, and I'll do my best to clarify for you.

    But, please, enough with the name calling and "I hope you get fired!" stuff ... try to act like an adult, ok?  I'm sorry that if I ask you to actually read what I write offends you, I don't mean it that way, it's just that I'd rather not have to repeat myself even more than I already have and it really makes a conversation easier when two people actually give the other party the courtesy of listening to the other and paying attention.  Thanks! 

  • (cs) in reply to Jeff S
    Jeff S:

    Richard Nixon:
    Jeff S:
    I don't want to insult you further by suggesting that you go back and actually read what I've written (all of it, in all my posts in this thread, and not just snippets), so I won't, which means that I guess our discussion must end here.  I do hope (and I mean this in all sincerity, not as an insult) that you handle the management of your programming team with better communication, patience, comprehension to details, and understanding than you have demonstrated here.


    Oh sure - you contradict what you said in the snippet I posted in some of your other posts but that merely shows that you're not a very good thinker. That doesn't show anything.

    You asked for concrete proof why I drew the conclusion I did.
    I cited my reasoning, along with your offending text.
    Then, you told me that the snippet wasn't good enough.

    It's clear that not only are you a poor employee but you're also an inconsistent thinker. There's no use having a conversation who is inconsistent so, take care. I hope you get fired soon because you don't have the gumption to speak up when you see a better way to do things. [Of course, maybe you're just not capable of seeing better ways to do things. Regardless, you've got a lot of problems.]

    Yes, the snippet wasn't good enough.  You drew wild, inaccurate conclusions based on a very vague sequence of 2 sentences I wrote, using vague terminology like "not crying" about things ... now, instead ofmaking up your own little stories and assumptions about what I was referring to, why don't you calm down, take a little bit of time to actually read my posts, and see if you can figure it out. I'll give you a clue -- I spelled it out, literally, at least 4 or 5 times.  Feel free to point out any inconsistencies that you like, as long as you don't take my statments and go off on wild assumptions and put words in my mouht, and I'll do my best to clarify for you.

    But, please, enough with the name calling and "I hope you get fired!" stuff ... try to act like an adult, ok?  I'm sorry that if I ask you to actually read what I write offends you, I don't mean it that way, it's just that I'd rather not have to repeat myself even more than I already have and it really makes a conversation easier when two people actually give the other party the courtesy of listening to the other and paying attention.  Thanks! 



    How was the snippet I quoted vague? It seemed pretty clearly stated.

    After you answer that one, explain to me why I should bother with someone who is inconsistent in their thinking?

    As for your plea to act like an adult, look at some of the stuff you've written, change your ways, and then we can talk about that.
  • (cs) in reply to Stan Rogers
    Stan Rogers:
    ammoQ:
    Mung Kee:

    Of course you can have more than one layer, but this question was of course rhetorical.  I guess I'm not sure where you get 'heavily complex, browser-dependend client-side scripting' from what I said.  My position is that you should have limited JavaScript on the client. 

    I guess it takes a lot of JavaScript to hide every detail of how the HTML page is made from the server.  In my imagination I see the picture of a static(*) HTML page that uses AJAX to fetch all data from the server and build the actually displayed page.

    (*) Of course the behaviour is dynamic, but the HTML source is always the same, not the kind you get from an old-fashioned web application where the server fills a template with actual data.


    And an AJAX page is the poster child for widgets on demand. When you post from a sufficiently complex AJAX app (and there is room for good, old-fashioned posting), you may know what the form target is (CGI script, code-behind page, whatever -- let's not even pretend to know what the target platform is) and what data you want to move there, but you don't necessarily know what widgets will be in play at the time. It's probably the worst-case scenario for a widget prefix argument.


    I aggree; in this setup, the server no longer needs to know the widget types, so prefixing would be a bad (probably not terribly bad, but ugly nonetheless). But, correct me if I'm wrong, this is a relatively new way to build apps. With many of the commonly used frameworks, like JSF, Struts, WebForms, the server is still responsible for creating the forms with all the widgets; in that scenario, prefixing is IMO acceptable.
  • Anne Onymous (unregistered) in reply to Random guy who did some ui stuff

    There are probably other things to put as pros and cons, I've never tried it some I'm not really sure.


    Embedding type information in variable names auto-snookers one of the more useful OO-design benefits; polymorphism.

    For this reason alone derivatives (and users) of Hungarian notation need to be taken out, beat up, and shot.

    Kudos to the poster a few back that demonstrated a technique for run-time class type enumeration in JS - now that was useful.

Leave a comment on “Real Programmers Build Their Own Form”

Log In or post as a guest

Replying to comment #:

« Return to Article