About Reflector

I am a Senior Engineer for VMware, a company that produces cloud and virtual machine software. When not working I enjoy board games and woodworking (producing furniture and other items for our house).
Sep 18

HTML Sucks

Note: I wrote this 2 years ago when I was obvi­ous­ly hav­ing some issues with some web pages I was cre­at­ing. I’m post­ing it as-​is because it’s still true even it I haven’t had to deal with HTML direct­ly in years.

Years ago, Tim Berners-​Lee set out to make the shar­ing of research papers eas­i­er so he devised a sys­tem which led to our cur­rent web. He devised (or reworked some exist­ing ideas) a sim­ple text based sys­tem to trans­mit the text and includ­ed some struc­ture so the dis­play­ing pro­gram (the brows­er pre­de­ces­sor) could for­mat the text is a rea­son­able way. His goal was to cre­ate a sim­ple sys­tem for dis­play­ing text. But as time passed, and peo­ple start­ed to see the val­ue in link­ing pages, some got the idea that they could do more than just show text. More tags were added, CSS was cre­at­ed, and the sim­ple mod­el that Berners-​Lee cre­at­ed can hard­ly be seen any more.

All of this slow addi­tion of fea­tures, ideas, pro­gram­ming, and styling has led us to a point where one has no idea if a par­tic­u­lar “page” will dis­play at all let alone in the desired form. There is so much com­pli­ca­tion and so many browsers (includ­ing ver­sions and plat­forms) that it real­ly is impos­si­ble to have any idea what one will get.

Feb 14

I Miss Emacs

I miss Emacs1. Emacs was awe­some and fun and every­thing that I ever need­ed in an editor–at least that is what I thought.

For those who don’t know, Emacs is an edi­tor that is writ­ten in a form of Lisp called eLisp (it’s close enough to just con­sid­er it Lisp) which has been enhanced to include text manip­u­la­tion prim­i­tives. There is a Lisp engine that is writ­ten in C, but except for the text prim­i­tives every­thing else is writ­ten in Lisp. And I mean every­thing. This makes it extreme­ly easy to con­fig­ure and mod­i­fy to make it real­ly yours.

I spent years using Emacs and devel­oped a large body of cus­tomiza­tion and pack­ages to sup­port my work. I once worked for a guy who lit­er­al­ly did not need code to be for­mat­ted to read it so he would cram as much as he could onto the screen with­out any con­sid­er­a­tion for mod­ern ideas of read­abil­i­ty. I on the oth­er hand could not read this jum­ble of char­ac­ters. It was so bad that the code for­mat­ters that exist­ed could not han­dle his code, so I wrote a com­plex Emacs macro that would parse the file (this was C code) and refor­mat it to some­thing that the for­mat­ters could han­dle. To make him hap­py I also wrote the con­verse which would mash the code back into its com­pressed form (hey he was the boss).

There is no way I could do this with most of today’s edi­tors. On the oth­er hand, Emacs has not been able to keep up with the progress of most IDEs. Large scale refac­tor­ing is not real­ly pos­si­ble with Emacs. There are pack­ages to do some sim­ple refac­tor­ing but they are lim­it­ed. So gave up some years ago and moved to and IDE (at the time it was Eclipse but I’ve moved on to IntelliJ IDEA and friends). With all of the code com­pre­hen­sion tools built in to it I just can­not be as pro­duc­tive while using Emacs (or any straight edi­tor) any more.

But I still miss being able to look at a prob­lem and say “I can write a macro for that.” There is some­thing mag­i­cal about know­ing that you can bend the tool to your will rather that hav­ing to bend to its design. And you haven’t lived until you work with an edi­tor that some­one said “you know, this is Turing com­plete so I think I’ll add a new mode that sup­ports Vi inside of Emacs2.” One edi­tor inside of anoth­er just using the macro language–that is pow­er.

I still fire it up some­time when I need to work on a few files from the com­mand line and Vi/​Vim is not enough and I feel a bit of nos­tal­gia when my fin­gers auto­mat­i­cal­ly fall into famil­iar pat­ters: Ctrl‑S (incre­men­tal search), C‑X,C‑S (file save), Ctrl‑K (kill), Ctrl‑Y (yank), and all of the oth­er eso­teric key­strokes. Even after all of these years they are ingrained in my mus­cle memory–unfortunately, the mod­i­fi­er keys have moved around which slows me down. Why do we need a gigan­tic Caps lock but­ton in one of the prime loca­tions on the key­board? Seriously, do peo­ple real­ly need the Caps lock key?

I love IntelliJ and will have a hard time chang­ing if some­thing bet­ter man­ages to be cre­at­ed but it’s just not as fun as Emacs. Need to do a sequence of steps mul­ti­ple times? Just record it as a tem­po­rary macro and exe­cute it as often as nec­es­sary. Need to keep it? Just save it. Need to make it more robust, con­vert it to a code macro and edit it. And do this mul­ti­ple times a day because it is so easy.

I will always have a spe­cial place in my heart for Emacs.

Jan 28

Java Needs Properties

OK, this is get­ting ridicu­lous. It’s been, what, 25 years since Java start­ed and we still haven’t fixed one of the sin­gle biggest pain-​points for the language—properties. I mean, just look at this mess:

The amount of boil­er­plate is huge and that’s with­out con­sid­er­ing oth­er boil­er­plate meth­ods like equals():

Ugh, I hate typ­ing all of that. If the object is a bean/​POJO then we can use gen­er­a­tors to help write some of the code at the expense of some weird code: strange inher­i­tance, abstract objects, anno­ta­tions, etc.

Now with prop­er­ties and some com­pil­er mag­ic we could have the same behav­ior that looks more like this:

And this would inter­nal­ly gen­er­ate the sec­ond exam­ple above. If you don’t like adding new key­words we could do it almost as ele­gant­ly with anno­ta­tions:

This could eas­i­ly be extend­ed to sup­port read-​only prop­er­ties as well as over­rid­ing the getter/​setter. Overriding the set­ter is need­ed to val­i­date the val­ue.

This would inter­nal­ly gen­er­ate the equiv­a­lent of this:

Note the assert in the con­struc­tor in the gen­er­at­ed ver­sion. This was added by the @NotNull anno­ta­tion. If the code gen­er­a­tor can guar­an­tee that name is set before the end of the con­struc­tor the it can elide the assert().

Anyway, there is a lot more that can be done. A prop­er­ty could be marked as part of the objec­t’s order­ing and then it would be added to a gen­er­at­ed compareTo() method. The basic idea is to remove the boil­er­plate and to force con­sis­ten­cy in code between pro­gram­mers.

Mar 01

I’m at Google

EDIT I wrote this in January of 2017 when I restart­ed my blog but it’s about an event that hap­pened in 2016 so I back-​dated it.

Well I guess third time real­ly is the charm. I final­ly passed through the maze, defeat­ed the mino­taur, and exit­ed vic­to­ri­ous. Yay me!

I was work­ing at a start­up med­ical com­pa­ny when I got a cold-​call from a Google recruiter. I almost did­n’t answer the phone because I did­n’t rec­og­nize the num­ber. But I did and had a nice chat with the recruiter. I was­n’t look­ing for a job as I had start­ed with Lifecode only 10 months before, but I decid­ed to talk with them for fun.

Well, I went through the process, phone inter­view, in-​person inter­view, and it start­ed look­ing like I might actu­al­ly get the job but I already had one. I would feel bad for leav­ing Lifecode after such a short time but I prob­a­bly would­n’t get anoth­er chance to work for Google. This gave a bit of stress for a while. Then, after being with Lifecode for almost 1 year they told every­one that the mon­ey had run out and they were clos­ing the doors. Boo, I liked the job. Yay, I was free to go to Google with­out regret. Boo, I did­n’t have a job offer yet. Yay, I did­n’t have to make the dri­ve to Foster City any­more. Boo, I was out-​of-​work.

So the stress of pos­si­bly hav­ing to leave Lifecode turned into the stress of not hav­ing a job. At this point, I’m almost through the process at Google and every­thing is look­ing good, so do I wait for Google to get back to me or do I start send­ing out my résumé. I decid­ed to wait for a lit­tle while. Then a lit­tle more. And a lit­tle more. Argh, I think I’m get­ting an ulcer.

Finally, after almost a month with­out work I get the call.

  • We’re going to offer you a posi­tion
  • Yay
  • But…
  • But? No But! No one said any­thing about a but…
  • You have to have a project to join before you can start with Google
  • Ok…so…?
  • So now we have to find a group that wants you
  • What? You mean like more inter­views?
  • Well, sort of. Much more infor­mal. You’ll just talk to the man­agers over the phone. If they like you, you’re in.
  • So how do I know who will want me?
  • Well, you won’t until they call you. If they call you.
  • How long is this going to take? I’m kin­da do’t have a job any­more. Or a pay­check. Or food.
  • Don’t wor­ry, it should­n’t take more than a week or two.
  • Uhhhh.…

Anyway, I only talked with three man­agers, and the third liked me, asked it I could come in and meet the group. So I did and every­one loved me and show­ered me with gifts…well, they did like me and I start­ed the next week.

Mar 01

Starting again

EDIT I back-​dated the I’m at Google post to reflect when it hap­pened so I’m back-​dating this post as it would look strange to say I’m restart­ing after I restart­ed,

It’s been a long time since I updat­ed this blog. I’m nev­er sure when I start whether I want to do it or not, and I keep restart­ing but it nev­er seems to go any­where. However, some very smart peo­ple who I respect say that doing a blog is a good thing and helps to solid­i­fy your own knowl­edge and gives you a record of what you’ve done and where you’ve gone. So I’ll try again.