HCMC/Saigon and Hoi An

CodeFX Weekly #62 — 6th of April 2018

Nicolai Parlog
Apr 6, 2018 · 10 min read

Hi everyone,

here’s the first installment of CodeFX Weekly in Vietnam — there are a few Java links at the bottom, but other than that, this is about Ho Chi Minh City / Saigon and Hoi An.

I send this newsletter out every Friday. Yes, as an actual email. Subscribe!

Ho Chi Minh City / Saigon

A few quick notes on Ho Chi Minh City / Saigon:

  • it used to be called Saigon for a couple of years, but since 1976 it’s Ho Chi Minh City (for more, see Wikipedia), often abbreviated as HCMC
  • it has 8 million inhabitants and is Vietnam’s largest city and economic powerhouse, but not its capital (that would be Hanoi)
  • HCMC is fairly far to the south with about 250 km to spare until Vietnam’s southernmost tip

After a 12 hour flight we landed in HCMC on Friday morning, 7am. First things we noticed:

  • it’s great to arrive in the morning
  • we love the climate
  • traffic is crazy, in a good way

Warm and humid — what’s not to like?

All day (and night) long it’s between 25°C and 35°C with about 80 % humidity. That’s great weather: You never have to care about what you’re wearing because you’ll sweat anyway and you never have to care whether you’re sweaty because there’s just no way around it. Taking one or two quick showers a day is really all anybody can ask of you and it isn’t even a chore, but a welcome cool-down.

Accept and relax is the name of the game.

Magnificent traffic

The city. A logistical frontier. I tried to picture clusters of vehicles as they moved through the streets. What did they look like? Swarms, flows? Were the freeways like currents? I kept dreaming of a world I thought I’d never see. And then, one day I got in…

First picture out of the airport
Second picture out of the airport
Third picture out of the airport

Chaos at first sight

At first sight, traffic in HCMC seems crazy. It took about five seconds after leaving the airport parking lot for the taxi to be enveloped in a cloud of motorbikes. And that never changed until we arrived at the hotel.

In fact, just the same could be said for the hotel itself or anything else on, close by, or next to a street: There are always bikes around. To the point where it seems bikes, not air or streets are the æther through which traffic flows.

And the sheer mass of traffic participants is the least of it. For one, nobody gives a rat’s ass about lanes; traffic lights are just a suggestion; and even sidewalks aren’t safe from the occasional motorbike.

Then, you not only have cars and motorbikes on the road, but also trucks, motorbikes laden like trucks, buses, motorbikes crowded like buses, a few rickshaws, motorbikes rebuilt into rickshaws, bicycles and pedestrians — they all intermingle quite freely.

Since common traffic rules are largely ignored, other mechanisms take its place. Mostly, honking.

But there’s a deeper structure.

Patterns emerge

Initially, this is all very chaotic, but after a few hours, patterns start to emerge. You end up like Cypher and don’t even see the bikes anymore. All you see are flows and streams of traffic, blockades and eddies. To the point where you sell out your travel companions to a taxi company that takes them out of the city to learn about the secret location of the Straßenverkehrsordnung that makes people actually stop at traffic lights.

Wait, what? How did I end up here? Oh yes, higher level perception of traffic in HCMC!

The first thing that gets you thinking is that people don’t seem to be dying by the hundreds each day. The other is that while there is a lot of honking and changing “lanes” and near misses, there are almost no abrupt maneuvers and not that many full stops.

As an individual traffic participant, all you need to do is stay close to those with the same intention. Want to turn left on a crossing? Nevermind the traffic lights or lanes, just gather a crowd of left-turners and edge forward inch by inch until the oncoming traffic can’t get through anymore and has to stop — there you go. As the flow of left-turners abates, the oncoming traffic regains the upper hand and pushes through. Then, start from the top.

This seems eerily similar to how fish swarms work (according to my memory of some science I read almost fifteen years ago and am too lazy to look up right now). Their complex behavior of traveling in swarms that conserve energy and evading is based on three simple rules:

  1. Don’t swim into your fellow fish
  2. Stay close to your fellow fish
  3. Evade anything that’s not a fellow fish

With the correct weights, these rules seem to suffice to reproduce quite complex and clever behavior.

I’m convinced traffic in HCMC follows similar rules:

  1. Prevent collisions
  2. Drive the same speed as those around you
  3. When going against or orthogonal to the dominant flow, do it slowly

Autonomously navigating the chaos/patterns

While this started out as a mere joke, it got me thinking. How hard would it be to train an AI based on such a simple set of rules?

According to the captchas that have me prove I’m a human, car AIs work by recognizing signs, streets, lanes, vehicles, pedestrians, and so forth. I assume they try to analyze the situation by identifying individual traffic participants and their intentions as well as the basic traffic rules for speed limits, traffic lights, right of passage, and so forth. Extending that to this chaos seems like a nightmare.

What if AIs instead saw traffic as an amorphous mass with individual streams, where the main task is to pick the right stream and successfully stay in its flow? On all streets that I ever drove a car myself, that would lead to disaster. In HCMC, it might just be crazy enough to work.

Great energy

We loved being in HCMC. I don’t want to annoy you with telling you how awesome every little thing was, so I’m gonna leave you with a bullet point list:

  • there are lots of parks, museums, and temples to visit
  • there’s great food everywhere
  • it’s incredibly lively
  • you can tell that Vietnam is not a rich country, but HCMC feels like it wants to change that — on its own if need be

Here are some random pictures:

If you ever have the chance to stop here for a couple of days, you should absolutely do it. (Unless you don’t like big cities full of people and noise — in that case, better stay clear.)

CodeFX at JavaSaigon

Before going to Vietnam, I went looking for Java user groups in HCMC, but didn’t find any. Out of desperation, I took to Twitter:

And you wouldn’t believe it, but thanks to Mikaël Geljić and Thanh Tra My Nguyen at Magnolia CMS, I had the chance to speak about the module system in freaking Vietnam. I was thrilled! Also jetlagged on Friday evening after 30 hours without sleep, but coffeine, adrenaline, and an attentive crowd kept me awake and it was the most fun I ever had giving a talk.

Magnolia created a new meetup for this, JavaSaigon, and I really hope it will take off. HCMC has a decent number of Java developers and it would be a shame if such an energetic city didn’t have a regular community event for them to exchange ideas.

If you’re ever in HCMC and would consider giving a talk during your travels (which I can only recommend — it’s so much more fun than usual!), please reach out to them (or to me).

Train ride

Next stop was Hoi An, which is roughly in the middle of Vietnam and thus about 850 km north of HCMC. We could have taken a 1:15h flight, but I didn’t want to. First of all, flying more than necessary is bad (mkay?), but it would also rob us of the experience of traveling through a country (instead of just flying over it).

So we took the night train on Monday evening and some short 17 hours later we exited it in Da Nang, which is half an hour by car from Hoi An. Definitely a good decision.

Hoi An

Since Tuesday morning, we’ve been in Hoi An. We’re here for a week to enjoy a mixture of the beach, hotel pool, old town, countryside, and other sights close by. This is a longer stop, so that our daughter can relax a little and have fun in the water while her parents and grandparents (yes, we took a set of babysitters with us) take turns hanging out with her versus doing more grown-up things like roaming through the old town.

I’ll let pictures tell the story.

Old town



We’re taking a bike tour through the countryside tomorrow and I’m really looking forward to it. Expect more pictures.

Beach and pool

Finally some Java

You’ve made it all the way to the end, so you really deserve some Java content to get back into the mood. Here’s some of what I read last week — many of those articles are a few weeks or even months old, so I apologize in advance, if you’ve already read them:

so long … Nicolai

PS: Don’t forget to subscribe or recommend! :)

CodeFX Weekly

Whatever caught my interest throughout the week: libraries or tools I am using, what I’ve written or read that might interest you, fascinating questions on StackOverflow, conferences visits, odd tweets, anything really that connects to Java, software development, or writing.

Nicolai Parlog

Written by

Developer (mostly Java), blogger (http://codefx.org/), author (http://tiny.cc/jms), trainer (http://courses.codefx.org & https://www.youtube.com/c/codefx)

CodeFX Weekly

Whatever caught my interest throughout the week: libraries or tools I am using, what I’ve written or read that might interest you, fascinating questions on StackOverflow, conferences visits, odd tweets, anything really that connects to Java, software development, or writing.

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade