We’ve been making the transition from Java to Go and React at the company I work for. Over the last year or so most of our new web applications consist of a Go backend and React front end. This has been a pleasant experience for the most part, but there’s a lot to learn so I decided to write a bunch of Go programs on the side to explore the language.
I store snippets of code with Github Gists to remind myself how to do things that I don’t do regularly enough to remember off hand. At first it was only a few, but my list is growing and as it grows it becomes harder to find the one I want. I’ve made myself a little Firefox extension to list all my Gists with a search field so I can quickly locate them.
There’s a task I perform regularly and it’s always a 2 step process. One of the programs I maintain queries the database and the SQL is a long series of concatenated strings in a Java source file. I copy the query into a text editor and then remove all the quotes and plus characters so I can modify and test it on the database. Ideally SQL would be kept in an SQL file and it would be easier to work with, but in this case I don’t have the liberty of making that modification.
Today I was given a task to extract customer account IDs from a log file. grep came to the rescue, however I was then required to add a fixed offset to each account ID so I could build an SQL query with an IN clause. I could have managed this by piping the output of grep to awk or bc, but I thought I would flex my vim muscle in this case.
I’ve started using Microsoft’s new Visual Studio Code text editor at work and it’s pretty neat. I like it more than the Brackets editor that I was using before. It’s similar, but more polished and has some excellent features like an integrated terminal and a debugger. As you might expect there is a comprehensive extension repository but once again there was no syntax highlighter for Asterisk dialplan code so I took it upon myself to fill the void and wrote one.
It’s time for some more Haskell. I’m going to work through chapter 2 of Exercises for Programmers: 57 Challenges to Develop Your Coding Skills and see what happens.
Saying Hello Create a program that prompts for your name and prints a greeting using your name.
Constraints: Keep the input, string concatenation, and output separate.
import System.IO main = do hSetBuffering stdout NoBuffering hSetBuffering stdin NoBuffering putStr ("What is your name?
I’ve been reading about functional programming lately, and I want to learn a new language to try it out properly. I picked Haskell for a few reasons. First, it’s touted as a pure functional language, and that appeals to me because I want to learn functional programming in particular, and not have the concepts blurred by a hybrid language. Second, there’s a lot of good online resources that I can learn from.