{"id":20685,"date":"2023-02-07T02:17:03","date_gmt":"2023-02-07T02:17:03","guid":{"rendered":"https:\/\/www.booksofall.com\/cn\/?post_type=product&#038;p=20685"},"modified":"2023-02-07T02:17:04","modified_gmt":"2023-02-07T02:17:04","slug":"stuff-goes-bad-erlang-in-anger","status":"publish","type":"product","link":"https:\/\/www.booksofall.com\/cn\/stuff-goes-bad-erlang-in-anger\/","title":{"rendered":"Stuff Goes Bad: Erlang in Anger"},"content":{"rendered":"<p>There\u2019s something rather unique in <a href=\"https:\/\/www.erlang.org\/\">Erlang<\/a> in how it approaches failure compared to most other <a href=\"https:\/\/en.wikipedia.org\/wiki\/List_of_programming_languages\">programming languages<\/a>. There\u2019s this common way of thinking where the language, programming environment, and methodology do everything possible to prevent errors. Something going wrong at run-time is something that needs to be prevented, and if it cannot be prevented, then it\u2019s out of scope for whatever solution people have been thinking about.<\/p>\n<p>The program is written once, and after that, it\u2019s off to production, whatever may happen there. If there are errors, new versions will need to be shipped.<\/p>\n<p>Erlang, on the other hand, takes the approach that failures will happen no matter what, whether they\u2019re developer-, operator-, or hardware-related. It is rarely practical or even possible to get rid of all errors in a program or a system. If you can deal with some errors rather than preventing them at all cost, then most undefined behaviours of a program can go in that &#8220;deal with it&#8221; approach. This is where the &#8220;Let it Crash&#8221; idea comes from: Because you can now deal with failure, and because the cost of weeding out all of the complex bugs from a system before it hits production is often prohibitive, programmers should only deal with the errors they know how to handle, and leave the rest for another process (a supervisor) or the virtual machine to deal with.<\/p>\n<p>Given that most bugs are transient, simply restarting processes back to a state known to be stable when encountering an error can be a surprisingly good strategy.<\/p>\n<p>Erlang is a <a href=\"https:\/\/homepage.divms.uiowa.edu\/~jones\/syssoft\/notes\/01intro.html#:~:text=Programming%20Environments,environment%20used%20by%20the%20programmer.\">programming environment<\/a> where the approach taken is equivalent to the human body\u2019s immune system, whereas most other languages only care about hygiene to make sure no germ enters the body. Both forms appear extremely important to me. Almost every environment offers varying degrees of hygiene. Nearly no other environment offers the immune system where errors at run time can be dealt with and seen as survivable.<\/p>\n<p>Because the system doesn\u2019t collapse the first time something bad touches it, Erlang\/<a href=\"https:\/\/en.wikipedia.org\/wiki\/Open_Telecom_Platform#:~:text=OTP%20is%20a%20collection%20of,Erlang%2FOTP%20as%20open%20source.\">OTP<\/a> also allows you to be a doctor. You can go in the system, pry it open right there in production, carefully observe everything inside as it runs, and even try to fix it interactively. To continue with the analogy, Erlang allows you to perform extensive tests to diagnose the problem and various degrees of surgery (even very <a href=\"https:\/\/www.cancer.gov\/publications\/dictionaries\/cancer-terms\/def\/invasive-procedure#:~:text=(in%2DVAY%2Dsiv%20proh,inserting%20instruments%20into%20the%20body.\">invasive surgery<\/a>), without the patients needing to sit down or interrupt their daily activities.<\/p>\n<p>This book intends to be a little guide about how to be the Erlang medic in a time of war. It is first and foremost a collection of tips and tricks to help understand where failures come from, and a dictionary of different code snippets and practices that helped developers debug production systems that were built in Erlang.<\/p>\n","protected":false},"excerpt":{"rendered":"<p><iframe frameborder=\"0\" allowtransparency=\"true\" allowFullscreen=\"true\" style=\"width: 100%; height: 700px; border: none;\" src=\"https:\/\/online.visual-paradigm.com\/share\/book\/erlang-in-anger-18zjb49la?enforceShowPromotionBar=true&#038;p=1\"><\/iframe><\/p>\n","protected":false},"featured_media":20689,"template":"","meta":{"_yoast_wpseo_title":"","_yoast_wpseo_metadesc":""},"product_brand":[],"product_cat":[311],"product_tag":[],"class_list":{"0":"post-20685","1":"product","2":"type-product","3":"status-publish","4":"has-post-thumbnail","6":"product_cat-erlang","8":"first","9":"instock","10":"shipping-taxable","11":"product-type-simple"},"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.1.1 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Stuff Goes Bad: Erlang in Anger - BooksOfAll Simplified Chinese<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.booksofall.com\/cn\/stuff-goes-bad-erlang-in-anger\/\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Stuff Goes Bad: Erlang in Anger - BooksOfAll Simplified Chinese\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.booksofall.com\/cn\/stuff-goes-bad-erlang-in-anger\/\" \/>\n<meta property=\"og:site_name\" content=\"BooksOfAll Simplified Chinese\" \/>\n<meta property=\"article:modified_time\" content=\"2023-02-07T02:17:04+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.booksofall.com\/cn\/wp-content\/uploads\/sites\/2\/2023\/02\/img_63e1b22163042.png\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:image\" content=\"https:\/\/www.booksofall.com\/cn\/wp-content\/uploads\/sites\/2\/2023\/02\/img_63e1b22163042.png\" \/>\n<meta name=\"twitter:label1\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data1\" content=\"2 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.booksofall.com\/cn\/stuff-goes-bad-erlang-in-anger\/\",\"url\":\"https:\/\/www.booksofall.com\/cn\/stuff-goes-bad-erlang-in-anger\/\",\"name\":\"Stuff Goes Bad: Erlang in Anger - BooksOfAll Simplified Chinese\",\"isPartOf\":{\"@id\":\"https:\/\/www.booksofall.com\/cn\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.booksofall.com\/cn\/stuff-goes-bad-erlang-in-anger\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.booksofall.com\/cn\/stuff-goes-bad-erlang-in-anger\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.booksofall.com\/cn\/wp-content\/uploads\/sites\/2\/2023\/02\/img_63e1b22163042.png\",\"datePublished\":\"2023-02-07T02:17:03+00:00\",\"dateModified\":\"2023-02-07T02:17:04+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/www.booksofall.com\/cn\/stuff-goes-bad-erlang-in-anger\/#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.booksofall.com\/cn\/stuff-goes-bad-erlang-in-anger\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.booksofall.com\/cn\/stuff-goes-bad-erlang-in-anger\/#primaryimage\",\"url\":\"https:\/\/www.booksofall.com\/cn\/wp-content\/uploads\/sites\/2\/2023\/02\/img_63e1b22163042.png\",\"contentUrl\":\"https:\/\/www.booksofall.com\/cn\/wp-content\/uploads\/sites\/2\/2023\/02\/img_63e1b22163042.png\",\"width\":\"537\",\"height\":\"733\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.booksofall.com\/cn\/stuff-goes-bad-erlang-in-anger\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.booksofall.com\/cn\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Categories\",\"item\":\"https:\/\/www.booksofall.com\/cn\/categories\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Stuff Goes Bad: Erlang in Anger\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.booksofall.com\/cn\/#website\",\"url\":\"https:\/\/www.booksofall.com\/cn\/\",\"name\":\"BooksOfAll Simplified Chinese\",\"description\":\"Biggest IT eBooks library and learning resources - Free eBooks for programming, computing, artificial intelligence and more.\",\"publisher\":{\"@id\":\"https:\/\/www.booksofall.com\/cn\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.booksofall.com\/cn\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.booksofall.com\/cn\/#organization\",\"name\":\"BooksOfAll Simplified Chinese\",\"url\":\"https:\/\/www.booksofall.com\/cn\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.booksofall.com\/cn\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.booksofall.com\/cn\/wp-content\/uploads\/sites\/2\/2022\/06\/booksofall-logo-2.png\",\"contentUrl\":\"https:\/\/www.booksofall.com\/cn\/wp-content\/uploads\/sites\/2\/2022\/06\/booksofall-logo-2.png\",\"width\":166,\"height\":30,\"caption\":\"BooksOfAll Simplified Chinese\"},\"image\":{\"@id\":\"https:\/\/www.booksofall.com\/cn\/#\/schema\/logo\/image\/\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Stuff Goes Bad: Erlang in Anger - BooksOfAll Simplified Chinese","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.booksofall.com\/cn\/stuff-goes-bad-erlang-in-anger\/","og_locale":"zh_CN","og_type":"article","og_title":"Stuff Goes Bad: Erlang in Anger - BooksOfAll Simplified Chinese","og_url":"https:\/\/www.booksofall.com\/cn\/stuff-goes-bad-erlang-in-anger\/","og_site_name":"BooksOfAll Simplified Chinese","article_modified_time":"2023-02-07T02:17:04+00:00","og_image":[{"url":"https:\/\/www.booksofall.com\/cn\/wp-content\/uploads\/sites\/2\/2023\/02\/img_63e1b22163042.png","type":"","width":"","height":""}],"twitter_card":"summary_large_image","twitter_image":"https:\/\/www.booksofall.com\/cn\/wp-content\/uploads\/sites\/2\/2023\/02\/img_63e1b22163042.png","twitter_misc":{"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"2 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.booksofall.com\/cn\/stuff-goes-bad-erlang-in-anger\/","url":"https:\/\/www.booksofall.com\/cn\/stuff-goes-bad-erlang-in-anger\/","name":"Stuff Goes Bad: Erlang in Anger - BooksOfAll Simplified Chinese","isPartOf":{"@id":"https:\/\/www.booksofall.com\/cn\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.booksofall.com\/cn\/stuff-goes-bad-erlang-in-anger\/#primaryimage"},"image":{"@id":"https:\/\/www.booksofall.com\/cn\/stuff-goes-bad-erlang-in-anger\/#primaryimage"},"thumbnailUrl":"https:\/\/www.booksofall.com\/cn\/wp-content\/uploads\/sites\/2\/2023\/02\/img_63e1b22163042.png","datePublished":"2023-02-07T02:17:03+00:00","dateModified":"2023-02-07T02:17:04+00:00","breadcrumb":{"@id":"https:\/\/www.booksofall.com\/cn\/stuff-goes-bad-erlang-in-anger\/#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.booksofall.com\/cn\/stuff-goes-bad-erlang-in-anger\/"]}]},{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.booksofall.com\/cn\/stuff-goes-bad-erlang-in-anger\/#primaryimage","url":"https:\/\/www.booksofall.com\/cn\/wp-content\/uploads\/sites\/2\/2023\/02\/img_63e1b22163042.png","contentUrl":"https:\/\/www.booksofall.com\/cn\/wp-content\/uploads\/sites\/2\/2023\/02\/img_63e1b22163042.png","width":"537","height":"733"},{"@type":"BreadcrumbList","@id":"https:\/\/www.booksofall.com\/cn\/stuff-goes-bad-erlang-in-anger\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.booksofall.com\/cn\/"},{"@type":"ListItem","position":2,"name":"Categories","item":"https:\/\/www.booksofall.com\/cn\/categories\/"},{"@type":"ListItem","position":3,"name":"Stuff Goes Bad: Erlang in Anger"}]},{"@type":"WebSite","@id":"https:\/\/www.booksofall.com\/cn\/#website","url":"https:\/\/www.booksofall.com\/cn\/","name":"BooksOfAll Simplified Chinese","description":"Biggest IT eBooks library and learning resources - Free eBooks for programming, computing, artificial intelligence and more.","publisher":{"@id":"https:\/\/www.booksofall.com\/cn\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.booksofall.com\/cn\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"zh-Hans"},{"@type":"Organization","@id":"https:\/\/www.booksofall.com\/cn\/#organization","name":"BooksOfAll Simplified Chinese","url":"https:\/\/www.booksofall.com\/cn\/","logo":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.booksofall.com\/cn\/#\/schema\/logo\/image\/","url":"https:\/\/www.booksofall.com\/cn\/wp-content\/uploads\/sites\/2\/2022\/06\/booksofall-logo-2.png","contentUrl":"https:\/\/www.booksofall.com\/cn\/wp-content\/uploads\/sites\/2\/2022\/06\/booksofall-logo-2.png","width":166,"height":30,"caption":"BooksOfAll Simplified Chinese"},"image":{"@id":"https:\/\/www.booksofall.com\/cn\/#\/schema\/logo\/image\/"}}]}},"_links":{"self":[{"href":"https:\/\/www.booksofall.com\/cn\/wp-json\/wp\/v2\/product\/20685","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.booksofall.com\/cn\/wp-json\/wp\/v2\/product"}],"about":[{"href":"https:\/\/www.booksofall.com\/cn\/wp-json\/wp\/v2\/types\/product"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.booksofall.com\/cn\/wp-json\/wp\/v2\/media\/20689"}],"wp:attachment":[{"href":"https:\/\/www.booksofall.com\/cn\/wp-json\/wp\/v2\/media?parent=20685"}],"wp:term":[{"taxonomy":"product_brand","embeddable":true,"href":"https:\/\/www.booksofall.com\/cn\/wp-json\/wp\/v2\/product_brand?post=20685"},{"taxonomy":"product_cat","embeddable":true,"href":"https:\/\/www.booksofall.com\/cn\/wp-json\/wp\/v2\/product_cat?post=20685"},{"taxonomy":"product_tag","embeddable":true,"href":"https:\/\/www.booksofall.com\/cn\/wp-json\/wp\/v2\/product_tag?post=20685"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}