{"id":26722,"date":"2016-10-11T11:07:31","date_gmt":"2016-10-11T09:07:31","guid":{"rendered":"https:\/\/mamchenkov.net\/wordpress\/?p=26722"},"modified":"2016-10-11T11:07:31","modified_gmt":"2016-10-11T09:07:31","slug":"the-curious-case-of-the-switch-statement","status":"publish","type":"post","link":"https:\/\/mamchenkov.net\/wordpress\/2016\/10\/11\/the-curious-case-of-the-switch-statement\/","title":{"rendered":"The curious case of the switch statement"},"content":{"rendered":"<!-- google_ad_section_start -->\n<p>&#8220;<a href=\"https:\/\/eev.ee\/blog\/2016\/09\/18\/the-curious-case-of-the-switch-statement\/\">The curious case of the switch statement<\/a>&#8221;\u00a0is a nice historical perspective on the switch statement in most modern programming languages, where it come from, and how it transformed over the years. \u00a0It starts of with ALGOL 58 (yes, a programming language from 1958), and traces the history down to the modern reincarnation of the statement to BCPL (1967!), where it looked like this:<\/p>\n<pre class=\"brush: plain; light: true; title: ; notranslate\" title=\"\">\r\nswitchon EXPR into {\r\n    ...\r\n    ...\r\n    case CONST:\r\n    ...\r\n    ...\r\n    default:\r\n    ...\r\n    ...\r\n}\r\n<\/pre>\n<p>Apart from the historical perspective, there is an interesting discussion about how different languages approached the statement, how it varies, and what are some of the benefits of each implementation.<\/p>\n<!-- google_ad_section_end -->\n","protected":false},"excerpt":{"rendered":"<!-- google_ad_section_start -->\n<p>&#8220;The curious case of the switch statement&#8221;\u00a0is a nice historical perspective on the switch statement in most modern programming languages, where it come from, and how it transformed over the years. \u00a0It starts of with ALGOL 58 (yes, a programming language from 1958), and traces the history down to the modern reincarnation of the statement &hellip; <a href=\"https:\/\/mamchenkov.net\/wordpress\/2016\/10\/11\/the-curious-case-of-the-switch-statement\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">The curious case of the switch statement<\/span><\/a><\/p>\n<!-- google_ad_section_end -->\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"The curious case of the switch statement #technology #programming #history","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},"_links_to":"","_links_to_target":""},"categories":[1,18,62],"tags":[286],"keyring_services":[],"class_list":["post-26722","post","type-post","status-publish","format-standard","hentry","category-general","category-programming","category-technology","tag-history"],"aioseo_notices":[],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack-related-posts":[{"id":10322,"url":"https:\/\/mamchenkov.net\/wordpress\/2006\/08\/14\/can-your-programming-language-do-this\/","url_meta":{"origin":26722,"position":0},"title":"Can your programming language do this?","author":"Leonid Mamchenkov","date":"August 14, 2006","format":false,"excerpt":"Can Your Programming Language Do This? post by Joel Spolsky can give you some insight on why people use different programming languages, as well as provide you with some doubts on wheathere are you using the proper tool. ...programming languages with first-class functions let you find more opportunities for abstraction,\u2026","rel":"","context":"In &quot;All&quot;","block_context":{"text":"All","link":"https:\/\/mamchenkov.net\/wordpress\/category\/general\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":11298,"url":"https:\/\/mamchenkov.net\/wordpress\/2008\/06\/07\/programming-language-barrier\/","url_meta":{"origin":26722,"position":1},"title":"Programming language barrier","author":"Leonid Mamchenkov","date":"June 7, 2008","format":false,"excerpt":"One of the frequent things that I hear about programmers is that it doesn't matter which language the person is using and which language you need him to use, because if he is any good he'll learn and catch up pretty fast.\u00a0 In other words, if you take a decent\u2026","rel":"","context":"In &quot;All&quot;","block_context":{"text":"All","link":"https:\/\/mamchenkov.net\/wordpress\/category\/general\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":26107,"url":"https:\/\/mamchenkov.net\/wordpress\/2016\/05\/15\/programming-and-greek\/","url_meta":{"origin":26722,"position":2},"title":"Programming and Greek","author":"Leonid Mamchenkov","date":"May 15, 2016","format":false,"excerpt":"One thought that cracks me up every now and then is about Greek programmers. \u00a0In Greek language, instead of a question mark a semicolon is used. In many programming languages, a semicolon is used to represent the end of statement. \u00a0So, this: [code light=\"true\"] $a = $b + $c; print\u2026","rel":"","context":"In &quot;All&quot;","block_context":{"text":"All","link":"https:\/\/mamchenkov.net\/wordpress\/category\/general\/"},"img":{"alt_text":"Greek","src":"https:\/\/i0.wp.com\/mamchenkov.net\/wordpress\/wp-content\/uploads\/2016\/05\/greek-500x176.png?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":23090,"url":"https:\/\/mamchenkov.net\/wordpress\/2014\/12\/04\/quine-relay-an-uroboros-program-with-80-programming-languages\/","url_meta":{"origin":26722,"position":3},"title":"quine-relay &#8211; an uroboros program with 80+ programming languages","author":"Leonid Mamchenkov","date":"December 4, 2014","format":false,"excerpt":"quine-relay - an uroboros program with 80+ programming languages. If you didn't get it, here's a better description: This is a Ruby program that generates Scala program that generates Scheme program that generates ...(through 80 languages in total)... REXX program that generates the original Ruby code again. Insanity at\u00a0its best!\u2026","rel":"","context":"In &quot;All&quot;","block_context":{"text":"All","link":"https:\/\/mamchenkov.net\/wordpress\/category\/general\/"},"img":{"alt_text":"quine relay","src":"https:\/\/i0.wp.com\/mamchenkov.net\/wordpress\/wp-content\/uploads\/2014\/12\/quine-relay-500x500.png?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":7595,"url":"https:\/\/mamchenkov.net\/wordpress\/2004\/06\/22\/computer-languages-history\/","url_meta":{"origin":26722,"position":4},"title":"Computer Languages History","author":"Leonid Mamchenkov","date":"June 22, 2004","format":false,"excerpt":"\"Computer Languages History\" is in excellent website devoted to...well...history of computer programming languages. Currently, it lists about 50 programming languages with links to language websites. There is also an excellent timeline, which shows the relationships between different programming languages starting with Fortran in November 1954 and ending with PHP of\u2026","rel":"","context":"In &quot;All&quot;","block_context":{"text":"All","link":"https:\/\/mamchenkov.net\/wordpress\/category\/general\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":24905,"url":"https:\/\/mamchenkov.net\/wordpress\/2015\/10\/29\/27-languages-to-improve-your-python\/","url_meta":{"origin":26722,"position":5},"title":"27 languages to improve your Python","author":"Leonid Mamchenkov","date":"October 29, 2015","format":false,"excerpt":"Nick Coghlan writes: One of the things we do as part of the Python core development process is to look at features we appreciate having available in other languages we have experience with, and see whether or not there is a way to adapt them to be useful in making\u2026","rel":"","context":"In &quot;All&quot;","block_context":{"text":"All","link":"https:\/\/mamchenkov.net\/wordpress\/category\/general\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"jetpack_sharing_enabled":true,"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/posts\/26722","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/comments?post=26722"}],"version-history":[{"count":0,"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/posts\/26722\/revisions"}],"wp:attachment":[{"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/media?parent=26722"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/categories?post=26722"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/tags?post=26722"},{"taxonomy":"keyring_services","embeddable":true,"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/keyring_services?post=26722"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}