TheJach.com

Jach's personal blog

(Largely containing a mind-dump to myselves: past, present, and future)
Current favorite quote: "Supposedly smart people are weirdly ignorant of Bayes' Rule." William B Vogt, 2010

ELS, Italy Trip

Last week I went to Italy for the European Lisp Symposium! ELS was in Genoa (Genova?), Italy on Monday and Tuesday. Wednesday I traveled down to Rome and did some sightseeing Thursday and Friday, coming back home on Saturday. This blog post is just to share some highlights of the conference and to share some of the better pictures. (I don't think I got any great pictures.)

My employer was gracious enough to pay for the conference, too, of which the flight was the most expensive component. (It ended up being about $1400 due to booking kind of last-minute, with a few months advance booking it could have been closer to $900.) Europe is pretty cheap once you're over there!

I left Seattle's airport on Saturday the 30th. 5 hours later arrived at the JFK airport. My Japan trip has spoiled me, as I compare every airport now to the Haneda one. JFK is terrible! 10 hours later, arrived at the FCO airport near Rome. I was amused they make you walk through a shop to get to the customs area.. but then whoever was working the desk that day seemed to care very little. "Where are you going? Ok, next." The 'gate' for the next hour flight up to Genova was just a holding area before a shuttle we crammed full with everyone carried us out on the tarmac to get on our plane directly via the stairs.

See Full Post and Comments

Open source dramas

Just some commentary on some months-old dramas.

A couple months ago there was some drama in the Clojure community. An excellent summary can be found in eccentric_j's top comment on this reddit thread.

The TLDR is that someone got sick of how difficult it was to make contributions to Clojure and ragequit (politely), then Rich made this "it's not about you" post, and then a few days later as if to rub salt in the wounds REBL was released with a non-open-source license.

See Full Post and Comments

Self-documenting code

I read Uncle Bob's Clean Code book last year, and one of its examples in the final summary chapter on the importance of naming stuck with me. I mean, most people will just agree that naming is important, but sometimes convincing is needed, and the examples given are either trivial (i.e there's really not a naming problem) or convoluted (you'd never write code that way to being with, even with good names). Bob's example looked like it was going to be the second kind. Have a look:


public int x() {
int q = 0;
int z = 0;
for (int kk = 0; kk < 10; kk++) {
if (l[z] == 10) {
q += 10 + (l[z+1] + l[z+2]);
z += 1;
} else if (l[z] + l[z+1] == 10) {
q += 10 + l[z+2];
z += 2;
} else {
q += l[z] + l[z+1];
z += 2;
}
}
return q;
}


A loop with a few if-elses in it. A reference to some higher-scoped array l. Some magic numbers. What does it mean? Would anyone ever write this? I can tell you what this code does on the machine, I can't tell you what it "does". Its purpose. Its meaning.

See Full Post and Comments

Jump Game As Interview Problem, Domain Solutions

Over on LeetCode, there's a problem known as the Jump Game.

Given an array of non-negative integers, you are initially positioned at the first index of the array.
Each element in the array represents your maximum jump length at that position.
Determine if you are able to reach the last index.


Example 1:
Input: [2,3,1,1,4]
Output: true
Explanation: Jump 1 step from index 0 to 1, then 3 steps to the last index.

See Full Post and Comments

Intangible costs matter in compensation packages

If you commute to work by car, what would you rather have: free parking or a $4k increase in annual salary?

Note that if you pay $15/day for parking, and take no days off, that comes out to $3900. So the raise is strictly more than the cost, even.

I would pick parking. That's because even though raise > parking_cost, the actual comparison is raise vs. parking_cost + intangible_costs.

See Full Post and Comments

The mythical C and C++ replacements

I watched this recent talk by Bryan Cantrill, and thinking about it got me to write up some older periodic thoughts. It's probably worth reanalyzing this topic every few years (especially if I look deeper into any of the languages listed below) but consider this the first one.



Unlike Bryan I'm more interested in the theoretical replacement language for game programming rather than systems programming. The big "enemy" here is C++, but C is still very common especially at the library and middleware layers, so I think we're in alignment in generally aiming at C and C++ together.

See Full Post and Comments

Ramblings on data structure literals

I've been stewing a bit about Clojure's pretty data structure literals, and finding myself wanting them in other languages. In Common Lisp, maybe enough to use one of the various reader macros for maps. But what is it I really want?

In PHP, you used to have to do array() to make a new array or list. You could have data literals though: array(1, 2) for lists/arrays, array('foo' => 3, 'bar' => 4) for maps. It worked for me. I didn't need literal syntax for sets or anything else.

Later on I learned Python, I prefer the syntax a bit more. (1,2) for a "tuple" (list), [1,2] for an array/list/stack/queue/... very versatile, {'a': 3, 'b': 4} for a map. In JavaScript it (can) be about the same for arrays and maps, though you can leave off the key quotes for maps, but leaving them there (and using double quotes) has the nice side-benefit of being more likely to be valid JSON. It depends on whether your value is something serializable or not of course.

See Full Post and Comments