the corner office : tech blog

a tech blog, by Colin Pretorius

# Links 2010.08.31

File under: java : {2010.08.30 - 03:14} : Comments (0)

# Links 2010.08.14

  • InfoQ: Oracle Fixes Eclipse's Java Problem. Good points made. Oracle didn't have to, but rolled a new JVM build quicker than Eclipse could get a critical fix out the door. And when Oracle do re-rebrand, old versions of Eclipse will be broken. Pity.

File under: java : {2010.08.14 - 17:34} : Comments (0)

# Oracle sues Google

Hmmm.

  1. A run-down of the Oracle suing Google thing by Miguel de Icaza, Mr Mono himself. The irony.
  2. James Gosling confirms this was Oracle's game plan from the start.

File under: java : {2010.08.14 - 03:15} : Comments (0)

# Local Applications Cannot Be Detected

Bah. Wanted to take a peek at something running on my laptop but JVisualVM grumbled about unable being able to detect local apps. Helpfully had a link to the trouble-shooting page and the underlying issue, which is that HotSpot won't write the necessary perf stuff to the temp dir if it's on a FAT partition because it'd be world readable. Thanks Acer.

The trick is to run both the app you want to look at and JVisualVM with the argument -XX:+PerfBypassFileSystemCheck.

File under: java : {2010.08.12 - 16:48} : Comments (0)

# Is it just me?

Or is the new offical Javadocs site at download.oracle.com a helluva lot slower and more sluggish than java.sun.com ever was?

File under: java : {2010.08.08 - 09:01} : Comments (0)

# It's about the Ctrl-Space

At Artima:

In which I argue that (a) Generics have done egregious harm to both the elegance and readability of the Java language and, (b) they prove by example that static type checking is a linguistic dead-end. Are you persuaded? Do you agree? Read on...

I'm really busy at the moment so I must admit I haven't yet read on, yet I will say three things because the themes come up so often:

  1. Generics do suck until you remember how ugly code used to be when you needed monstrosities like ((Widget)list.get(0)).foo().

  2. I also remember how much effort it was when you couldn't type list.get(0) Ctrl-2-L and have your IDE autosuggest a sane local variable, etc etc. I also remember how I used to think C++ templates were much better - and in many ways they are, but the one downside is how easily templates break the IDE's autocomplete and navigation functionality.

  3. the benefit of static typing isn't about the compiling, it's about the navigating and the typing (of the keyboard variety). A modern Java IDE allows you to move around and analyse code and autocomplete and generate code and refactor in ways that dynamically typed languages just can't hope to match. As I like to say, Java may be horrendously verbose, but when your IDE allows you to type in paragraphs and sentences instead of words and phrases, it doesn't seem to matter as much.

I suspect that many people in the anti-static/Java camp haven't seen and aren't aware of what an accomplished Java dev can do. Which isn't to say that I think static typing is necessarily or always better than dynamic typing, just that I don't think IDE capability is fully considered in the debate.

File under: java : {2010.07.26 - 15:09} : Comments (0)

# YAML

StackOverflow: Which Java YAML library should I use?

File under: java : {2010.06.23 - 16:46} : Comments (0)

# Java AMQP fun

I'm playing Eve Online again. There's a site called eve-metrics.com which has become a monster data hub. They spray their incoming data feeds via AMQP. Cool, thinks I, this'll be fun to play with and will make a change from JMS and the homegrown messaging systems I do battle with for a living.

There seem to be two main AMQP contenders in java. First up - RabbitMQ. Nifty, lots of people I know have said nice things about Rabbit. I copy and paste the maven snippet (no need to fire off IDE searches), I hack an example, I'm up and running after a few errors. Every time something bombs out I get a long cryptic error message from Rabbit. That's OK, it's got enough detail to make sense to me and be google-friendly. I'm up and running within minutes. The client's still bombing out with various network/frame size issues after a few messages, though. Perhaps it's a version thing? Maybe it's an issue with the AMQP broker? I'm a total n00b at this, so maybe I should try another implementation to see.

The alternative for Java is Apache QPID. Oh dear. It's an Apache project, but no public maven repository. Some outdated version in a repo, but not the latest. Gee, it's been a while since I had to manually hook jar files into an Eclipse project, but OK - I download the .tgz. and get it all linked up. This includes hooking in an slf4j binding, which needs manual linking because I'm no longer in maven country. This isn't fun.

Examples and tutorials? Lots of and lots of links on the site, but the Java stuff I want is just a link to example code in the svn repo. Which means I have to fire up an svn client and check out the code. Lots of code.

I dig around a bit. I try a topic listener. Self-contained, can't be too bad, can it? Sadly, not. I *think* I've got the connection details right, but every time I call con.connect() with what I think are a reasonable set of parameters, I get a ConnectionException. With absolutely no error message. Looking at the stack trace, it's an IllegalStateException in InputHandler.next(). Whatever that is.

Not cool. I could crack open the class and see what's actually happening to cause the IllegalStateException, except that I don't have the freakin' source code because this isn't a maven project and I'd have to go downloading sources and manually link them. No way, just no way.

At which point I decide that between an error with no error message and a lot of effort before I can try to make progress, I'm giving up on QPID.

It's not fair to knock open-source projects, it's not like I'm paying for any of this, and these people are sharing their code - good on them. But if you're going to share software, it's a shame if it's not doing simple things to make users' lives easier. In this day and age, and especially when there are other competitors, that means things like maven repos, like a wiki page saying 'do it like so', and spitting out sensible error messages. Especially if you enjoy the eminence of being an official Apache project.

If the code's bombing out on line 2, with no way to figure out how to resolve the problem, then you're losing potential contributors and users.

Update: and after a bit more playing and digging through the Javadocs, and convincing myself that everything worked fine by using a Python implementation, I worked through the problems I was having with the RabbitMQ test client, and now it's working like a charm. Happy, me.

File under: java : {2010.04.16 - 17:05} : Comments (0)

# Thee 2009 review and 2010 goals

This year's been an interesting mix but also with frustrations.

Workwise, I'll not say much (as usual) except that it's been good. Another year of server-side heavy lifting and low-down nitty gritty stuff, which is exactly what I love doing. I also got to spend a chunk of the year doing C++, which I always enjoy.

On the home front, it's been a bit frustrating. My secret pet project fizzled out due to lack of time (mainly due to my starting studying again) and what I might call 'feasibility' prototypes which suggested that I was wasting my time. I learned a few things along the way, but for the most part, it's just mothballed code now.

I've also fiddled with GUIs this year, playing with everything from wxPython to C++ wxWidgets to Swing. I'm sorry to say I've achieved proficiency with none of them, and wasted an inordinate amount of time vascillating between them. Too damned complicated. I don't want to be a guru desktop app developer, I just want to be able to knock up a functional interface when I need it. I've never considerd my needs exotic; I'm sure it should be easier, and I wish it was, but it just isn't. Part of me wonders whether I'd be as frustrated by things not quite working how I want them to, if I was using .Net. I've fired up Monodevelop a few times and thought 'hmmm'.

Why not .Net then? Mainly, I'll admit, because it's too close to Java. The irony (and main problem) is that despite repeated promises to myself that I won't use Java at home while it's my day job, it's still easiest for me to knock out quick pieces of code in it. With a young family and studies and the like, tinkering time is always at a premium. Since I'm almost always chasing the clock (and oftentimes too far past bedtime), the temptation to revert to Java when I just want to get things done is too great.

So, looking back at my goals for 2009, it's a mixed bag. I did the C++ thing (but could always do more), I'm almost permanently in Linux (except for a brief stint this year playing Eve Online). I'm still doing Java at home, still not yet done the Unixey stuff, and I've sort-of played with Python.

For 2010? For now I'lljust say:

  • on the work front, more of the same
  • no more Java at home, no matter how convenient it is

That's a little open-ended, and it's that way for a reason. I've got exams in February, and I'm going to give myself the next month to think about what I'd really like to do hobby-wise this year. I want to do something achievable, I want to pick a project. I'm just not sure what, yet.

File under: java, programming : {2010.01.02 - 19:43} : Comments (0)

# Swing. More Joy.

Compared to a wxGrid, it's altogether too complicated adding rows and selecting cells in a JTable. I still don't fully understand cell selection and focusing and it grates me when what's supposed to take 5 minutes of Googling for the answer to add a feature to a simple GUI app turns into a drawn-out schlep with false starts and dead-ends and head-scratching.

JTable comboboxes are keyboard-friendly, though, and there's more sample code and discussion for Swing functionality than there is for wxWidgets. Breaks my heart to admit it, but it's true.

File under: java : {2009.12.29 - 18:35} : Comments (0)

Next »

meta

about
main blog

Categories

eclipse
java
linux
programming

RSS Feeds

rssfeed all posts
rssfeed all comments

Archives

2010.09
2010.08
2010.07
2010.06
2010.05
2010.04
2010.03
2010.02
2010.01
2009.12
2009.11
2009.10
2009.09
2009.08
2009.07
2009.06
2009.05
2009.02
2009.01
2008.12
2008.11
2008.08
2008.07
2008.06
2008.05
2008.04
2008.03
2008.02
2008.01
2007.12
2007.11
2007.10
2007.09
2007.08
2007.07

© Colin Pretorius