{"id":649,"date":"2024-04-16T11:45:37","date_gmt":"2024-04-16T03:45:37","guid":{"rendered":"https:\/\/gen-e-sis.com\/blog\/2021\/02\/06\/moving-on-from-hello-world-to-hello-caractacus\/"},"modified":"2026-03-19T17:29:15","modified_gmt":"2026-03-19T09:29:15","slug":"moving-on-from-hello-world-to-hello-caractacus","status":"publish","type":"post","link":"https:\/\/handelbarweb.com\/blog\/moving-on-from-hello-world-to-hello-caractacus\/","title":{"rendered":"Moving on from Hello World to Hello Caractacus"},"content":{"rendered":"<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"683\" height=\"1024\" data-attachment-id=\"1377\" data-permalink=\"https:\/\/handelbarweb.com\/blog\/moving-on-from-hello-world-to-hello-caractacus\/java-scroll\/\" data-orig-file=\"https:\/\/handelbarweb.com\/blog\/wp-content\/uploads\/2024\/04\/java-scroll.jpg\" data-orig-size=\"800,1200\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;1&quot;}\" data-image-title=\"java-scroll\" data-image-description=\"&lt;p&gt;This image stages a surreal courtroom of code and satire. At its center stands a regal judge in powdered wig and embroidered robes, the word \u201cCOMPILER\u201d boldly etched across his forehead like a divine declaration of syntax authority. He holds a parchment scroll unfurling the Java class public class Lyric, its lines written with poetic intent and object-oriented flair. Before him, a silver tray bears a melting globe\u2014symbol of overheated logic or global absurdity\u2014and a side of fries, golden and indifferent. The juxtaposition is theatrical: law meets language, world meets whimsy, and the compiler presides over it all with solemn nonsense. It\u2019s a portrait of lyrical justice in a runtime gone rogue.&lt;\/p&gt;\n\" data-image-caption=\"&lt;p&gt;When the compiler wears a wig and the world melts beside the fries\u2014justice is served in Java.&lt;\/p&gt;\n\" data-medium-file=\"https:\/\/handelbarweb.com\/blog\/wp-content\/uploads\/2024\/04\/java-scroll-200x300.jpg\" data-large-file=\"https:\/\/handelbarweb.com\/blog\/wp-content\/uploads\/2024\/04\/java-scroll-683x1024.jpg\" src=\"https:\/\/handelbarweb.com\/blog\/wp-content\/uploads\/2024\/04\/java-scroll-683x1024.jpg\" alt=\"\" class=\"wp-image-1377\" srcset=\"https:\/\/handelbarweb.com\/blog\/wp-content\/uploads\/2024\/04\/java-scroll-683x1024.jpg 683w, https:\/\/handelbarweb.com\/blog\/wp-content\/uploads\/2024\/04\/java-scroll-200x300.jpg 200w, https:\/\/handelbarweb.com\/blog\/wp-content\/uploads\/2024\/04\/java-scroll-768x1152.jpg 768w, https:\/\/handelbarweb.com\/blog\/wp-content\/uploads\/2024\/04\/java-scroll.jpg 800w\" sizes=\"auto, (max-width: 683px) 100vw, 683px\" \/><\/figure>\n<\/div>\n\n\n<span class=\"voice-tag\">Java Humor and Lyrical Code Parody<\/span>\n<div class=\"post-intro\">\n  <p>\n    A comedic remix of Java humor and lyrical code parody \u2014 weaving beginner satire, song structure in code, and object-oriented absurdity with britches, witches, and powdered recursion. Expect verses in camelCase, rhymes in semicolons, and a chorus of \u201cpublic static void main\u201d sung by enchanted compilers. It\u2019s Shakespeare meets Stack Overflow, with a runtime of pure nonsense.\n  <\/p>\n<\/div>\n\n\n\n<p class=\"italic\">A \u201cHello world\u201d program is a computer program that outputs \u201cHello, world\u201d on a display device. Because it is typically one of the simplest programs possible in most programming languages, it is by tradition often used to illustrate to beginners the most basic syntax of a programming language. ~ <a href=\"wikipedia.org\/wiki\">Wikipedia<\/a><\/p>\n\n\n\n<p>An example using the Java programming language looks like<\/p>\n\n\n\n<pre><code class=\"language-java\" data-line=\"\">\/\/ Hello World in Java \npublic class HelloWorld { \n\n  static public void main( String args[] ) { \n    System.out.println( &quot;Hello World!&quot; );\n  }\n}<\/code><\/pre>\n\n\n\n<p>Again, all this program does is output \u201cHello World\u201d to the screen.<\/p>\n\n\n\n<p>A slightly more complex programming task for the beginner would be a \u201cHello Caractacus\u201d program. The goal of this program is to output the lyrics to Rolf Harris\u2019 deeply philosophical song \u201cThe Court of King Caractacus\u201d. This task has more oomph to it because it requires the programmer to understand how the song builds upon itself.<\/p>\n\n\n\n<p>Consider the following example (again in Java).<\/p>\n\n\n\n<div class=\"code-block java-snippet\">\n  <h2>Java Class: HelloCaractacus<\/h2>\n  <pre><code class=\"language-java\" data-line=\"\">\npublic class HelloCaractacus {\n  public static final String TITLE = &quot;the court of king caracticus by rolf harris&quot;;\n\n  public static final String[] lyrics = {\n    &quot;the ladies of the harem of the court of king caractacus &quot;,\n    &quot;the noses on the faces of &quot;,\n    &quot;the boys who put the powder on &quot;,\n    &quot;the fascinating witches who put the scintillating stiches in the britches of &quot;,\n  };\n  public static final String[] BEGINNINGS = {\n    &quot;now &quot;,\n    &quot;if you want to take a picture of &quot;\n  };\n  public static final String[] ENDINGS = {\n    &quot;were just passing by.&quot;,\n    &quot;well it&#039;s too late! coz they&#039;ve just passed by!&quot;\n  };\n  public static final String[] COMMANDS = {\n    &quot;[all together]&quot;\n  };\n\n  public static void main(String[] args) {\n    jotln(TITLE);\n    \/\/ for each verse\n    for (int i = 0; i &lt; 4; i++) {\n      \/\/ repeat three times\n      for (int j = 0; j &lt; 4; j++) {\n        if (j == 1) {\n          jotln(COMMANDS[0]);\n        }\n        jot(BEGINNINGS[0]); \/\/ now\n        \/\/ join the appropriate bits together\n        for (int k = i; k &gt;= 0; k--) {\n          jot(lyrics[k]);\n        }\n        jotln(ENDINGS[0]); \/\/ were just passing by\n      }\n      jotln(&quot;&quot;); \/\/ blank line\n    }\n    \/\/ photo opportunity\n    for (int i = 0; i &lt; 2; i++) {\n      jot(BEGINNINGS[i]);\n    }\n    \/\/ the longest line\n    for (int k = 3; k &gt;= 0; k--) {\n      jot(lyrics[k]);\n    }\n    jotln(ENDINGS[1]); \/\/ you are too late\n  }\n\n  public static void jot(String s)   { System.out.print(s); }   \/\/ for\n  public static void jotln(String s) { System.out.println(s); } \/\/ brevity\n} \/\/ the court is adjourned, long live Caractacus<\/code><\/pre>\n<\/div>\n\n\n\n<p>This code snippet outputs the following&#8230;<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<pre class=\"wp-block-preformatted\">the court of king caracticus by rolf harris\nnow the ladies of the harem of the court of king caractacus were just passing by.\n(all together)\nnow the ladies of the harem of the court of king caractacus were just passing by.\nnow the ladies of the harem of the court of king caractacus were just passing by.\nnow the ladies of the harem of the court of king caractacus were just passing by.\n\nnow the noses on the faces of the ladies of the harem of the court of king caractacus were just passing by.\n(all together)\nnow the noses on the faces of the ladies of the harem of the court of king caractacus were just passing by.\nnow the noses on the faces of the ladies of the harem of the court of king caractacus were just passing by.\nnow the noses on the faces of the ladies of the harem of the court of king caractacus were just passing by.\n\nnow the boys who put the powder on the noses on the faces of the ladies of the harem of the court of king caractacus were just passing by.\n(all together)\nnow the boys who put the powder on the noses on the faces of the ladies of the harem of the court of king caractacus were just passing by.\nnow the boys who put the powder on the noses on the faces of the ladies of the harem of the court of king caractacus were just passing by.\nnow the boys who put the powder on the noses on the faces of the ladies of the harem of the court of king caractacus were just passing by.\n\nnow the fascinating witches who put the scintillating stiches in the britches of the boys who put the powder on the noses on the faces of the ladies of the harem of the court of king caractacus were just passing by.\n(all together)\nnow the fascinating witches who put the scintillating stiches in the britches of the boys who put the powder on the noses on the faces of the ladies of the harem of the court of king caractacus were just passing by.\nnow the fascinating witches who put the scintillating stiches in the britches of the boys who put the powder on the noses on the faces of the ladies of the harem of the court of king caractacus were just passing by.\nnow the fascinating witches who put the scintillating stiches in the britches of the boys who put the powder on the noses on the faces of the ladies of the harem of the court of king caractacus were just passing by.\n\nnow if you want to take a picture of the fascinating witches who put the scintillating stiches in the britches of the boys who put the powder on the noses on the faces of the ladies of the harem of the court of king caractacus well it's too late! coz they've just passed by!<\/pre>\n<\/blockquote>\n\n\n\n<p class=\"italic\">(Orignally published Thursday, February 21, 2008. Altered at whim.)<\/p>\n\n\n\n<figure class=\"wp-block-embed is-type-rich is-provider-amazon wp-block-embed-amazon\"><div class=\"wp-block-embed__wrapper\">\n<iframe loading=\"lazy\" title=\"Microservices Design Patterns with Java: 70+ patterns for designing, building, and deploying microservices (English Edition)\" type=\"text\/html\" width=\"678\" height=\"550\" frameborder=\"0\" allowfullscreen style=\"max-width:100%\" src=\"https:\/\/read.amazon.com\/kp\/card?preview=inline&#038;linkCode=ll1&#038;ref_=k4w_oembed_5AtFBAcN9bd1Uj&#038;asin=9355517009&#038;tag=genesiscom-20\"><\/iframe>\n<\/div><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>A comedic remix of Java humor and lyrical code parody \u2014 weaving beginner satire, song structure in code, and object-oriented absurdity with britches, witches, and powdered recursion. Expect verses in camelCase, rhymes in semicolons, and a chorus of \u201cpublic static void main\u201d sung by enchanted compilers. It\u2019s Shakespeare meets Stack Overflow, with a runtime of pure nonsense.<\/p>\n","protected":false},"author":1,"featured_media":1377,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"_wp_rev_ctl_limit":""},"categories":[10],"tags":[975,542,595,892,1140],"class_list":["post-649","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-code-and-commentry","tag-algorithm-absurdity","tag-code-parody","tag-lyrical-programming","tag-poetic-parody","tag-recursive-nonsense"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/handelbarweb.com\/blog\/wp-content\/uploads\/2024\/04\/java-scroll.jpg","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/handelbarweb.com\/blog\/wp-json\/wp\/v2\/posts\/649","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/handelbarweb.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/handelbarweb.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/handelbarweb.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/handelbarweb.com\/blog\/wp-json\/wp\/v2\/comments?post=649"}],"version-history":[{"count":10,"href":"https:\/\/handelbarweb.com\/blog\/wp-json\/wp\/v2\/posts\/649\/revisions"}],"predecessor-version":[{"id":2498,"href":"https:\/\/handelbarweb.com\/blog\/wp-json\/wp\/v2\/posts\/649\/revisions\/2498"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/handelbarweb.com\/blog\/wp-json\/wp\/v2\/media\/1377"}],"wp:attachment":[{"href":"https:\/\/handelbarweb.com\/blog\/wp-json\/wp\/v2\/media?parent=649"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/handelbarweb.com\/blog\/wp-json\/wp\/v2\/categories?post=649"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/handelbarweb.com\/blog\/wp-json\/wp\/v2\/tags?post=649"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}