Posts

  • How to Trigger Multiple Msgs in Elm

    In the Elm Architecture, update function is responsible for changing Model state. Depending on how you structure your Model, Msg, and update, sometimes you may want to call update function again with another Msg after calling update function. Recursively calling update is straightforward. type Msg = FirstMsg | SecondMsg update...

  • How to Organize Port Functions in Elm

    I’ve been thinking about how to organize Elm’s port functions and here’s two approaches that I’ve put together. I assume that the readers know basics of Elm, including the Elm Architecture and how ports work. I put a working Elm app example in my Github repository. If you want to...

  • How to Display Entire Text in Elm Debugger

    Elm Debugger is one of the most amazing debugging tools I’ve ever used - too bad I rarely get to use it because Elm makes it so difficult to produce serious bugs. The Debugger places a limit on the length of displayable text in it, and truncates any text or...

  • Using Korean in Spacemacs

    Using Korean in Spacemacs I’ve started trying out Emacs because I lost patience while trying to set up Haskell development environment in Vim. Some random person on the Internet suggested Spacemacs as an alternative, so I decided to give it a try. So far I’m liking it - it works...

  • Why I Find CSS So Hard

    Once I heard someone half-jokingly say that he finds CSS harder than Haskell. At the time I just laughed at the joke, but after working with CSS for some time I now understand what he meant. CSS is complex. While it has simple syntax and structure, its output depends so...

  • Thoughts on Safer Smart Contracts Through Type-Driven Development

    Introduction Last year, I learned of the Idris language and wrote a blog post after reading a book on it. Coincidentally, I joined a company that worked on blockchain technology almost immediately after publishing that post. So when I came across a paper titled “Safer smart contracts through type-driven development:...

  • A Short Guide to Function Operators in Elm (|>, <|, >>, <<)

    Summary Once we get through the introduction to Elm, we start to encounter some odd-looking operators in Elm codes. I’m talking about the ones like >>, <<, |>, and <|, which modify how functions are composed and applied. I will give more details about how and when I use them...

  • Interview With Rich Hickey by Michael Fogus

    Preface This interview with Rich Hickey, the creator of Clojure language, was conducted by Michael Fogus on CodeQuarterly. All credit should be given to him. I’m posting it here for two reasons: Preservation CodeQuarterly is gone, so I wanted to create another copy of this interesting and insightful interview to...

  • Type-Driven Development with Idris - Review

    Summary Type-Driven Development with Idris introduces a software development approach that uses types as the primary tool for building softwares. In this paradigm, types are given much more responsibilities than their traditional role of checking data validity. For example, types can be used to represent the input and output states...

  • How to Bake Pi - Review

    Summary How to Bake Pi: an Edible Exploration of the Mathematics of Mathematics explores what mathematics is about by explaining the purpose and building blocks of mathematics in an easy-to-read language, drawing examples from everyday life, including baking. I recommend it to you if you have never learned abstract mathematics...

  • Understanding Computation - Review

    Summary If you are a software developer without formal computer science background who want a friendly introduction to computer science, I highly recommend this book. This book explores some of core concepts of computer science, specifically syntax and semantics of programming languages and basic abstract machines that can execute programs....

  • Why I Chose Docker for Sandboxing

    Overview I wanted to build an Elixir application that can run Elixir code provided by users and return the results. Maintaining security is critical for an application like this, since I could be running some evil codes written by diabolical mastermind residing in the scary trench of Internet. I’ve never...

  • Preventing Race Condition When Testing Cast Requests in Elixir

    This post assumes understanding of how GenServer.cast/2 and GenServer.call/2 work. TL;DR Call a GenServer.call/2 function after GenServer.cast/2. This prevents your caller process from executing any more code until it receives a reply to the call/2 function from the receiver process. The receiver process handles and sends the reply to call/2...

  • My Brief Foray into the Land of Haskell (2)

    Nowadays many features of Haskell can be found in other languages, too. But such features often feel like an awkward addition to languages that are designed for different goals in mind. In contrast, functional programming elements are given the highest accommodation in Haskell. I think this is what makes Haskell...

  • My Brief Foray into the Land of Haskell (1)

    The Scary, Scary Land of Haskell I think few other programming languages evoked as much trepidation in me as did Haskell. After all, it is a language known for being arcane and unusual. Still, everyone said that learning Haskell would dramatically broaden my understanding of programming, so I’ve been eyeing...

  • How to Find Full Function Name in Elixir

    Sometimes you want to know the full name of an imported function, including the name of the module it is defined in. Capture the function name with & and pass it to IO.inspect/1 to reveal its full name. Another way is to rummage through __ENV__.functions/0 which lists all the modules...

  • How to Display Plug Errors

    This post is aimed at those who are just starting to use Plug, a great web middleware for Elixir language. TL;DR If you want to access various error messages from Plug that do not show up in Logger, Plug.Debugger will make those failed requests appear. Check out Plug.Debugger. 404 Error...

  • What Makes Pattern Matching in Elixir So Nice?

    Many people pick pattern matching as one of the nicest features of Elixir. But it’s hard to explain why or how it is nice - it’s something experiential that arises from the combination of pattern matching and other characteristics of Elixir. In this post I will present a few examples...

  • My Favorite Ruby Rogues Episodes - Career and Organizational Management

    Previous post was about episodes that discuss how to grow as an individual developer. This post is about episodes that discuss career management and organizational management. This is the last post. I’ve mostly left out episodes about specific Ruby techniques and tools, and episodes about developer communities or social responsibilities...

  • My Favorite Ruby Rogues Episodes - Personal Growth

    The previous post was about book club episodes. This post is about episodes that discuss methods and perspectives that can help you grow as an individual developer. Becoming a Better Developer 009 RR What Makes Beautiful Code A discussion of what the panelists consider to be beautiful code. Very subjective...

  • My Favorite Ruby Rogues Episodes - Book Club Series

    As I taught myself to program, Ruby Rogues podcast has been invaluably helpful to me. Books and blog posts could teach me specific technological knowledge, but they couldn’t provide me a broader perspective about programming. Ruby Rogues podcast filled that gap. Charles Max Wood, the host of the show, and...

  • How to Create Minimal Elixir Web App With Plug and Cowboy and Deploy to Heroku

    This post will go through how to create a minimal web application in Elixir just using Cowboy, an HTTP server for Erlang/OTP, and Plug, a composable web middleware for Elixir, and deploy it to Heroku. Since you are knowledgeable enough to know about and look for a barebone approach, I...

  • Quora Q&A Session With David Heinemeier Hansson (Jan 25, 2017)

    This is a copy of a Q&A session with David Heinemeier Hansson hosted by Quora on January 25, 2017. Here is the link to the original Quora site. All questions are posted by Quora users and answered by DHH. What makes Rails a framework worth learning in 2017? The same...

  • Why I Think I Am Still a Junior Developer

    Programming is not an easy skill to learn. This is evidently clear when you try to teach absolute beginners how to program. It requires a tremendous amount of underlying knowledge and training just to get them started with it. More advanced topics such as algorithmic analysis, hardware specific optimization, or...

  • Various Quicksort Implementations in Elixir

    Elixir has built-in sort functions Enum.sort/1 and Enum.sort/2. For list type, it calls Erlang :lists.sort/1 and :lists.sort/2 that use merge sort algorithm. For other Elixir types that implement Enumerable protocol, Elixir implements its own merge sort. Here’s the link to the source code. Since Elixir list is implemented as singly...

  • How to Enable Tail Call Optimization in Ruby

    This post assumes basic understanding of recursion and Ruby. What is tail call optimization Tail call optimization (TCO) is an optimization strategy for tail-recursive procedures. It is useful in preventing stack overflow when using recursion because it limits the call stack size of a recursive procedure to one. How TCO...

  • Basics of Ruby Method Dispatch System (Part 2)

    In this post, I will explain the basics of how a method call works in Ruby. I’ll assume that readers have some familiarity with Ruby language. The post is in two parts. The first part covers what you need to know about typical Ruby program. It covers: ancestors hierarchy, class...

  • Basics of Ruby Method Dispatch System (Part 1)

    In this post, I will explain the basics of how a method call works in Ruby. I’ll assume that readers have some familiarity with Ruby language. The post is in two parts. The first part covers what you need to know about typical Ruby program. It covers: ancestors hierarchy, class...

  • Common Misconceptions of Beginners About Type System

    One of the best tips I got about writing a blog post is to write posts that I would have wanted to read a year ago. This is one of them. I hope this would clarify misconceptions commonly held by beginners about type system. Why do we need a type?...

  • Elixir as First Programming Language (Part 2)

    This post is adapted from my talk at Seoul Elixir Meetup on November 16, 2016. Elixir might not be the first language that comes to your mind when you think about which programming language to teach to beginners. Languages like Python, Ruby, JavaScript, C/C++, or Java are more popular choices....

  • Elixir as First Programming Language (Part 1)

    This post is adapted from my talk at Seoul Elixir Meetup on November 16, 2016. Elixir might not be the first language that comes to your mind when you think about which programming language to teach to beginners. Languages like Python, Ruby, JavaScript, C/C++, or Java are more popular choices....

  • How to XOR Bitstrings in Elixir

    tl;dr Use :crypto.exor/2 from crypto module in Erlang standard library. Chronicle of My Decent into Rabbit Hole It started with a simple quiz from Cryptography course in Coursera. I was given a plain text (pt) and a cipher text (ct) encrypted with one-time pad, so I just had to do...

  • Thank You, Ruby Rogues

    So I’ve finally caught up with all the old Ruby Rogues episodes. At this point there are 283 episodes in total, each about an hour long. I started listening to the podcast around the beginning of 2016, so that means I listened to at least an hour of Ruby Rogues...

  • Educational Potential of Languages and Frameworks

    Just like most of new Ruby on Rails developers, I ended up creating a Lovecraftian nightmare of huge tangled models in my first project. It’d have been nice to have an experienced developer to prevent me from making that mess. Unfortunately, I didn’t have one. I had to figure a...

  • What Is JSON Web Token (JWT)?

    I needed an authentication system for my application, so I looked at the existing libraries for Elixir and found some promising ones, such as ueberauth, guardian, and openmaize. I started to look into how they did things, then I came across a discussion about JWT in authentication. Now then what...

  • List of Outdated Example Code in Programming Phoenix

    If you follow the code examples in Programming Phoenix book now, there are several broken ones that will cause error, fail to pass test, or show deprecation warning. I documented such codes from the book and how to resolve them. Those codes break because your installed Phoenix version and the...

  • Using Emmet to Type <%= %> in erb or eex

    Emmet is a lifesaver. Writing HTML used to be so painful and annoying that I had to groan at every single closing tag. Now I don’t have to do that. If you write HTML documents but still do not use Emmet, you should definitely try it. It supports pretty much...

  • How to Think About Technology Stack as a Head of Company

    Recently I had a chance to meet and talk with several aspiring entrepreneurs. They all had different business ideas but our conversations eventually converged on one common problem they had: they didn’t have enough knowledge to make an informed decision on which technology to use to build software, and were...

  • Manage Dotfiles With a Bare Git Repository

    After switching from Sublime Text to vim, I started looking for a way to manage my dotfiles. It took me a lot of work to configure and understand them, so I wanted to back them up against emergency. And of course I wanted to have those personal settings wherever I...

  • Sandi Metz's Advices for Better Code

    I’ve recently finished reading the Practical Object-Oriented Design in Ruby by Sandi Metz. I heard a lot of good things about the book and it was definitely worth reading - I highly recommend it too! I’ve also listened to Ruby Rogues podcast episode 87 where the panelists discusses the book...

  • Code like you write

    “Write” is the verb we use with programming. We write software. We write codes. Of course, we use other verbs too. We also build and design software. But write is the one we use most frequently. Is there some kind of philosophical meaning behind this usage? I doubt it. But...

  • Why are you learning computer science?

    Are you currently majoring in computer science, or planning to do so? What do you hope to learn from the curriculum? If your answer is something in line with “writing a useful software” or “getting a job as a software developer,” this post is for you. I want you to...

subscribe via RSS