From fc23a7c91343636d2c26cbf29bfe6d96798d64c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A1s=20N=C3=A9meth?= Date: Tue, 20 Dec 2022 16:12:29 +0100 Subject: [PATCH] Fix typos --- _posts/2017-01-31-world-changed.md | 2 +- _posts/2021-12-14-functional-programming-is-a-lie.md | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/_posts/2017-01-31-world-changed.md b/_posts/2017-01-31-world-changed.md index 48700ec79544..eed43a13b6b3 100644 --- a/_posts/2017-01-31-world-changed.md +++ b/_posts/2017-01-31-world-changed.md @@ -52,7 +52,7 @@ Moving to Erlang. What if we just took away the guns: no threads, no mutability. I have to agree I was in the same mind-set about 18 months ago. But I was wrong, and I (happily) admit it. I've been programming for a long time, and I felt like I was blindsided, why didn't I hear about this before? Because I had mistakenly assumed the world was the same - it is not. What happened: Moore's law ends, lots of memory, speed, concurrency everywhere. Simple networked services that run reliably for long periods - sound familiar? -Languages like Haskell don't even know what we're talking about. Haskell takes one step further than Erlang and says not only is the language immutable, the functions are really mathematical functions. That means if you pass f(1) into a function f and it returns 42, then it should always return 42 given the input of 1. Erlang thinks this is going to far. To an Erlang programmer Haskell is an impractical language. How can you make a function to get the current time? +Languages like Haskell don't even know what we're talking about. Haskell takes one step further than Erlang and says not only is the language immutable, the functions are really mathematical functions. That means if you pass f(1) into a function f and it returns 42, then it should always return 42 given the input of 1. Erlang thinks this is going too far. To an Erlang programmer Haskell is an impractical language. How can you make a function to get the current time? ## So, what happened? diff --git a/_posts/2021-12-14-functional-programming-is-a-lie.md b/_posts/2021-12-14-functional-programming-is-a-lie.md index 5c0309d96eeb..469cda5b6ffe 100644 --- a/_posts/2021-12-14-functional-programming-is-a-lie.md +++ b/_posts/2021-12-14-functional-programming-is-a-lie.md @@ -23,13 +23,13 @@ In the early days of computer science, a lot of work was done to try to use math There's no exact definition of fuctionally pure purity, but generally it's these things: * Immutable state / data, * No side-effects -* First class functions (functions can treated as data) +* First class functions (functions can be treated as data) * etc. Javascript is a functional language. Why isn't it a *pure* functional language? -* Javascript fails purity because it allows for mutation of state and side effects - most mainstream language fail for this same reason: Java, Go, C#, Rust, Python, Ruby, etc. -* Rust fails pureity because it has unsafe modes and allow side effects +* Javascript fails purity because it allows for mutation of state and side effects - most mainstream languages fail for this same reason: Java, Go, C#, Rust, Python, Ruby, etc. +* Rust fails purity because it has unsafe modes and allows side effects * Erlang and Elixir fail this test because they allow side effects What is immutable data and what is a side effect? @@ -105,7 +105,7 @@ Here's what the list of functional languages should look like: I can hear a thousand developer's voices calling out that: Yes, but Rust, Clojure, etc., have immutable data constructs and that if you just keep your mutations under control and in a box then you're ok. -Reflected by this statement: "Mutation is a reality, the correct approach is disciplined mutation. "https://news.ycombinator.com/item?id=18044656 +Reflected by this statement: "Mutation is a reality, the correct approach is disciplined mutation." https://news.ycombinator.com/item?id=18044656 Maybe this discussion is for another blog, but the reason unsafe modes and mutation exists in these languages is because developers use them - and often use them incorrectly - there are studies that show vulnerabilities due to memory violations are not that uncommon: https://cseweb.ucsd.edu/~yiying/RustStudy-PLDI20.pdf