Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: Perl & Templating for a mobile future.

by Your Mother (Canon)
on Jan 16, 2013 at 03:05 UTC ( #1013485=note: print w/ replies, xml ) Need Help??


in reply to Perl & Templating for a mobile future.

Semantic, modern mark-up. Text::Xslate is about a bazillion times faster than TT2 and is extensible and speaks TT pretty well if you like that syntax. Small, semantic bites of templates so that content is not required to be in large batches but can included or not in the batch size that's relevant or in the user prefs for that matter. (mem)Caching for output (where they don't contain logged-in/user-specific data). DO NOT detect browsers! It was always a mistake and will always be a mistake because it ties your code to the minor version changes of 4–10 browsers. Detect capabilities (see modernizr for example)--exploit known problems in CSS parsing and such--and suggest options when discovered. Someone comes to example.com with a screen width of 480px -- you can suggest (and remember, don't keep asking) they switch to example.mobi or m.expample.com or whatever and let them choose.

It's a mistake to attempt to use client side hacking to fix the site. Phones and pads are fast now yes, but not so fast that they need 1,000 times the download bits to use the 10% of relevant markup and includes and that bandwidth generally costs a lot more on mobile. Run apps on Plack + uWSGI. Because you mentioned LAMP: Not apache, probably nginx. Not MySQL, probably Pg and client side storage/SQLite where relevant. And maybe not even Linux. Just saying, OpenBSD and OpenIndiana and others exist. Think about your particular problem space and what ongoing sysadmin overhead will look like and what the history of support and bugfixing/security has been before you shop for an operating system.

There was an excellent write-up somewhere about how github does content with object caching and fetching and generation but I can't find it. :\

Have fun! You're actually in a really lucky, if confusing and maddeningly open, place right now. Tests will save you from your own design mistakes as much as code mistakes too. Get them in as soon as specs are done. Costs 2x up front but will save... who knows? 100x during the life of any app that outlasts its creators.

Update: PhoneGap and friends will make a full on mobile app (with access to the hardware) pretty easy if you do the content (html/JS) stuff right.


Comment on Re: Perl & Templating for a mobile future.
Re^2: Perl & Templating for a mobile future.
by punch_card_don (Curate) on Jan 16, 2013 at 03:55 UTC
    Very interesting positions, thanks.

    Detect capabilities (see modernizr for example)

    Excellent library - but, then, I'm right back into client-side processing, or "client side hacking to fix the site". Plus, this is meant as a Progressive Enhancement tool to discover device capabilities for CSS3 capability-dependent stylesheets.

    I know, I know - browser detection sucks big time. Was hoping it had gotten better. 'Cause good browser sniffing and a capabilities database would mean we coudl do all that modernizr stuff server-side, which would be the dream.

    But I will definitely investigate Text::Xslate.

    Thanks.




    Time flies like an arrow. Fruit flies like a banana.
Re^2: Perl & Templating for a mobile future.
by stonecolddevin (Vicar) on Jan 17, 2013 at 17:43 UTC

    Everything you ever say I agree with.

    Three thousand years of beautiful tradition, from Moses to Sandy Koufax, you're god damn right I'm living in the fucking past

      Well, that's just because you're so handsome and capable. :P

        Oh now I'm blushing. And again, I agree with you.

        Three thousand years of beautiful tradition, from Moses to Sandy Koufax, you're god damn right I'm living in the fucking past

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (7)
As of 2014-08-28 03:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (255 votes), past polls