jbanana: Badly drawn banana (Default)
[personal profile] jbanana2013-06-09 04:56 pm

Looking for developer feedback

I have a development framework for Swing apps called Compositor. Although I wrote it for my own benefit, I'd be interested in feedback from other developers. Would anyone like to have a go with it and tell me how they get on?
lea_hazel: Neuron cell (Science: Brains)
[personal profile] lea_hazel2012-01-25 12:50 pm

A shot in the dark...

I realize this community hasn't been updated in almost a year, and that it only has a few members. However, I'm going to risk it and attempt a shot in the dark.

I was a Java developer a few years ago and I haven't touched it in a while. I never had an IDE installed on my home computer, since I've never needed one. Now I'm suddenly feeling a strange craving to mess around and code something, for my own amusement. Can anyone recommend a lightweight, freeware IDE that I can use? I've been thinking of maybe installing IntelliJ.
jbanana: Badly drawn banana (Default)
[personal profile] jbanana2011-03-07 09:36 am

Mac compile error

     [java] 2011-03-07 08:57:04.693 java[399] CFLog (0): CFMessagePort: bootstrap_register(): failed 1103 (0x44f), port = 0xf803, name = 'java.ServiceProvider'
     [java] See /usr/include/servers/bootstrap_defs.h for the error codes.
     [java] 2011-03-07 08:57:04.694 java[399] CFLog (99): CFMessagePortCreateLocal(): failed to name Mach port (java.ServiceProvider)
Sometimes I get that in build output on my Mac. The file it says I should see doesn't help. It turns out that it means "You are compiling while another Java process is running".
jbanana: Badly drawn banana (Default)
[personal profile] jbanana2011-02-28 04:14 pm


I've been using Groovy. It's a pleasant scripting language that runs in a JVM, and has a Java-ish syntax. There are a number of differences to Java. One is it's relaxed attitude to typing, which I noticed when returning to something I wrote a while ago.
if ( someCondition ) {
    // do stuff...
} else if ( anotherCondition ) {
    // do other stuff...
} else {
WTF is barf? It looks like I was roughing out the code, and intending to come back to throw some exception if neither condition is true. In Java, the compiler would have complained about barf. But in the relaxed world of Groovy, the code works. After a little testing, I find that executing barf produces groovy.lang.MissingPropertyException: No such property: barf which is pretty much what I wanted!
jbanana: Badly drawn banana (Default)
[personal profile] jbanana2011-01-04 03:10 pm


I love logging. In many ways it's more useful than a debugger. Long ago I wrote a simple logger, and I still use it, or nowadays Java has a built-in logger, and in my experience it's fine.

But I hate Log4J. There's one straightforward reason: by default, Log4j does nothing useful. I couldn't count the times I've seen "Please initialize the Log4J system correctly" as if it were my fault. It's a logger doesn't log!

Another reason is that to specify a daily rolling log file (which is almost always what you want) requires 5 (or more) lines of configuration.

So here's a rule for writing any software. Do the simplest useful thing by default, and make the most likely use cases as simple as possible. Log4J fails on both counts.
jbanana: Badly drawn banana (Default)
[personal profile] jbanana2009-05-21 05:52 pm


I'm working on a project which involves a lot of JSP in an "interesting" CMS. We have a consultant helping us with the "interesting" bits. Today he gave us a JSP containing the following (some details elided to protect the guilty):
String sql = "SELECT * FROM tree WHERE id in (
	SELECT parent FROM tree WHERE id=" + parent + ")";
parents = cms.SQL ( sql );
I'd like to propose this for the canonical example of what *not* to do.

Edit: Many people dislike JSPs. They don't bother me, but they do allow you to do anything at all, not just rendering. In this particular case, the JSP has to know about the database table structure [sigh], and it should (but probably doesn't) sanitise the parent parameter [sigh], and it has to have a database connection wrapper object [sigh].

I'm even a little miffed about pointless local variable sql, but I'll let that one go. Oh, and KEYWORDS in UPPER case annoys me too, but some people think it's more readable.
jbanana: Badly drawn banana (Default)
[personal profile] jbanana2009-05-06 11:29 pm


This is a community for anyone writing Java code.

After enjoying the java_dev community on LJ so much, I thought there should be a DW place for people who write Java. This is it.