Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Why Are The Code Snippets So Tiny

by Anonymous Monk
on Jan 17, 2013 at 22:42 UTC ( [id://1013904]=monkdiscuss: print w/replies, xml ) Need Help??

Hello, Perl Monks;

Is there some theological reason why code snippets are set in such a microscopic typeface?

Whether I view this site on my netbook, a notebook, or a giant auxiliary display, while the text seems to scale proportionately, somehow, the code is always displayed in a typeface that is difficult to read.

Does such a rendering imply some advanced knowledge possessed only by The Perl Monks? Or, does the ability to read very small text somehow enhance one's coding ability?

Tally ho,

Jo3

Replies are listed 'Best First'.
Re: Why Are The Code Snippets So Tiny
by ww (Archbishop) on Jan 17, 2013 at 22:51 UTC
    We make them so small to ensure only up-and-coming young programmers (and young experts) can read them.

    But if that's not satisfactory (and if you can prove you are amongst the "young" -- say between 14 and 104), then you may find help in the fact that the display settings are --- woot, hold onto your hat -- Adjustable!

    Go to Display Settings, scroll down to the "Code Listings" section, and check the box for "Large Code Font". Alternately search out some of the threads about user-written css styling.

      I always thought it was because Perl is a write only language and we're not actually supposed to try to read the snippets.

      You learn something new every day.

      Well, hmm, indeed. I thought it was so that we'd apply one of the crudest available forms of motivation on Anonymous Transients to get them to create an account (and therefore to post under that account). ;-)

      I didn't write that - you didn't see it. It was all in your head ;-).

      There has been a lot of discussion about such matters over the years, I'm sure. I've been thinking a lot about it again since I read the thread started by frozenwithjoy, actually. Since then I've been going through the markup served by PerlMonks with a fine-tooth comb (and inventing other tools, where the comb would not suffice). One easily forgotten thing can be shown here. Aside from any preferences set by logged-in users (and remember to try viewing under perlmonks.net or perlmonks.com or whatever is not your logged-in norm, once in a while) …aside from such variables, there is the initial bare HTML served up like this:

      <pre class="code"><div class='codeblock'><tt class='codetext'><font si +ze="-1">

      That font element inside the tt is what gets changed when we do like ww wrote: in the Display Settings node, choose "Large Code Font". I think I ought to say that I'm not arguing to change PerlMonks so that the emitted markup becomes greatly different from what is demonstrated above. Hmm, yes, the font tag is a very deprecated antique from ancient days of yor. Yes, the impact (visually) for new visitors is probably a bit odd. However, I am not proposing that it be changed. A lot of code that parses PerlMonks markup is out there, and we don't know what someone is relying on (PerlMonks has been around for a very long time). Anyway, it can be worked-around.

      The best thing, by far, is to change it in Display Settings. The CSS methods are wonderful, absorbing, time-consuming puzzles to create, and I'm totally into them. However these are measures that only apply to what's seen when not viewing a perlmonks URL under /bare/?... (no user CSS is served up with the "Bare Monks" Special). There are many, many ways of using PerlMonks, I've come to understand, although I'll probably never do some of them. Anyhow, if using Bare Monks is at all important to you, or for some reason you need to view the site in a non-logged-in mode (maybe to show it to the B*ss without all the private messages from monkess “HotGuapita24” shouting from the Nodelet table?) then perhaps this minimal CSS will help:

      .codetext font[size="-1"], .inlinecode font[size="-1"] { font-size : inherit !important; }

      Users of various up to date Web browsers will either know how to put that CSS statement into use for (Firefox|Chrome|Opera) or they won't. Without being exhaustive: using Firefox / Mozilla CSS extentions, you'd cover the perlmonks URL gamut by wrapping the CSS statement above like so:

      @-moz-document domain("www.perlmonks.org"), domain("www.perlmonks.net"), domain("www.perlmonks.com"), domain("perlmonks.org"), domain("perlmonks.net"), domain("perlmonks.com") { /* CSS here */ }

      Perlmonks is a truly magnificent canvas for "personal creativity" in terms of shaping the presentational styling in practically endless ways. I've finally come to really appreciate that about it, after many many years of knowledge of the site.

Re: Why Are The Code Snippets So Tiny
by LanX (Saint) on Jan 17, 2013 at 22:54 UTC
    I agree with you that the defaults are ugly (especially the gap between regular text and inlined code)

    But if you have a login you can easily adjust it.

    ATM I'm using frozenwithjoy's solution CSS Show and Tell: Colored Code (well adapted to my needs, IIRC line-width or something)

    frozenwithjoy++ I haven't thanked you yet! =)

    Cheers Rolf

      That made my evening! :)

      Even if you don't have a login you can fairly easily adjust it: just change the monospace font's size in your browser. For example, in SeaMonkey go to Edit -> Preferences -> Appearance -> Fonts, and change the monospace font's size up from the default 13px.

      (Of course, other web sites' monospace text may look larger after that.)

Log In?
Username:
Password:

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

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

    No recent polls found