Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re^10: Here documents in blocks (why templates)

by Bod (Parson)
on Dec 21, 2020 at 17:35 UTC ( [id://11125538]=note: print w/replies, xml ) Need Help??


in reply to Re^9: Here documents in blocks (why templates)
in thread Here documents in blocks

Combining css and inline styles is something which hasn't been 'the done thing' in more than ten years

At first I took this on face-value as I accept that in theory, CSS and in-line styles are best kept separate. But then I wondered how true this is in the real world so looked at a few big name sites. The first I looked at have dynamical created content: Google, BBC. So I looked at Booking.com as I've seen this held up in a number of places as being (one of) the top sites written in Perl.

Look what I found within moments of examining the source HTML...

<input style="display: none" type="number" class="bui-stepper__input" data-bui-ref="input-stepper-field" id="group_children" name="group_children" min="0" max="10" value="0" data-group-children-count />

This is just one of many examples on the site today.

I'm not suggesting that bad practice in one place is justification for not trying to adopt best practice. However, it does show that I am hardly alone in this approach regardless of how much it isn't the 'done thing'. I'm not sure debating one bit of sample HTML which was shared to demonstrate something completely different helps with the original question about heredocs or with the subsequent divergence into templates.

Replies are listed 'Best First'.
Re^11: Here documents in blocks (why templates)
by marto (Cardinal) on Dec 21, 2020 at 18:37 UTC

    "I'm not sure debating one bit of sample HTML which was shared to demonstrate something completely different helps with the original question about heredocs or with the subsequent divergence into templates."

    My reply was the first to suggest templating, and commented on this as a side note. Printing literally each line of HTML at a time, substituting values within blocks of code like that is arcane. If it works for you it isn't a problem obviously, as mentioned more than once now, however when posting clunky things on a forum to help people learn how to do things better, expect someone to flag it up. Which shouldn't be surprising given previous conversations about modern perl and what it can do. From experience of writing and maintaining clean interfaces in sane ways, the learning curve isn't too steep and each small thing you learn to do better makes life a lot easier. Booking.com may be doing this to satisfy some other problem, as LanX has mentioned certain JavaScript UI toolkits do weird things. 22 requests pulling in 2MB of JavaScript, I'm not going to bother delving into any of that bloat. JavaScript is sometimes a necessary evil best used sparingly but just all too often misused these days, hence the bloated interwebs.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11125538]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (5)
As of 2024-04-23 07:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found