Posts

Showing posts from 2012

OMG you put Java code in the view!!

One of the unique joys of developing anything with Java Server Pages is encountering the Scriptlet Police. Scriptlets, as you probably know, are little bits of Java code embedded into the JSP. I think of JSPs as being servlets turned inside out. In a servlet, everything is Java by default, but you can throw in some HTML in the form of strings. In a JSP, on the other hand, everything is HTML by default, but you can throw in some Java in the form of scriptlets, like this: <ul> <% for (Foo foo: listOfFoos) { %> <li><%= foo.getName() %></li> <% } %> </ul> But God forbid you do this and then admit it on a mail group or message board. Any hint that you're actually putting Java code in your JSP will attract a lecture from the Scriptlet Police, for example: Question: "I am a complete JSP beginner. I am trying to use a java.util.List in a JSP page. What do I need to do to use classes other than ones in java.lang?" Hel

Scala and Kotlin

I've been spending the last three years writing code in Scala. In general I've been pretty happy with the language. It's much more compact than Java, and its higher-level features, such as closures (which have been around forever but which were popularized, I think, by Ruby), enable me to discard several of the Java tools and frameworks that I've had to drag around. Scala also comes with a very powerful collection library that I use on just about every line of code. Lately I've been following Kotlin, which looks very promising. I'm old enough to realize that this may just be a case of the grass looking greener on the other side of the fence. Every programming language has its flaws, and Scala is no exception. There's always the sense that maybe the next language will be The One. The One that does everything perfectly. The One that incorporates all that is good about Java and Scala and C# and C and C++ ( well okay, maybe not C++ ), introduces exciti

No-NoSQL

Anyone who's been around for a little while knows that the idea of storing data outside of a relational database is hardly new. Unix, for example, stores essentially all of its data in flat files, often with keys. Have you looked at your /etc/passwd file lately? It's just a little database, and it certainly doesn't use SQL. So I'm confused as to why the idea of a non-relational database is being treated by so many people as a novel idea. It's as if a generation of developers wrote a few web systems using the LAMP stack, noticed that MySQL wasn't ideal for everything, and concluded that the whole relational model was at fault and needed to be replaced. Is this increased attention simply due to the fact the this collection of non-relational data stores now has a name? I think that we've all worked with a relational database that is big and slow. In my case, that would describe maybe half the databases that I've encountered. But those databases aren&

An Ode to My Macs

About 18 months ago, Sara and I bought new Macs. I know it was about 18 months ago because I just finished paying for them. Apple and Barclaycard were offering 0% financing for 18 months on purchases over some amount. An amount we could have reached with just one Mac, but since we were both feeling limited by our computers for various reasons, we decided to get two. These two Macs are, without a doubt, the nicest and most useful computers I've ever bought. I suppose some of that is due to their being the newest, but there have been plenty of computers that I've bought new but that have merely been okay. That includes most of the Windows PCs that I've bought over the years. The problem with all the Windows PCs that I've ever owned is that they've all been beige boxes. Sometimes they haven't been strictly beige, but they've all had a certain plasticky, generic feel to them. They've all come with generic keyboards, generic mice, generic power cords.