jbanana: Badly drawn banana (Default)
posted by [personal profile] jbanana at 04:56pm on 09/06/2013
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)
posted by [personal profile] lea_hazel at 12:50pm on 25/01/2012
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)
posted by [personal profile] jbanana at 09:36am on 07/03/2011
     [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)
posted by [personal profile] jbanana at 04:14pm on 28/02/2011
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 {
    barf
}
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)
posted by [personal profile] jbanana at 03:10pm on 04/01/2011
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)
posted by [personal profile] jbanana at 05:52pm on 21/05/2009
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)
posted by [personal profile] jbanana at 11:29pm on 06/05/2009
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.

Links

June

SunMonTueWedThuFriSat
            1
 
2
 
3
 
4
 
5
 
6
 
7
 
8
 
9 10
 
11
 
12
 
13
 
14
 
15
 
16
 
17
 
18
 
19
 
20
 
21
 
22
 
23
 
24
 
25
 
26
 
27
 
28
 
29
 
30