background

Martin Utama

SE - Fukuoka, Japan

Hi. I'm Martin. Welcome to my portfolio page.

I'm a software engineer experienced in mobile, web, server, and cloud development. I code in many languages from Java, Javascript, Dart, etc. Right now though my favorite language is Scala. I think functional programming is a very exciting paradigm so please read about why you need it below.

Contact me

Why do you need Functional Programming (FP)?

Fewer bugs

Whichever the language the most dangerous source of bugs is mutable states. These are class or object variables which are altered by some methods. So what's the problem here ? The problem is even if they pass local tests we cannot know if they behave correctly during runtime, especially if the runtime is multi-threaded. As a result such software is very difficult, and expensive, to debug. And unfortunately states are very common in imperative and object oriented languages. On the other hand the foundation of FP is pure functions. They do not alter states or produce side-effects. So the result is predictable. We can be sure what we have during local tests is reflected during runtime.

Scalability

These days anyone can complete a software project quickly. But usually after the first version the speed gets slower and slower with more modifications and features. Why does this happen ? Because developers need to dig deep into the codes to make the change, and to make sure it does not break other things. In FP functions can be arranged like Lego blocks; we can easily extend or replace them. As a result the complexity of the development would remain constant even if the software itself is not.

Suitable for Big Data

In today's world data is central to any application. It's also presenting us with new issues: storing, transferring, transforming which cannot be solved easily due to the data size. Here are a couple scenarios where FP is useful to tackle memory and recovery problems.


image

Memory efficiency

Typical computers have only 16GB of RAM, what if we need to load 1000GB of data ? Spawn more instances and break up the data ? This is costly and will create management headache.

The better alternative is to stream it. With stream we read the source up until it fills up a buffer, process it, send it to sink as final result before discarding it. The video here demonstrates functional Java Vavr to load a very large file. In the first part with the old approach, all available memory is quickly  consumed and the program crashes. In the second, memory consumption is kept under control so we can use a cheap small machine to process very large data.

image

Process recovery

Imagine doing a thousand database queries and a failure occurs. Usually the only thing to do is re-run the program from the start, wasting a lot of time. 

The good news is modern functional stream has already implemented the capabilities to save it. The video here shows a recovery simulation. For each element that encounters an error it will retry at most three times or it will give up and proceed to the next element (source code). Using functional approach we can easily define many such strategies that would help recover such a process, even if it's asynchronous.

Portfolio

image

Blue-collar job market app

An app to showcase skills and qualifications of trade workers. We are experimenting with several choices for backend: traditional Scala server, Java native image built by Graal/Substrate VM, and Scala.js which is basically Javascript with Scala syntax. The mobile app is written in Flutter.

image

Market-making bots

Market making is a trading technique that places buy and sell orders continuously and profits from bid-offer spread. Automating the trades is the job for bot.

These bots were developed to trade cryptocurrencies, one to operate on Ripple network and one on centralized exchanges such as HitBTC and Okex. 
The video here illustrates the bot's balance during the operation on Ripple network . It starts from seeding and moves on to countering and replacing consumed offers.

image

Item discovery app

The app searches for a product or service in an area. By typing a keyword user can see stores nearby that sell related products. In Asian countries, traffic in urban areas and cities are usually bad. The app would help users discover a product or alternative products without travelling too far.

The app integrates Android client, backend service, and various cloud components. Behind the scene the system makes good use of relational database and the  new MySql spatial feature that allows query by coordinates

image

Farm yield predictor

In Japan most farmers use a greenhouse to cultivate vegetables and fruits. This allows some crops like tomato to be planted irrespective of season. The predictor helps estimate demands and market price using past data for optimum profit.

This project was selected as a winner by IBM incubation program and finally acquired by Softbank. (press release by Japan Ministry of Agriculture, in Japanese)

image

Smarthome system

An Android app to manipulate home appliances as well as monitoring the surroundings remotely, developed before IOT became a word. Users can also communicate between camera and the phone.

Articles

Some technical tutorials or blogs I authored

Image

Futures Made Easy with Scala

Scala Futures enables composition of sequential or parallel asynchronous executions easily

Go to article
Image

An introduction to Vert.x, the fastest Java framework today

The idea is simple, run Node.js on the JVM. The result is one of the fastest frameworks today.

Go to article
Image

If you’re still using Synchronized, you should try Akka Actor instead

Mutex is difficult to work with and causes race-condition. Akka Actor helps untangle it.

Go to article
Image

Quick Introduction to Blockchain

Explanation on how Bitcoin blockchain works.

Go to article

Contact me

I'm available for software development projects or consultation. Feel free to contact me.

martin@mbcu.me

Image