Archive for the 'Java' Tag

EclipseLink JPA in Eclipse dumb error message

Tuesday, August 11th, 2009

Sometimes you’re developing an app along with a new database schema to go with it, but you get this: Schema "null" cannot be resolved for table "XXXX".

Window -> Preferences -> Validation, JPA Validator, turn off for Build.

This probably shouldn’t be on by default anyhow, people are most likely going to build new apps from scratch than build new apps to fit old databases; and even if they do build from old, Eclipse’s JPA Tools has a build entities from tables function.

Java development outpaces C# development on all platforms

Thursday, July 9th, 2009

Behold, the most FUD-filled pro-C# article in the few months.

“Mono is clearly more popular than Java. I’ve been using desktop Linux as my primary desktop for three to four years, and use just a handful of Java apps day to day,” O’Grady said.

According to the “Normalized Comparison” and “Normalized Discussion Site Results” on LangPop, the Internet’s largest programming language survey, Java is #2 on those two categories, C holds the #1 spot both, C# holds the #6 on “Normalized Comparison” and #7 on “Normalized Discussion Site Results”.

In other words, Java is the second most used programming language in existence. A language that is 37 years old and 23 years older than Java beats it and is the only one to beat it. C# does not even come close.

I’ve been using Linux as my primary desktop OS for over a decade, I use a handful of Java apps, however I use no C# apps and I do not even have Mono currently installed.

Ubuntu, a Debian-based operating system that is among the most popular desktop Linux distributions, currently packages version 3.1 of the Eclipse IDE along with MonoDevelop 2.0, the most current build. Eclipse 3.5 was released by the Eclipse Foundation on June 24, but it is not packaged by Debian.

Eclipse 3.1 lacks features that MonoDevelop has, including code completion, integrated debugging, refactoring, and unit testing capabilities, Hargett claimed. “I’ve found in my consulting that people who install Eclipse 3.1 through the [Debian] package manager say, ‘This is terrible.’ ” He said that customers that have installed a version of Eclipse beyond 3.1 like it.

The article is really shooting itself in the foot. It compares two Linux distros (Debian and it’s child, Ubuntu) and says they have an outdated Eclipse. I use Debian, Eclipse is written in Java, and all I do is download Eclipse off Eclipse’s website and run it instead of using the packaged version. No compiling needed; it runs correctly out of the box. I use the copy of 64-bit OpenJDK 6 that is already packaged in Debian.

If Matt Hargett has a bug to report (such as the Eclipse package being outdated), then I suggest he files it instead of trying to slur Debian or Java.

3.5 does include integrated debugging, lots of refactoring functions, and it has unit testing via the ever popular JUnit, and Eclipse has had such functionality for awhile. 3.1 was released in Jan 2006, or over 3 years ago. MonoDevelop wasn’t even usable 3 years ago

“The Java community has taken Linux for granted,” Hargett said. “The assumption is, ‘What else is Linux going to do for managed code?’ and the answer is Ruby on Rails and .NET. Anecdotally, I’m not seeing people developing new Java Web applications. I’m seeing ASP.NET and Ruby.”

The more I read this article, the more I wonder if this is just thinly-veiled anti-FOSS FUD instead of simply anti-Java. Most custom enterprise and web service software is written in either Java or Perl. I’ve never seen Ruby used at a major company that didn’t do it just to blow their own horn about being different, and I’ve never seen an ASP.NET web app that ran on Mono on Linux instead of .NET on Windows.

I would also like to state that according to The Computer Language Benchmarks Game (aka Shootout), a popular synthetic languages benchmark that measures how slower a language is than C, Java scores an average of 1.68x slower, C# in Mono scores an average of 2.76x slower.

I’d rather use a managed language that is 2/3rds the speed of C than one that is 1/3rd. Mono development still seems to be very behind, despite articles like the one on SD Times claiming otherwise.

RMS gets it wrong (C# and .NET suck no matter whose you use)

Saturday, June 27th, 2009

RMS says don’t depend on Mono, because, in summary, there is also GNU’s Portable.NET.

I’m sorry, what? Has RMS ever actually used C#?

About two months back, I started learning C# using Mono and MonoDevelop as my tools. I wanted to use C# so I could effortlessly have my apps run on Windows with no actual work. Mono was kinda fast (compared to Perl, or Python without going hogwild with Pyrex/Cython and such), and was easy to setup and use. I also liked the way the syntax was designed.

A lot of people try to separate the standard libraries in .NET (Microsoft calls them the BCL, Base Class Library) from C# since you use them from every .NETy language, but they are very much part of C#. Without them, all you have is a language you can’t do much with out of the box.

The BCL is, largely, a complete fuckup. Compared to Win32′s C++ APIs that are some of the most hated interfaces ever created, BCL is basically the same thing. A lot of API design in the BCL is designed to imitate or wrap Win32 APIs as to make it easier to port Win32 apps to C#.

However, it also makes it much harder to use C#. The API design is just so infuriating and nonsensical. The BCL is the worst standard library I’ve ever seen for a high level language, and I hate it. It doesn’t matter if you use Microsoft’s .NET, Mono, Portable.NET, or whoever else, they all implement the same BCL specification.

Now, this doesn’t mean just because I think RMS is wrong for saying C# is still a viable language that I also think Microsoft is doing this to destroy Linux overtly.

Hanlon’s Razor states “Never ascribe to malice that which is adequately explained by incompetence,” and Microsoft’s insanity in API design clearly fits this. They didn’t pay Novell to develop on Mono because they wanted to kill Linux… they simply paid them to do it, and the fact that the BCL is designed by clueless morons is independent of this.

However, I did say I liked C#’s syntax. C# is very much modeled after modern Java. The last time I used Java was back in the late 90s, and I hated it because it was slow, it lacked a lot of things that the language has now (such as generics and autoboxing).

After my month of C#, I decided to give Java 6 a try. I easily picked it up because it has the same syntax… but Java has one thing C# doesn’t: a standard library (called the JCL) that actually makes sense and is planned out and has APIs that work well.

RMS should back Java instead of C# because Sun has finally released their chief Java implementation under the GPL license (under the name of OpenJDK).

I actually enjoy using Java after experiencing the horror that is C#, and I encourage people to try Java. Specifically, OpenJDK 6 is much faster than either Mono or Microsoft .NET, it is much faster to develop software (since you don’t have to fight with the JCL, like you do with the BCL), and I think Eclipse (the most popular IDE for Java) is superior to MonoDevelop.