Archive for the 'Work' category

Faulty Java Documentation

 | April 6, 2010 6:22 am

J3D provides a box constructor Box(float xdim, float ydim, float zdim, Appearance ap).

The documentation states:

public Box(float xdim,
           float ydim,
           float zdim,
           Appearance ap)
Constructs a box of a given dimension and appearance. Normals are generated by default, texture coordinates are not.

xdim – X-dimension size.
ydim – Y-dimension size.
zdim – Z-dimension size.
ap – Appearance

This is an error.  xdim, ydim, zdim are actually  one-half the x,y, and z dimension sizes.

Share on Facebook

Java Gripes

 | December 8, 2009 7:51 am

I, for my sins, am now programming in Java. By now I have a lot of experience programming with a pretty large number of programming languages. Java, C++, C, Basic, Visual Basic, SQL, Python, Perl, php, Matlab, etc.

While I have to admit to having a prejudice against Java as YAPL (Yet Another Proprietary Language), I knew that in all likelihood I’d be working in it for some time, and I did my best to reserve judgement and find what is good in the language.

By now though, I think I’ve gotten good enough in Java to have an informed opinion. While Java has its strengths, and it could certainly be worse (it could be visual basic for example), I’m generally unhappy with it. I think the big problem I have with Java is it marketed to be used in application domains where it simply isn’t right choice. I suspect that for medium sized projects, free projects, projects which require a heavy network integration or should run as an applet, it’s probably a good language. For certain problems I would even believe that it’s the best choice.

But for large, complex projects, in particular projects in which you want to sell a binary and not sell a source code, forget it, Java’s a nightmare. But I don’t want to get into an encyclopaedic discourse of the ills of Java. I actually just want to use this forum to vent my frustrations with the language, and keep a kind of running diary as problems cross my mind. I suspect it will be useful when I need to explain to someone why I don’t care for a language. Normally when I get involved in such conversations my frustration is to palpable for me to explain my concerns lucidly: I’m to busy trying to get my head above the frust.

For today, let me just gripe about how Java has too many advocates. I suspect that this ill, along with most of Java’s ills, stem from the fact that java is owned by a corporation which expends a lot of money and energy trying to brand the language, generate a community, and in general get people feeling all tribal about being a Java programmer. Consider this blurb on the back of “Killer Game Programming in Java” which has on it’s back cover blurb “As a result [of poor documentation] Java has become a second-class citizen to C, C++, and assebly language when it comes to hardcore game programming. This book changes all that…”

Ugh. That’s just typical of the Java world. The book jacket isn’t trying to sell a book, it’s selling Java to a problem domain. The fact is Java isn’t the right choice for a “hardcore” game. My understanding of the term “hardcore gaming” is pretty much, by definition, to be “resource intensive”. That means efficiency and complexity (both algorithmic and code-complexity) are an issue, and that’s where Java just isn’t a good choice. Not only that, but games tend to be commercial undertakings, which means selling binaries and license management etc, which means obfuscation, which means you can’t break your code down properly into modular units and libraries. Generally if it’s really computationally intensive, you want to manage your own memory…

Now, I have to use Java for a 3D application. I have no choice. So I’m happy to have the book and I’m sure it will be useful to me. I’m also sure that there are a number of applications for which Java’s 3d apps are a good choice (smart phones, web apps, free software projects), but trying to convince the reader that the only thing keeping Java from being as good a platform as C++ and assembly is the documentation, well that’s just disingenuous shilling. The Java community is like the P.T. Barnum of programming communities.

Share on Facebook

A summary of dongle manufacturers

 | January 19, 2009 12:41 pm

I’ve picked 3 dongle manufacturers who have professional websites, and make a positive impression regarding support and quality.  All support Java Native Interfaces (JNI).

  • Aladdin Hardlock. They make a very competent and professional impression.  Website is a bit business oriented (as opposed to developer oriented).  They provide a lot of tools for tracking your product, which may or may not be useful.  Java, as well as Mac and Linux are supported.  Demo can be ordered here for free.  Rental, feature based, and sold software models are available.  To provide the licensing models we need, we will want the Hasp HL Pro setup.  I haven’t found  a pricelist on their website.  I have not determined whether or not drivers are required for their dongle.
  • Matrix software protection system:  These guys seem pretty professional, and they have German and Swiss offices, which could be valuable in the case of problems.  The usb dongle is driverless.  Linux, Windows and Mac are all supported.  These guys have two model series ML and MK, differing in paranoia level (MK only posseser of master key can reprogram the dongle). Price for a single USB dongle is 34 EUR, for 100 dongles price per dongle is 22 EUR.  You can order an evaluation kit for 40 euros here.  A lot of big name guys use them.  No mention of Java Native Interface (JNI), so I called their customer rep in CH, and asked about it, and yes there is one.  He tells me you will have to include a seperate dll with your java code to support the dongle calls.  I imagine this is the case with all options.
  • Microcomputer Applications Inc (Keylock).  These guys are awesome, because they provide you with a checklist for evaluating hardlock manufacturers, which you can download here.  I looked over it, and it’s very useful.  The evaluation kit is free and can be downloaded here.  Windows and Linux supported, no Mac.  Price is 21 USD per dongle, for orders of 10-24.  Unfortunately they require drivers and a dll (see this link).
Share on Facebook