At work we have had an agreed upon coding style for a couple of years, but it hasn't been enforced so not everybody have followed it. When the style was established, everyone was using IntelliJ IDEA so the style was based on IDEA settings. Now it's a split between IDEA and Eclipse, so recently I was trying to create matching style settings in IDEA, Eclipse and CheckStyle -- the first two for automatic formatting and the latter for checking.
Both IDEA and Eclipse have some problems. For example Eclipse puts more whitespace in JavaDocs and I could not configure the JavaDoc formattings to be compatible so I just turned it off in IDEA. Eclipse tends to not respect the maximum line width setting for code very well -- occasionally a few characters will go beyond the limit. IDEA has the same problem for JavaDocs. Eclipse also has some problems with optimizing imports (note to self: should report /comment on bugs about those, maybe even contribute patches) that make it incompatible with IDEA.
But the biggest problem is that Eclipse doesn't have a very good user story for configuring all of this. The code formatter options (Java -> Code Style -> Formatter) are the oldest and they are pretty good -- easy to manage profiles and everything can be exported/imported. The same can be said about code clean up (Java -> Code Style -> Clean Up), but I would argue that these two separate concepts should be merged.
There is also a problem of redundancy: Java -> Editor -> Save Actions use the existing Formatter and Organize Imports settings, but they do not use the Code Clean Up settings, instead here you have to configure those again, in a non-shareable way.
However, Code Templates, Organize Imports and the general settings are worse -- they don't support different profiles, and Organize Imports does not export/import all settings (such as the number of static imports needed for .*). All of this makes it quite hard to share these settings between a team.
I think a good solution would be to replace the profiles and import/export in the different pages (formatter, clean up) with more general Code Style profiles and import/export that would cover every setting under Java -> Code Style. Then again, maybe more granular profiles are better for some reason that I fail to see, but I'm sure they could be retained somehow while solving the problem I just described.
And another idea: as Eclipse is becoming an IDE for more and more languages, and many of these language tools could possibly offer code formatters, compiler options etc., why not think of a generic code style settings UI that would be extensible by plug-ins for specific languages.
Showing posts with label java. Show all posts
Showing posts with label java. Show all posts
Saturday, July 21, 2007
Friday, June 22, 2007
Equinox & ECF serving interactive fiction
After a couple of years of being lazy and procrastinating, I finally got Ziggy to the point where we now have it running live [Beta] :) at Idle Thumbs (thanks Spaff, Jake and others from Idle Thumbs for your help with this) . Ziggy is a server side application based on Equinox and ECF, it enables people to play interactive fiction games on web forums, acting as a bridge between the forum and an IF virtual machine.
At first it was just plain Java, a very simple app hacked together in only a few days, but has suffered many a rewrite since then and is now fully OSGified. I separated it into four main components: server, Interactive Fiction API & implementation, Bulletin Board API & implementation, management client -- all of these are now packaged as OSGi bundles and the client is an RCP application. The Bulletin Board API is open source and is also incubating at ECF (still needs some work before becoming part of a release). The Interactive Fiction API may also become open source at some point, and there are other interesting uses for it. For example another plug-in I developed allows playing these games inside an Eclipse console, which I hope to make available soon.
Thanks to taking advantage of ECF's communications container abstractions, Ziggy's potential is not actually limited to bulletin boards -- it was easy to add just a bit of code to make it work over instant messaging and IRC, but this aspect of it is not public yet.
At first it was just plain Java, a very simple app hacked together in only a few days, but has suffered many a rewrite since then and is now fully OSGified. I separated it into four main components: server, Interactive Fiction API & implementation, Bulletin Board API & implementation, management client -- all of these are now packaged as OSGi bundles and the client is an RCP application. The Bulletin Board API is open source and is also incubating at ECF (still needs some work before becoming part of a release). The Interactive Fiction API may also become open source at some point, and there are other interesting uses for it. For example another plug-in I developed allows playing these games inside an Eclipse console, which I hope to make available soon.
Thanks to taking advantage of ECF's communications container abstractions, Ziggy's potential is not actually limited to bulletin boards -- it was easy to add just a bit of code to make it work over instant messaging and IRC, but this aspect of it is not public yet.
Labels:
eclipse,
games,
interactive fiction,
java,
open source,
osgi
Monday, June 18, 2007
Padclipse Text Editor
Padclipse is a new very light weight distribution of Eclipse that only contains the Text Editor and a few other plugins. The first pre-alpha release based on Eclipse 3.3RC4 just came out, but is not well tested, so caveat emptor! You can download it for Windows, Mac or Linux.
The first release of the "Lite" edition contains RCP, Text Editor, Compare and Search and not much else from the Eclipse SDK. Also included for convenience are EclipseColorer editor with syntax highlighting for many programming languages and HTTP File System.
The download is only 20MB and I've seen start up times from 2 to 5 seconds.
Future editions might include "Team" (CVS, SVN, Mylyn, ...), "Full" (Team + WST XML) and perhaps "Micro" (taking out everything that can possibly be taken out while leaving the text editor).
Padclipse also brings some new functionality that makes Eclipse easier to use as a simple editor:
The first release of the "Lite" edition contains RCP, Text Editor, Compare and Search and not much else from the Eclipse SDK. Also included for convenience are EclipseColorer editor with syntax highlighting for many programming languages and HTTP File System.
The download is only 20MB and I've seen start up times from 2 to 5 seconds.
Future editions might include "Team" (CVS, SVN, Mylyn, ...), "Full" (Team + WST XML) and perhaps "Micro" (taking out everything that can possibly be taken out while leaving the text editor).
Padclipse also brings some new functionality that makes Eclipse easier to use as a simple editor:
- Files (URI-s) can be opened via command line parameters, and consequent launches will open editors in a single instance of Padclipse (per user).
- Files will be automatically linked to the workspace to make local history and other features be available to all files. This will be improved in future versions.
- Future versions will improve OS integration and general usability.
Tuesday, May 22, 2007
Open Software
The terms Free Software and Open Source Software are cumbersome to use, especially when speaking with laity.
Free Software seems to often need an extra qualifier "free as in freedom" (as opposed to "free as in beer"). Without that qualifier, it can have a negative connotation, as people confuse it with Freeware, which is (was?) often thought of as something gratis, but of lesser function or quality than commercial offerings.
Open Source Software has the word "source" in the middle that needs extra explanation for many people. It would be much simpler to explain Open Software, without all the source (or sores, as Hani Suleiman would say). With the emergence of Open Source Hardware, where source can have a somewhat different meaning, I think Open Hardware would also be a better fit.
Simply open is good. And it can more easily include other qualities we've come to associate with, but what the words "open source" don't actually cover: open development, open processes, open attitude. It can include both Free Software and Open Source Software, and hopefully better associations with "open software" would form in people's heads, like: it's transparent, you can take it apart, modify it, distribute it and be part of it.
So, if you agree with me, lets start using the term open software from now on. :)
PS. Lets not even speak of alternatives like Free/Libre/Open-Source Software (but don't forget to FLOSS!)
Free Software seems to often need an extra qualifier "free as in freedom" (as opposed to "free as in beer"). Without that qualifier, it can have a negative connotation, as people confuse it with Freeware, which is (was?) often thought of as something gratis, but of lesser function or quality than commercial offerings.
Open Source Software has the word "source" in the middle that needs extra explanation for many people. It would be much simpler to explain Open Software, without all the source (or sores, as Hani Suleiman would say). With the emergence of Open Source Hardware, where source can have a somewhat different meaning, I think Open Hardware would also be a better fit.
Simply open is good. And it can more easily include other qualities we've come to associate with, but what the words "open source" don't actually cover: open development, open processes, open attitude. It can include both Free Software and Open Source Software, and hopefully better associations with "open software" would form in people's heads, like: it's transparent, you can take it apart, modify it, distribute it and be part of it.
So, if you agree with me, lets start using the term open software from now on. :)
PS. Lets not even speak of alternatives like Free/Libre/Open-Source Software (but don't forget to FLOSS!)
Wednesday, November 22, 2006
Using OpenGL in SWT with Java 5
Following my last idea about an OSGi based game engine, I thought I'd start experimenting with various game engine stuff. So far, I've managed to get a bundle that has OpenGL binding working quite nicely. I used LWJGL, and created two bundles for it:
1) org.lwjgl -- the Java classes and source code is in this bundle.
2) org.lwjgl.win32 -- platform specific fragment for the above bundle, which has the Windows DLL-s and OSGi knows how to load them because I specified the Bundle-NativeCode header for them in the manifest.
I used the SWT OpenGL support to test this and after experimenting with some snippets, and copying some code from the famous NeHe OpenGL tutorials, I thought that since I was using Java 5, I could do the following:
import static org.lwjgl.opengl.GL11.*;
to import the static methods and lo and behold -- now I can paste the C code from NeHe tutorials into Java files without making any changes! :)
Now I'm getting the urge to start learning OpenGL again. I've already done some of the NeHe tutorials in C++, but I never really liked to write code in C or C++ that much.
1) org.lwjgl -- the Java classes and source code is in this bundle.
2) org.lwjgl.win32 -- platform specific fragment for the above bundle, which has the Windows DLL-s and OSGi knows how to load them because I specified the Bundle-NativeCode header for them in the manifest.
I used the SWT OpenGL support to test this and after experimenting with some snippets, and copying some code from the famous NeHe OpenGL tutorials, I thought that since I was using Java 5, I could do the following:
import static org.lwjgl.opengl.GL11.*;
to import the static methods and lo and behold -- now I can paste the C code from NeHe tutorials into Java files without making any changes! :)
Now I'm getting the urge to start learning OpenGL again. I've already done some of the NeHe tutorials in C++, but I never really liked to write code in C or C++ that much.
Saturday, October 07, 2006
Idea: OSGi based game engine
There has been a little talk in the Eclipse related blogs about Eclipse's relationship with games. Which currently seems to be minimal. Here's an interesting idea for a new Eclipse Technology project: an OSGi-based game engine. It could be named EDGE for Eclipse Dynamic Game Engine. Another (sub-)project would add developement tools.
A project like this should define API/interfaces for sub-systems that are required by most game engines and create exemplary open source based implementations. There are some fine open source engines out there (there are others, but these are the ones I know about):
Other things needed:
A project like this should define API/interfaces for sub-systems that are required by most game engines and create exemplary open source based implementations. There are some fine open source engines out there (there are others, but these are the ones I know about):
- OGRE graphics engine. Someone else develops a Java wrapper for it
- ODE physics engine. There seems to be a plethora physics engines out there lately, but I'm not sure how many are open source. I remember that ODE is one of them. It has a Java wrapper too
- OpenAL 3D audio library. I think there are Java wrappers for this too, but you'll have to find the links yourself.
Other things needed:
- entity/actor system
- a scripting language
- the glue to hold it all together
- 2D graphics engine (start simple)?
- extensions for specific genres
Wednesday, August 31, 2005
Mavenising
I just realised again how great Maven is. I wanted to get back to working on JSimpleton, the bot that allows forum users to play old text adventure games cooperatively. I haven't touched the project for months and since I last did have gotten a new computer and didn't have any of the numerous Jakarta and other open source libraries any more, and have switched Eclipse versions from 3.0.1 to 3.1. Thankfully I had used Maven as my build tool and Eclipse as my IDE. After importing the old project directories into Eclipse, installing and configuring Maven and the Eclipse Mevenide (Maven IDE -- why Mevenide?) plugin from the update site, I only had to run the POM synchronization and build the project with Maven once to have all my classpath dependencies in the IDE resolved and the project built properly. Ok, so there were more issues than that, but they were my fault entirely.
Sometimes I don't think Maven is that great though -- I've wasted many an hour trying to make it build complex J2EE projects exactly how I want. Maybe I'm just not used to it.
Sometimes I don't think Maven is that great though -- I've wasted many an hour trying to make it build complex J2EE projects exactly how I want. Maybe I'm just not used to it.
Friday, May 20, 2005
Faces, Eclipsed
After developing a JSF application for a few weeks, I have now been in contact with some negative aspects of MyFaces (and/or the JSF spec) as well. I knew that would happen, but some of it really surprised me. For example, there is no easy way to temporarily turn off form validation and not break the entire lifecycle without rewriting many parts of the JSF implementation. In the end I had to implement custom validation methods for forms, that get executed only when needed. Thankfully our project doesn't require lots of form validation.
***
During the last couple of weeks, I've started using Eclipse Web Tools in a small project. It's currently very buggy, but it seems on the path to total awesomeness and I think the time is not far when almost everyone and their neighbours dog will be using Eclipse or a derived product for Java web application developement. There's simply no point in using a commercial IDE, when a free one can do all the same things, if not more. I use IDEA at work, and while it looks and feels better, it seems like Eclipse is catching up fast with features, and its Refactoring functionality is arguably already better than IDEA's.
I also learned about some cool Eclipse productivity features that I hadn't noticed so far, thanks to the Planet Eclipse site. Should read the help more.
***
During the last couple of weeks, I've started using Eclipse Web Tools in a small project. It's currently very buggy, but it seems on the path to total awesomeness and I think the time is not far when almost everyone and their neighbours dog will be using Eclipse or a derived product for Java web application developement. There's simply no point in using a commercial IDE, when a free one can do all the same things, if not more. I use IDEA at work, and while it looks and feels better, it seems like Eclipse is catching up fast with features, and its Refactoring functionality is arguably already better than IDEA's.
I also learned about some cool Eclipse productivity features that I hadn't noticed so far, thanks to the Planet Eclipse site. Should read the help more.
Tuesday, April 26, 2005
My Java Faces
At work we use a lot of Java libraries from The Apache Software Foundation. Last week we took a look at MyFaces, which is an implementation of the Java Server Faces specification with some added components that make life easier. While the inner workings of it are still not entirely clear to me, the current impression is that it's like Swing over HTTP. We've started using it in a new project, and it allows us to do some things very quickly, which is good because we're on a tight schedule.
I really like the MyFaces extensions to JSF -- with their help, some complex user interfaces components can be built very easily. I was able to wrap our own generic Data Transfer Object in a very simple DataModel subclass and use it in a MyFaces component that can render sortable tables easily. That required another custom class to implement the sorting, which delegated it to a Data Access Object, and the actual sorting was done in SQL.
I really like the MyFaces extensions to JSF -- with their help, some complex user interfaces components can be built very easily. I was able to wrap our own generic Data Transfer Object in a very simple DataModel subclass and use it in a MyFaces component that can render sortable tables easily. That required another custom class to implement the sorting, which delegated it to a Data Access Object, and the actual sorting was done in SQL.
Subscribe to:
Posts (Atom)