Line wrapping: How does it work?



  • WTF is this bullshit‽ How can anyone think this sort of thing is a good idea?

    <div class="bullshitClassThatSpecifiesAWidth" style="width: 505px;"><span
    	class="gridCheckBox"></span> <span class="bullshitClass"><a4j:commandButton
    	action="#{foo.updateTheShit}"
    	alt="Save Data"
    	disabled="#{!foo.canUpdate}"
    	value="Save" /> </span> <span class="bullshitClass"> <a4j:commandButton
    	action="#{foo.editInBazMode}"
    	alt="Edit Details"
    	disabled="#{!foo.canUpdate}"
    	value="Edit Data" /> </span> <span class="bullshitClass"> <a4j:commandButton
    	action="#{foo.editInBatMode}"
    	alt="View Details"
    	rendered="#{!fooAction.canUpdate}"
    	value="View Data" /> </span> <span class="bullshitClass"><a4j:commandButton
    	action="#{bar.goto('SomeGoddamnedPage')}" alt="Cancel"
    	value="Cancel"/></span>
    </div>
    

    Ugh. So much anger.

    Lots of anonymization here


  • Discourse touched me in a no-no place

    Isn't wrapping lines inside tags like that a symptom of people who don't realize it's not the late 90s? I vaguely remember there was a time that if you put line breaks between tags, the browser would sometimes render the newline.



  • This is actually xhtml. It all gets processed and turned into html. As far as formatting goes, I like to use line breaks and indentation in a manner as below, because it's easy to read and see what is what:

    <div class="bullshitClassThatSpecifiesAWidth" style="width: 505px;">
    	<span class="gridCheckBox"></span>
    	<span class="bullshitClass">
    		<a4j:commandButton
    			action="#{foo.updateTheShit}"
    			alt="Save Data"
    			disabled="#{!foo.canUpdate}"
    			value="Save" />
    	</span>
    	<span class="bullshitClass">
    		<a4j:commandButton
    			action="#{foo.editInBazMode}"
    			alt="Edit Details"
    			disabled="#{!foo.canUpdate}"
    			value="Edit Data" />
    	</span>
    	<span class="bullshitClass">
    		<a4j:commandButton
    			action="#{foo.editInBatMode}"
    			alt="View Details"
    			rendered="#{!fooAction.canUpdate}"
    			value="View Data" />
    	</span>
    	<span class="bullshitClass">
    		<a4j:commandButton
    			action="#{bar.goto('SomeGoddamnedPage')}"
    			alt="Cancel"
    			value="Cancel"/>
    	</span>
    </div>
    

    Now, as with other sorts of coding, I'm sure there are people here who will hate the way I did this. But I think if they like what I originally posted better, they're LYING LIARS. In any case, the empty fucking span kind of jumps out at you here instead of hiding among the randomness.



  • @boomzilla said:

    <<!-- -->small><<!-- -->small><<!-- -->small>Lots of anonymization here

    Tag closing: How does it work?

    Yes, I know discourse still displays the text properly if you don't do it. But it's still dumb and ugly and wrong.



  • It nice that even the little trolling attempts hit they're marks now and then.
    <heh



  • @boomzilla said:

    It nice that even the little trolling attempts hit they're marks now and then.
    <heh

    Yup, their getting pretty good at it.
    <hah?


  • area_deu

    @boomzilla said:

    hit they're marks

    Yeah, yeah.

    Also, :hanzo:



  • You mother<!-- -->elgiu<!-- -->r, you...



  • I'm sure you're aware that

    <span class="bullshitClass">
    	<a4j:commandButton
    		action="#{foo.updateTheShit}"
    		alt="Save Data"
    		disabled="#{!foo.canUpdate}"
    		value="Save" />
    </span>
    

    and

    <span class="bullshitClass"><a4j:commandButton
    		action="#{foo.updateTheShit}"
    		alt="Save Data"
    		disabled="#{!foo.canUpdate}"
    		value="Save" /></span>
    

    render slightly differently because of the spaces/line-breaks (which browsers treat as spaces), right?



  • Some tools do that because wrapping inside a tag is guaranteed to not affect the layout. Breaking between tags might introduce whitespace.



  • @powerlord said:

    I'm sure you're aware that

    Hah!

    @powerlord said:

    render slightly differently because of the spaces/line-breaks (which browsers treat as spaces), right?

    The white space there doesn't end up in the actual html from what I can see. This is JSF2 xhtml.


  • :belt_onion:

    @boomzilla said:

    It nice that even the little trolling attempts hit they're marks now and then.

    @Dragnslcr said:

    Yup, their getting pretty good at it.

    Argh, stop it before I get a hearth attack.



  • @JBert said:

    hearth attack

    Like this?



  • Just a question: What happens if a dumb, inaccessible "helper" needs to find that Class, even if it is not populated?

    By dumb, I mean "unable to cope with failure" and by inaccessible, I mean anything from a Third Party API to buried under several tonnes of rubble / slag



  • @FrostCat said:

    I vaguely remember there was a time that if you put line breaks between tags, the browser would sometimes render the newline.

    As I remember it, the browser would sometimes render the newline as a space. The resulting space usually broke all of the carefully laid-out tables and resulted in ugly gaps in headers and menus that were composed of lots of little image slices.


  • Discourse touched me in a no-no place



  • @loose said:

    Just a question: What happens if a dumb, inaccessible "helper" needs to find that Class, even if it is not populated?

    I assume you're talking about one of the [anonymized] bullshit classes? It's defined in our application's stylesheet. Anyone who's been working on this project would be able to find it quickly.

    @loose said:

    By dumb, I mean "unable to cope with failure" and by inaccessible, I mean anything from a Third Party API buried under several tonnes of rubble / slag

    I...don't think that would be a problem. The class gets put into the html and the stylesheet is loaded as part of the page. Browser stuff happens.





  • it looks like someone used the ide to format its code...



  • Appreciated, But I was talking about the "empty" span.

    Also, a small but important word was missing from my post (that has no relevance or bearing on the sub-thread), so I have added it in.


  • Discourse touched me in a no-no place

    Oh, I thought your complaint was the formatting. I didn't notice that empty span. But I also don't know what a4j is--I assume that's some JS library or whatever that will fill in presumabtly-appropriate content, or that your gridCheckBox span will do something BSy like setting a background image of a checkbox and changing it on click of one of those command buttons or something equally horrible.



  • @FrostCat said:

    Oh, I thought your complaint was the formatting

    Yes, mostly it was. There are other issues, like the empty span.

    @Jarry said:

    it looks like someone used the ide to format its code...

    @loose said:

    Appreciated, But I was talking about the "empty" span.

    I have no idea what she thought about the empty span. Copy pasta is my best guess.


  • Discourse touched me in a no-no place

    @boomzilla said:

    @Jarry said:
    it looks like someone used the ide to format its code...

    LOL. Clearly the people involved in that movie had never actually met a hoarder. I was in the house of a book hoarder once and she did, in fact, stack books just like that. And then there were 30 identical stacks next to that one. An entire house, lived in by one person, and every room was literally nothing but a narrow passageway between endless piles of books.



  • My sympathy. When I see shit like this it's hard to resist using swearwords in the rectifying commit.



  • You have my approval (if it has any value) concerning the formatting style, it is very similar to my own. I often have difficultly with <p></p>. Except for very long paragraphs, I prefer <p>Some text</p> (actually I very rarely use <p> and use <div> anyway. On the matter of things generally, it depends on how silly it looks. I.e.

    ...snip

    <tr><td>&nbsp;</td></tr>
    

    snip...

    Rather than

    <tr>
     <td>
      &nbsp;
     </td>
    </tr>
    

    Because it can act as a visual clue to an empty element.

    Also my understanding is that all white space, at worse, is reduced to a single space when rendered - it may be different when the "source" is viewed and sometimes some browsers tidy up your code by "filling in" with closing tags. Putting your HTML text through "some" process can alter things too, but not by much.

    :thumbsup:



  • @loose said:

    Except for very long paragraphs, I prefer <p>Some text</p> (actually I very rarely use <p> and use <div> anyway. On the matter of things generally, it depends on how silly it looks. I.e.

    ...snip

    Yes, I agree with you. As I've said about code indenting / line breaking style, I'm not consistent. It's about whatever looks good and makes stuff easy to read.



  • @rc4 said:

    dumb and ugly and wrongDiscourse

    Discoempty



  • <!-- you call that a discoempty? THIS is a discoempty.-->



  • <!--Why in the holy fuck are html comments whitelisted?-->



  • They aren't by default.



  • :wtf: why did we whitelist them then?



  • Probably because they work well with our sense of humor (being programmers, mostly)


  • Winner of the 2016 Presidential Election

    They aren't?

    When did that happen?

    I've used HTML comments on Meta... At least I thought I did...



  • I am mistaken. They are.


  • Winner of the 2016 Presidential Election

    Yeah. They're whitelisted AND they count toward the word count. Which defeats purpose of the no empty post thing.

    Yay for Discourse!



  • <I think I can appreciate not allowing "empty" posts unless you get "creative"


  • Winner of the 2016 Presidential Election

    <Although I prefer to make fun of the empty post message


  • Winner of the 2016 Presidential Election

    @sloosecannon said:

    <Although I prefer to make fun of the empty post message

    <Like this
    Empty post be can't


  • Discourse touched me in a no-no place

    @sloosecannon said:

    <Although I prefer to make fun of the empty post message

    DESCRIPTIVE TEXT…



  • So anyway, yeah. The reason for this is obvious. This guy thought the attributes of the span were the only important stuff. Maybe they were?

    I'd have used separate tab counters per namespace, m'self...

    <!-- A lengthy deliberate misunderstanding leading into a discussion of the naive vs best-paragraph *text* line wrapping styles is beyond the scope of this topic and has been largely omitted -->


  • @Gribnit said:

    The reason for this is obvious. This guy thought the attributes of the span were the only important stuff.

    You don't know this person. I'd be very hesitant to attribute anything she does with such an inflammatory word as "thought."


Log in to reply
 

Looks like your connection to What the Daily WTF? was lost, please wait while we try to reconnect.