{"id":5096,"date":"2018-12-30T11:04:19","date_gmt":"2018-12-30T10:04:19","guid":{"rendered":"https:\/\/monodes.com\/predaelli\/?p=5096"},"modified":"2018-12-30T11:04:19","modified_gmt":"2018-12-30T10:04:19","slug":"why-monospace-font","status":"publish","type":"post","link":"https:\/\/monodes.com\/predaelli\/2018\/12\/30\/why-monospace-font\/","title":{"rendered":"Why monospace font?"},"content":{"rendered":"<p><em><a href=\"https:\/\/hackernoon.com\/does-column-width-of-80-make-sense-in-2018-50c161fbdcf6\"><img data-recalc-dims=\"1\" decoding=\"async\" class=\"alignnone size-full\" src=\"https:\/\/i0.wp.com\/cdn-images-1.medium.com\/max\/2000\/0%2ALq7HMmpc2sBXbjRG.jpg?w=910&#038;ssl=1\" alt=\"\" \/><\/a><a href=\"https:\/\/hackernoon.com\/does-column-width-of-80-make-sense-in-2018-50c161fbdcf6\">Does Column Width of 80 Make Sense in 2019? \u2013 Hacker Noon<\/a><\/em><\/p>\n<p>Why monospaced font, too? See <a href=\"http:\/\/liberty-eiffel.blogspot.com\/2012\/01\/im-almost-literate-program-please.html\"><span class=\"markup--anchor markup--p-anchor\" data-action=\"open-inner-link\" data-action-value=\"http:\/\/liberty-eiffel.blogspot.com\/2012\/01\/im-almost-literate-program-please.html\">http:\/\/liberty-eiffel.blogspot.com\/2012\/01\/im-almost-literate-program-please.html<\/span><\/a><\/p>\n<p>Seriously, the width of a line of code has much more to do about readability and understandaility than sheer &#8220;screen usage&#8221;.<\/p>\n<p><!--more--><!--nextpage--><\/p>\n<blockquote>\n<h1 id=\"22ac\" class=\"graf graf--h3 graf--leading graf--title\">Does Column Width of 80 Make Sense in\u00a02019?<\/h1>\n<p id=\"069b\" class=\"graf graf--p graf-after--figure\">One of the oldest <a class=\"markup--anchor markup--p-anchor\" href=\"https:\/\/javarevisited.blogspot.com\/2014\/10\/10-java-best-practices-to-name-variables-methods-classes-packages.html\" target=\"_blank\" rel=\"noopener\" data-href=\"https:\/\/javarevisited.blogspot.com\/2014\/10\/10-java-best-practices-to-name-variables-methods-classes-packages.html\">coding practice<\/a> is to keep line width 80, and many of us follow it blindly but have you ever thought why we have this practice in first place?<\/p>\n<p id=\"c02d\" class=\"graf graf--p graf-after--p\">I believe it was to make your code more readable in the age of small monitors so that whole content can fit in the screen, or it might have originated from the age of punch card, which was used to be 80 column wide.<\/p>\n<p id=\"5246\" class=\"graf graf--p graf-after--p\">This sounds reasonable when we think about those old days but do you think this rule makes sense in 2019?<\/p>\n<p id=\"59d2\" class=\"graf graf--p graf-after--p\">We are now living in the age where most of the developers have got <a class=\"markup--anchor markup--p-anchor\" href=\"https:\/\/www.amazon.com\/LG-32MP58HQ-P-32-Inch-Monitor-Screen\/dp\/B01BV1X9DG?tag=javamysqlanta-20\" target=\"_blank\" rel=\"nofollow noopener noopener noopener\" data-href=\"https:\/\/www.amazon.com\/LG-32MP58HQ-P-32-Inch-Monitor-Screen\/dp\/B01BV1X9DG?tag=javamysqlanta-20\">large monitors<\/a>, which can show up to 180 characters, <strong class=\"markup--strong markup--p-strong\">doesn\u2019t this is wastage of precious monitor space?<\/strong> It also makes your code unnecessary long, then it actually is.<\/p>\n<p id=\"1366\" class=\"graf graf--p graf-after--p\">I first come to know about line wrapping at 80, while reading Oracle Code Conventions for the <a class=\"markup--anchor markup--p-anchor\" href=\"http:\/\/www.java67.com\/2015\/07\/5-books-learn-java-8-functional-programming.html\" target=\"_blank\" rel=\"noopener\" data-href=\"http:\/\/www.java67.com\/2015\/07\/5-books-learn-java-8-functional-programming.html\">Java Programming Language<\/a>, which was last revised at April 20, 1999, which under indentation says<\/p>\n<blockquote id=\"c4e8\" class=\"graf graf--blockquote graf-after--p\"><p><em class=\"markup--em markup--blockquote-em\">4.1 Line Length<br \/>\nAvoid lines longer than 80 characters, since they\u2019re not handled well by many terminals and tools.<\/em><\/p><\/blockquote>\n<blockquote id=\"b3b9\" class=\"graf graf--blockquote graf-after--blockquote\"><p><em class=\"markup--em markup--blockquote-em\">Note: Examples for use in documentation should have a shorter line length-generally no more than 70 characters.<\/em><\/p><\/blockquote>\n<p id=\"faa7\" class=\"graf graf--p graf-after--blockquote\">source\u00a0: <a class=\"markup--anchor markup--p-anchor\" href=\"http:\/\/www.oracle.com\/technetwork\/java\/javase\/documentation\/codeconventions-136091.html#248\" target=\"_blank\" rel=\"noopener\" data-href=\"http:\/\/www.oracle.com\/technetwork\/java\/javase\/documentation\/codeconventions-136091.html#248\">http:\/\/www.oracle.com\/technetwork\/java\/javase\/documentation\/codeconventions-136091.html#248<\/a><\/p>\n<p id=\"5224\" class=\"graf graf--p graf-after--p\">If I understood correctly (I may be wrong), one goal of this rule is <strong class=\"markup--strong markup--p-strong\">consistency<\/strong>. I used to think that 80 was silly, but being able to go through source code written by a dozen different teams over last 7 years and not needing to re-size my window is a really nice thing. Consistent column width helps with the pace of reading code.<\/p>\n<p id=\"27e8\" class=\"graf graf--p graf-after--p\">Since I mostly worked with large monitors, like <a class=\"markup--anchor markup--p-anchor\" href=\"https:\/\/www.amazon.com\/LG-32MP58HQ-P-32-Inch-Monitor-Screen\/dp\/B01BV1X9DG?tag=javamysqlanta-20\" target=\"_blank\" rel=\"nofollow noopener\" data-href=\"https:\/\/www.amazon.com\/LG-32MP58HQ-P-32-Inch-Monitor-Screen\/dp\/B01BV1X9DG?tag=javamysqlanta-20\">LG 32MP58HQ-P 32-Inch IPS Monitor <\/a>with Screen Split, I also realize that we are wasting lots of precious space. The consistent column width of 80 is simply too little.<\/p>\n<p id=\"3fba\" class=\"graf graf--p graf-after--p\">I personally use 120 unless the project I work already finalized a column width, in that case, I go for consistency.<\/p>\n<figure id=\"affe\" class=\"graf graf--figure graf-after--p\">\n<div class=\"aspectRatioPlaceholder is-locked\">\n<div class=\"aspectRatioPlaceholder-fill\"><\/div>\n<div class=\"progressiveMedia js-progressiveMedia graf-image is-canvasLoaded is-imageLoaded\" data-image-id=\"0*bCmD0oogChKLlaSU\" data-width=\"5184\" data-height=\"3456\" data-scroll=\"native\"><\/div>\n<\/div>\n<\/figure>\n<figure id=\"affe\" class=\"graf graf--figure graf-after--p\">\n<div class=\"aspectRatioPlaceholder is-locked\">\n<div class=\"progressiveMedia js-progressiveMedia graf-image is-canvasLoaded is-imageLoaded\" data-image-id=\"0*bCmD0oogChKLlaSU\" data-width=\"5184\" data-height=\"3456\" data-scroll=\"native\"><img decoding=\"async\" class=\"progressiveMedia-image js-progressiveMedia-image\" src=\"https:\/\/cdn-images-1.medium.com\/max\/800\/0*bCmD0oogChKLlaSU\" data-src=\"https:\/\/cdn-images-1.medium.com\/max\/800\/0*bCmD0oogChKLlaSU\" \/><\/div>\n<\/div><figcaption class=\"imageCaption\">Photo by <a class=\"markup--anchor markup--figure-anchor\" href=\"https:\/\/unsplash.com\/@jefflssantos?utm_source=medium&amp;utm_medium=referral\" target=\"_blank\" rel=\"photo-creator noopener noopener\" data-href=\"https:\/\/unsplash.com\/@jefflssantos?utm_source=medium&amp;utm_medium=referral\">Jefferson Santos<\/a> on\u00a0<a class=\"markup--anchor markup--figure-anchor\" href=\"https:\/\/unsplash.com?utm_source=medium&amp;utm_medium=referral\" target=\"_blank\" rel=\"photo-source noopener noopener\" data-href=\"https:\/\/unsplash.com?utm_source=medium&amp;utm_medium=referral\">Unsplash<\/a><\/figcaption><\/figure>\n<p id=\"cd86\" class=\"graf graf--p graf-after--figure\">One more reason people give for still using a column with of 80 is that nowadays they are working with multiple files at once, mostly in <a class=\"markup--anchor markup--p-anchor\" href=\"http:\/\/bit.ly\/2yboQ5S\" target=\"_blank\" rel=\"noopener\" data-href=\"http:\/\/bit.ly\/2yboQ5S\">VIM<\/a> or in their IDEs like <a class=\"markup--anchor markup--p-anchor\" href=\"http:\/\/bit.ly\/2hiXebL\" target=\"_blank\" rel=\"noopener\" data-href=\"http:\/\/bit.ly\/2hiXebL\">Eclipse<\/a> or <a class=\"markup--anchor markup--p-anchor\" href=\"http:\/\/bit.ly\/2CSO36A\" target=\"_blank\" rel=\"noopener\" data-href=\"http:\/\/bit.ly\/2CSO36A\">IntelliJ IDEA<\/a>.<\/p>\n<p id=\"a283\" class=\"graf graf--p graf-after--p\">For example, if you use standard column width you can fit a couple of files across a reason and can compare them line by line, which I believe is a real benefit.<\/p>\n<p id=\"4b10\" class=\"graf graf--p graf-after--p\">You can even do a three-way merge inspection on one screen without scrolling sideways. By the way, this should not be done at cost of excessive wrapping.<\/p>\n<p id=\"afe4\" class=\"graf graf--p graf-after--p\">I understand that consistent columns make it easier to scan and read through text but it doesn\u2019t matter whether it\u2019s 80 or 120.<\/p>\n<p id=\"785d\" class=\"graf graf--p graf-after--p\">On a closing note, I would say that consistency is nice and you must go for it but 80 or even 100 is too short.<\/p>\n<p id=\"7b11\" class=\"graf graf--p graf-after--p\">Many developers could probably live with 120 or even 150 though. Our modern widescreen high definition <a class=\"markup--anchor markup--p-anchor\" href=\"https:\/\/www.amazon.com\/LG-32MP58HQ-P-32-Inch-Monitor-Screen\/dp\/B01BV1X9DG?tag=javamysqlanta-20\" target=\"_blank\" rel=\"nofollow noopener\" data-href=\"https:\/\/www.amazon.com\/LG-32MP58HQ-P-32-Inch-Monitor-Screen\/dp\/B01BV1X9DG?tag=javamysqlanta-20\">LCD monitors<\/a> can easily handle more.<\/p>\n<p id=\"a69a\" class=\"graf graf--p graf-after--p\">It is much more readable than the excessive wrapping because I personally find it much harder to read a wrapped line than just seeing the whole thing in one line. Of course, this is just preference and others will feel different.<\/p>\n<blockquote id=\"0d7f\" class=\"graf graf--pullquote graf-after--p graf--trailing\"><p><strong class=\"markup--strong markup--pullquote-strong\">So, what do you guys think, does this rule still hold or you have already moved\u00a0on?<\/strong><\/p><\/blockquote>\n<p>&nbsp;<\/p><\/blockquote>\n","protected":false},"excerpt":{"rendered":"<p class=\"excerpt\">Does Column Width of 80 Make Sense in 2019? \u2013 Hacker Noon Why monospaced font, too? See http:\/\/liberty-eiffel.blogspot.com\/2012\/01\/im-almost-literate-program-please.html Seriously, the width of a line of code has much more to do about readability and understandaility than sheer &#8220;screen usage&#8221;.<\/p>\n<p class=\"more-link-p\"><a class=\"more-link\" href=\"https:\/\/monodes.com\/predaelli\/2018\/12\/30\/why-monospace-font\/\">Read more &rarr;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"inline_featured_image":false,"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"activitypub_content_warning":"","activitypub_content_visibility":"","activitypub_max_image_attachments":4,"activitypub_interaction_policy_quote":"anyone","activitypub_status":"","footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[1],"tags":[],"class_list":["post-5096","post","type-post","status-publish","format-standard","hentry","category-senza-categoria"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p6daft-1kc","jetpack-related-posts":[{"id":11248,"url":"https:\/\/monodes.com\/predaelli\/2024\/01\/21\/programming-fonts-with-ligatures\/","url_meta":{"origin":5096,"position":0},"title":"Programming fonts with ligatures","author":"Paolo Redaelli","date":"2024-01-21","format":false,"excerpt":"A recent fad in programming communities is monospaced programming fonts full of cool ligatures. For example GitHub has 92 repositories marked as such; among them: FiraCode Free monospaced font with programming ligatures Iosevka Versatile typeface for code, from code. JetBrainsMono JetBrains Mono \u2013 the free and open-source typeface for developers\u2026","rel":"","context":"In &quot;Fonts&quot;","block_context":{"text":"Fonts","link":"https:\/\/monodes.com\/predaelli\/category\/fonts\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":3827,"url":"https:\/\/monodes.com\/predaelli\/2018\/02\/25\/3827\/","url_meta":{"origin":5096,"position":1},"title":"Fira code","author":"Paolo Redaelli","date":"2018-02-25","format":false,"excerpt":"FiraCode,\u00a0a Monospaced font with programming ligatures.","rel":"","context":"In &quot;Fonts&quot;","block_context":{"text":"Fonts","link":"https:\/\/monodes.com\/predaelli\/category\/fonts\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/monodes.com\/predaelli\/wp-content\/uploads\/sites\/4\/2018\/02\/firacode-font.png?fit=841%2C476&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/monodes.com\/predaelli\/wp-content\/uploads\/sites\/4\/2018\/02\/firacode-font.png?fit=841%2C476&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/monodes.com\/predaelli\/wp-content\/uploads\/sites\/4\/2018\/02\/firacode-font.png?fit=841%2C476&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/monodes.com\/predaelli\/wp-content\/uploads\/sites\/4\/2018\/02\/firacode-font.png?fit=841%2C476&ssl=1&resize=700%2C400 2x"},"classes":[]},{"id":11735,"url":"https:\/\/monodes.com\/predaelli\/2024\/06\/10\/md-io-%c2%b7-mass-driver\/","url_meta":{"origin":5096,"position":2},"title":"MD IO \u00b7 Mass-Driver\u2122","author":"Paolo Redaelli","date":"2024-06-10","format":false,"excerpt":"A contemporary monospaced typeface family designed for legibility, particularly at small sizes and on digital screens. Source: MD IO \u00b7 Mass-Driver\u2122 a beautiful, yet a little pricey font","rel":"","context":"In &quot;Fonts&quot;","block_context":{"text":"Fonts","link":"https:\/\/monodes.com\/predaelli\/category\/fonts\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":11220,"url":"https:\/\/monodes.com\/predaelli\/2024\/01\/18\/iosevka-programmer-font\/","url_meta":{"origin":5096,"position":3},"title":"Iosevka programmer font","author":"Paolo Redaelli","date":"2024-01-18","format":false,"excerpt":"Iosevka is an open-source, sans-serif\u00a0+\u00a0slab-serif, monospace\u00a0+\u00a0quasi\u2011proportional typeface family, designed for writing code, using in terminals, and preparing technical documents. It sports quite awesome statistics: 6,080 Characters Covered 38,323 Glyphs Included 234 Languages Supported 123 Character Variant Features 19 Stylistic Set Features 21 Ligation Sets Well... WOW.","rel":"","context":"In &quot;Fonts&quot;","block_context":{"text":"Fonts","link":"https:\/\/monodes.com\/predaelli\/category\/fonts\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":10907,"url":"https:\/\/monodes.com\/predaelli\/2023\/10\/22\/a-nice-gnome-theming\/","url_meta":{"origin":5096,"position":4},"title":"A nice Gnome theming","author":"Paolo Redaelli","date":"2023-10-22","format":false,"excerpt":"Mohamed Dali (on FB) proposes his \"perfect gnome setup\": a \"windows-like\" desktop environment with chromeOS material design UI. He used all those extentions, themes and the like: Gnome extensions : Arc menu - Dash to panel - Desktop-icons (external repositories). (Gtk4 Desktop Icons NG (DING) (there are other similar extensions)\u2026","rel":"","context":"In &quot;Senza categoria&quot;","block_context":{"text":"Senza categoria","link":"https:\/\/monodes.com\/predaelli\/category\/senza-categoria\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/monodes.com\/predaelli\/wp-content\/uploads\/sites\/4\/2023\/10\/393979524_258996207139931_2589958301338312503_n.webp?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/monodes.com\/predaelli\/wp-content\/uploads\/sites\/4\/2023\/10\/393979524_258996207139931_2589958301338312503_n.webp?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/monodes.com\/predaelli\/wp-content\/uploads\/sites\/4\/2023\/10\/393979524_258996207139931_2589958301338312503_n.webp?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/monodes.com\/predaelli\/wp-content\/uploads\/sites\/4\/2023\/10\/393979524_258996207139931_2589958301338312503_n.webp?resize=700%2C400&ssl=1 2x, https:\/\/i0.wp.com\/monodes.com\/predaelli\/wp-content\/uploads\/sites\/4\/2023\/10\/393979524_258996207139931_2589958301338312503_n.webp?resize=1050%2C600&ssl=1 3x"},"classes":[]},{"id":10748,"url":"https:\/\/monodes.com\/predaelli\/2023\/08\/30\/my-little-printer-friendly-css\/","url_meta":{"origin":5096,"position":5},"title":"My little printer-friendly CSS","author":"Paolo Redaelli","date":"2023-08-30","format":false,"excerpt":"Here is my little \"Printer friendly CSS\" that I add to each and every page using Simple Custom CSS and JS \/* override styles when printing *\/ @media print { @page { margin: 2cm; @top-center { font-family: sans-serif; font-weight: bold; font-size: 2em; content: counter(page); } } \/* target the first\u2026","rel":"","context":"In &quot;Tricks&quot;","block_context":{"text":"Tricks","link":"https:\/\/monodes.com\/predaelli\/category\/documentations\/tricks\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"jetpack_likes_enabled":true,"_links":{"self":[{"href":"https:\/\/monodes.com\/predaelli\/wp-json\/wp\/v2\/posts\/5096","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/monodes.com\/predaelli\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/monodes.com\/predaelli\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/monodes.com\/predaelli\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/monodes.com\/predaelli\/wp-json\/wp\/v2\/comments?post=5096"}],"version-history":[{"count":0,"href":"https:\/\/monodes.com\/predaelli\/wp-json\/wp\/v2\/posts\/5096\/revisions"}],"wp:attachment":[{"href":"https:\/\/monodes.com\/predaelli\/wp-json\/wp\/v2\/media?parent=5096"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/monodes.com\/predaelli\/wp-json\/wp\/v2\/categories?post=5096"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/monodes.com\/predaelli\/wp-json\/wp\/v2\/tags?post=5096"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}