I have spent quite a bit of time dissecting this phone lately. The BlackBerry is certainly quite popular with some estimating its market share at 41% of all smart phones. On a recent trip to Pennsylvania, I saw many, many phones on planes and at the airports and I can certainly confirm that ratio. I counted close to 400 phones, half of which were some model of BlackBerry.
I have to admit, so far, this is the most impressive Java ME/CLDC capable phone found I have tried. Not only are many optional CLDC packages available but many more BlackBerry Java packages are present. That being said, Research in Motion (RIM), implements custom GUI packages that are specific to its platform. What that means is that if you code an application that follows the look and feel of a BlackBerry application, it will not function on any other phone.
I have to say however that this device is too expensive. At a suggested retail price upward of $400, it only features 64 MB of memory and an empty micro-SD card slot. A similarly priced iPhone comes with 128 MB of SDRAM and between 8 and 16 GB of flash memory. The iPhone screen supports touch and it's twice the vertical size of the Curve's screen.
The iPhone comes with Wi-Fi support too. Which means you can enjoy much faster networking on any hot spot and potentially save on those outrageously expensive over the air rates for bandwidth too. In Canada, MB per dollar access is ridiculously expensive. Rogers, for example, charges $10 per MB outside a plan. If you have a plan, prices range from $25 for 4MB per month to $100 for 100MB per month. Just disgusting if you ask me. Getting back on track here, you have expensive bandwidth and no memory to implement any kind of good caching on the phone. The only strategy left is to implement watered down services. Consider the browser on the BlackBerry for example, it has no JavaScript support and it mostly ignores any image properties found on a page in order to keep bandwidth consumption at a minimum. Sure, you can access the web but it doesn't mean it's any good.
RIM also develops probably one of the worst integrated development environments (IDE) you've ever seen. The JIDE is an all Java IDE that you use to code for the BlackBerry device. JIDE redefines what the word "ugly" means. Fortunately, RIM has started to develop a plugin for Eclipse and a plugin for Visual Studio. It's also possible to use NetBeans if you have enough energy to invest into it.
Looking at the BlackBerry, I have to wonder if the company suffers too much from the "not invented here" mentality and how much of that affects the price tag of its products. The company develops an IDE, customizes the licensed library and CLDC virtual machine from Sun, has its own executable format, implements its own content designers tools, etc, etc, all of which are very expensive. Talking to various colleagues these last few months, I am convinced that RIM must refresh its hardware in order to stay competitive. By refresh, I not only mean the power and visual appeal of their devices but the overall quality of the BlackBerry development platform or risk irrelevance.
Tuesday, May 6, 2008
Sunday, May 4, 2008
JavaOne is this Week
The Java front news has been dry for the last little while since everyone is holding off on announcing anything, instead waiting for the conference in the hopes of getting more press.
I'm really eager to see what will be made available this week. That being said, I'm hoping for major announcements on JavaFX from Sun. At the very least, I'm hoping to see some strong tooling support for content creation on that platform for graphic designers. Also, I'm expecting a new Java ME/CDC operating environment for phones based on the assets acquired from SavaJe and the PhoneME Advanced project. This new environment will feature JavaFX across the board.
Now, I still think Android is better than Java ME/CDC, but the CDC with all optional profiles is equivalent to Java SE 1.4 which is still pretty enticing. Furthermore, Java ME + JavaFX might go a long way to catching up with Android. By the way, PhoneME Advanced implements all the optional CDC profiles, so yes, it's equivalent to Java SE 1.4.
I'm really eager to see what will be made available this week. That being said, I'm hoping for major announcements on JavaFX from Sun. At the very least, I'm hoping to see some strong tooling support for content creation on that platform for graphic designers. Also, I'm expecting a new Java ME/CDC operating environment for phones based on the assets acquired from SavaJe and the PhoneME Advanced project. This new environment will feature JavaFX across the board.
Now, I still think Android is better than Java ME/CDC, but the CDC with all optional profiles is equivalent to Java SE 1.4 which is still pretty enticing. Furthermore, Java ME + JavaFX might go a long way to catching up with Android. By the way, PhoneME Advanced implements all the optional CDC profiles, so yes, it's equivalent to Java SE 1.4.
Thursday, May 1, 2008
Mac OS X 7 Years Later
Continuing my work in the mobile space, I recently had to purchase a Mac. By recently, I mean the day that Apple made their iPhone SDK public. I like the iPhone, it's the device that has raised the bar, the device that has forced all other mobile manufacturers to rethink their own product lines. We should see some real advancements this year from mobile hardware, that it be in terms of screen quality, power and features from competing companies thanks to the iPhone.
If the iPhone and iPod Touch are neat little devices, I have to admit I'm not much of a fan of Mac OS X however. I remember being so excited when I got my copy of OSX 10.0.0. That excitement was promptly crushed when I saw it under perform on my lowly PowerPC G3. After that, I pretty much left the world of Macs behind until the iPhone SDK was publicly made available.
The first I notice is how little has actually changed since 2001. OSX today is pretty much the same OSX that I used in 2001. The performance is much better of course but pretty much the same nonetheless.
I don't like the inherent security policies that are setup after install time. For example, to install an application, you usually have to start an installation wizard to guide you through the process. At one point during the installation, you're usually presented with a privilege escalation dialog. Entering your credentials will allow the installation to proceed. Unfortunately, the same cannot be said about uninstalling. First of all, there is no global registry of installed applications, so there is no uninstall wizard. You just go to the applications folder and drag an application to the trash to uninstall it. That's fine, my point is that you don't actually need to escalate to drop your applications into the trash. That's just plain wrong. Furthermore, it's only fine if this is where the application installed all of its files in the first place. Some applications will also install software in more traditional UNIX locations. If you happen to install such a beast, you'll be stuck with those extra utilities or have to rely on using a custom uninstaller before doing a regular uninstall. These custom uninstallers are usually Bourne shell scripts.
Speaking of escalation. Apple may poke fun at Microsoft about UAC in their commercials, but let me tell you they have nothing to brag about. First of all, they have an escalation prompt too, just like UAC. However, a filtered administrator, instead of a single click on 'Continue', must enter his password every time or optionally cache his credentials for a limited amount of time. Both options are terribly insecure. First, because if a malicious piece of software on both these systems makes a dialog box that mimics the appearance of this dialog, you get two very different results. On Vista, you have given out a mouse click (by clicking on 'Continue'), while on OSX you have given out your escalation credentials. Yeah Apple, keep making jokes. Furthermore, caching of credentials? Really? So everything I execute for the next little bit is running escalated? Really? At this point, I think OSX is only secure because it's less of a target than Windows, that's it, nothing else. It really has nothing to brag about. You can say all you want about the underlying UNIX security model found in OSX but if the user interface handles security this way, it's all for nothing.
I officially don't like Objective C. You can talk about the virtues of your favorite programming language all you want or not at all but it doesn't change the real reason some languages are popular and some aren't, in a word taste. Considering mostly all languages these days are Turing complete and object oriented, what a language looks like on screen is pretty much the only differentiator. When people like something, they have a reaction to it and they like it. Same thing when they don't like it. It's the same really for programming languages, when you look at a piece of code on screen, something in you reacts and decides if you like it or not, it really is that simple. When the dust settled, most people decided they didn't like how Objective C felt and used something else. Well, I'm now part of that group too except I can't use something else on the iPhone. I don't completely dislike it, e.g., I like the big class library and I like being able to retrieve the constructor of a class with nothing else but a string that represents the class name, I do, I really do... but that's about it really. The overly verbose method calls, the unified diff challenged syntax, i.e., '+' for static methods and '-' for instance methods is just plain evil when you're reviewing patches.
Using memory pools manually is also really just annoying. What is this? C or Objective C? I'm still not clear on how to correctly use these things across threads on the iPhone. I'm aware that the full OSX supports garbage collection now.
What I really despise however, what turned me off to Mac OS Classic and still does it for me today is the workbook style windows found in applications. If you've never used Mac OS, early versions of Visual Basic and Delphi suffered from this problem on Windows too. You have a single application but instead of being contained into a single master window, you have many little windows floating around everywhere. If you have multiple applications opened at the same time, you can see the windows of other applications within the holes of your current application. Most annoying is that there doesn't seem to be a standardized shortcut for quickly moving focus around between the windows of a single application. This makes use of Xcode really annoying. If I just happened to miss this keyboard shortcut, please, for the love of any deity you worship, please leave me a comment and tell me what it is.
Of course, it's not all bad. One very good feature of this OS is the startup and shutdown times. They both put Windows and Linux to shame.
The UNIX command line is a very nice touch too. I have to admit, as much as I like Vista, I don't think I could use it, or any other version of Windows for that matter, if it weren't for Cygwin.
If the iPhone and iPod Touch are neat little devices, I have to admit I'm not much of a fan of Mac OS X however. I remember being so excited when I got my copy of OSX 10.0.0. That excitement was promptly crushed when I saw it under perform on my lowly PowerPC G3. After that, I pretty much left the world of Macs behind until the iPhone SDK was publicly made available.
The first I notice is how little has actually changed since 2001. OSX today is pretty much the same OSX that I used in 2001. The performance is much better of course but pretty much the same nonetheless.
I don't like the inherent security policies that are setup after install time. For example, to install an application, you usually have to start an installation wizard to guide you through the process. At one point during the installation, you're usually presented with a privilege escalation dialog. Entering your credentials will allow the installation to proceed. Unfortunately, the same cannot be said about uninstalling. First of all, there is no global registry of installed applications, so there is no uninstall wizard. You just go to the applications folder and drag an application to the trash to uninstall it. That's fine, my point is that you don't actually need to escalate to drop your applications into the trash. That's just plain wrong. Furthermore, it's only fine if this is where the application installed all of its files in the first place. Some applications will also install software in more traditional UNIX locations. If you happen to install such a beast, you'll be stuck with those extra utilities or have to rely on using a custom uninstaller before doing a regular uninstall. These custom uninstallers are usually Bourne shell scripts.
Speaking of escalation. Apple may poke fun at Microsoft about UAC in their commercials, but let me tell you they have nothing to brag about. First of all, they have an escalation prompt too, just like UAC. However, a filtered administrator, instead of a single click on 'Continue', must enter his password every time or optionally cache his credentials for a limited amount of time. Both options are terribly insecure. First, because if a malicious piece of software on both these systems makes a dialog box that mimics the appearance of this dialog, you get two very different results. On Vista, you have given out a mouse click (by clicking on 'Continue'), while on OSX you have given out your escalation credentials. Yeah Apple, keep making jokes. Furthermore, caching of credentials? Really? So everything I execute for the next little bit is running escalated? Really? At this point, I think OSX is only secure because it's less of a target than Windows, that's it, nothing else. It really has nothing to brag about. You can say all you want about the underlying UNIX security model found in OSX but if the user interface handles security this way, it's all for nothing.
I officially don't like Objective C. You can talk about the virtues of your favorite programming language all you want or not at all but it doesn't change the real reason some languages are popular and some aren't, in a word taste. Considering mostly all languages these days are Turing complete and object oriented, what a language looks like on screen is pretty much the only differentiator. When people like something, they have a reaction to it and they like it. Same thing when they don't like it. It's the same really for programming languages, when you look at a piece of code on screen, something in you reacts and decides if you like it or not, it really is that simple. When the dust settled, most people decided they didn't like how Objective C felt and used something else. Well, I'm now part of that group too except I can't use something else on the iPhone. I don't completely dislike it, e.g., I like the big class library and I like being able to retrieve the constructor of a class with nothing else but a string that represents the class name, I do, I really do... but that's about it really. The overly verbose method calls, the unified diff challenged syntax, i.e., '+' for static methods and '-' for instance methods is just plain evil when you're reviewing patches.
Using memory pools manually is also really just annoying. What is this? C or Objective C? I'm still not clear on how to correctly use these things across threads on the iPhone. I'm aware that the full OSX supports garbage collection now.
What I really despise however, what turned me off to Mac OS Classic and still does it for me today is the workbook style windows found in applications. If you've never used Mac OS, early versions of Visual Basic and Delphi suffered from this problem on Windows too. You have a single application but instead of being contained into a single master window, you have many little windows floating around everywhere. If you have multiple applications opened at the same time, you can see the windows of other applications within the holes of your current application. Most annoying is that there doesn't seem to be a standardized shortcut for quickly moving focus around between the windows of a single application. This makes use of Xcode really annoying. If I just happened to miss this keyboard shortcut, please, for the love of any deity you worship, please leave me a comment and tell me what it is.
Of course, it's not all bad. One very good feature of this OS is the startup and shutdown times. They both put Windows and Linux to shame.
The UNIX command line is a very nice touch too. I have to admit, as much as I like Vista, I don't think I could use it, or any other version of Windows for that matter, if it weren't for Cygwin.
Wednesday, April 16, 2008
Google's App Engine
Seriously, what happened? Python? I don't mean to offend anyone but why come up with this nice, huge, not to mention free, application server if all you're going to support is Python?
Now, I'm sure they are tons of people who like Python, I just happen to not be one of them. I don't like languages that are brace challenged. What's really annoying is that Google has been pushing its Web Toolkit(GWT) this last year, a toolkit that lets you write Java code for the client that gets compiled down to JavaScript so that is can execute on the client. Why is this not supported?
That being said, since GWT compiles down to static HTML and JavaScript files, it's still possible to use the client side, compiled product from Google's App Engine. The server end of the application would have to be written in Python. Furthermore, the RPC mechanism provided by GWT would need to be dismissed in favor of REST or JSON for communications.
All this to say that the top four requested features on the Google Code site for this project are support for other languages. I can understand Google not supporting Ruby, PHP and Perl. Google doesn't have any significant history with any of these languages. Java on the other hand? I just don't get it.
Now, I'm sure they are tons of people who like Python, I just happen to not be one of them. I don't like languages that are brace challenged. What's really annoying is that Google has been pushing its Web Toolkit(GWT) this last year, a toolkit that lets you write Java code for the client that gets compiled down to JavaScript so that is can execute on the client. Why is this not supported?
That being said, since GWT compiles down to static HTML and JavaScript files, it's still possible to use the client side, compiled product from Google's App Engine. The server end of the application would have to be written in Python. Furthermore, the RPC mechanism provided by GWT would need to be dismissed in favor of REST or JSON for communications.
All this to say that the top four requested features on the Google Code site for this project are support for other languages. I can understand Google not supporting Ruby, PHP and Perl. Google doesn't have any significant history with any of these languages. Java on the other hand? I just don't get it.
Wednesday, March 19, 2008
NetBeans 6.1: The Best just got Better
When it comes to IDEs, I've been around. I've used Visual C++ since version 1.5. Tried other environments over the years, but Visual Studio was by far the best no matter what other people claimed.
I started using Eclipse since that's what everyone around me was using for some Java work and I hated it. I'll reserve my thoughts on that for a future blog post but it was never a comfortable fit for me. Needless to say, I've converted my entourage from Eclipse to NetBeans now.
Version 5.5.1 of NetBeans was pretty good but the editor kept, well, I'm not quite sure on how to describe this, but it kept being wrong... or feeling wrong at least. Not sure if that makes any sense but that's the best I've got to offer.
NetBeans 6 was simply fantastic. It was just great. Probably one of the best IDEs I've ever used. That being said, it had a few shortcomings that were really annoying. On huge files, code completion was somewhat slow. Not that slow, but code completion is one of those features where you must literally work at the speed of thought of the developer. Otherwise, you break the flow of the developer. Startup time was annoying but manageable.
NetBeans 6.1 has really been great for me, so great that I've ditched 6 for the 6.1 beta. They are several reasons for this. First, it seems to me like this thing has had a lot more debugging time than a fully patched 6.0.1 release has. So it just works even if it's just a beta. That being said, a small caveat here is that I shun JavaScript work in favor of GWT. So I don't know how the rewrite has impacted that editor.
However, it's the little things that make the difference. For example, my favorite new feature by far is the default location of the Glassfish domain. Silly? Maybe, but I use Vista across the board. It has always been considered impolite under Windows to write to "Program Files" after installation has completed. Starting with Vista however, that folder has now been locked down. Meaning that with NetBeans 6, the default developer domain lived under "Program Files\Glassfish\domains\domain0". Under Vista, you had to either unregister your Glassfish server from the IDE and re-register it again with a more polite location, or you had to go into the Glassfish folder in "Program Files" and grant yourself write privileges to the domain's folder in order to support all scenarios. NetBeans 6.1 under Vista, and hopefully under any other Windows version too, creates the default domain inside your home directory. I think I almost cried when I saw that.
That being said, as much as I love this IDE now, ending a 14 year old run on Visual Studio/C++, I still have my pet peeves. In no particular order:
I started using Eclipse since that's what everyone around me was using for some Java work and I hated it. I'll reserve my thoughts on that for a future blog post but it was never a comfortable fit for me. Needless to say, I've converted my entourage from Eclipse to NetBeans now.
Version 5.5.1 of NetBeans was pretty good but the editor kept, well, I'm not quite sure on how to describe this, but it kept being wrong... or feeling wrong at least. Not sure if that makes any sense but that's the best I've got to offer.
NetBeans 6 was simply fantastic. It was just great. Probably one of the best IDEs I've ever used. That being said, it had a few shortcomings that were really annoying. On huge files, code completion was somewhat slow. Not that slow, but code completion is one of those features where you must literally work at the speed of thought of the developer. Otherwise, you break the flow of the developer. Startup time was annoying but manageable.
NetBeans 6.1 has really been great for me, so great that I've ditched 6 for the 6.1 beta. They are several reasons for this. First, it seems to me like this thing has had a lot more debugging time than a fully patched 6.0.1 release has. So it just works even if it's just a beta. That being said, a small caveat here is that I shun JavaScript work in favor of GWT. So I don't know how the rewrite has impacted that editor.
However, it's the little things that make the difference. For example, my favorite new feature by far is the default location of the Glassfish domain. Silly? Maybe, but I use Vista across the board. It has always been considered impolite under Windows to write to "Program Files" after installation has completed. Starting with Vista however, that folder has now been locked down. Meaning that with NetBeans 6, the default developer domain lived under "Program Files\Glassfish\domains\domain0". Under Vista, you had to either unregister your Glassfish server from the IDE and re-register it again with a more polite location, or you had to go into the Glassfish folder in "Program Files" and grant yourself write privileges to the domain's folder in order to support all scenarios. NetBeans 6.1 under Vista, and hopefully under any other Windows version too, creates the default domain inside your home directory. I think I almost cried when I saw that.
That being said, as much as I love this IDE now, ending a 14 year old run on Visual Studio/C++, I still have my pet peeves. In no particular order:
- it's still slow to startup even it's a lot faster than it used to be.
- I hate the fact that they are no project grouping feature similar to the solution concept in Visual Studio. NetBeans does actually have a project group feature but I just hate it. I hate it because it doesn't live on the file system, hence I can't commit it to source control. This means sharing project groups between team members is really annoying. I hate it because it clutters up the UI. The idea of a master project I find is also broken. Simply because you don't know right off the bat which of the project in a hierarchy is the master. I'm hoping that full support for Maven in NetBeans 7 will take care of this.
- I use this IDE for pretty much everything now except for Windows Mobile and Android development. Which means I use it for C++ too. I don't use C++ that much anymore but it does come in handy. It works really well under Windows with cygwin, I even have Microsoft's Platform SDK hooked into this thing. Again, works pretty well. That being said, g++ is the only supported compiler under Windows. Considering the Visual C++ compilers ship with the Platform SDK now, I would like to be able to just use those instead of g++.
- I would like to be able to run multiple instances of the IDE at the same time. The scenario here is when I want to debug both the client and server end of an application at the same time.
- Better GWT support. Matisse is great but with all these new languages and toolkits like JRuby, Groovy and GWT coming into the Java ecosystem now, isn't it about time this thing started to learn new tricks? Look at SharpDevelop for instance. It has a visual form designer for all the languages it supports.
- Message queues in the services tab. I really like the services tab. I really like the fact that databases are showing up there too now with this release. The Java DB menu item looked out of place in the tools menu in 6. Support for stand alone instances of JMS brokers would be a welcomed addition. I use Glassfish a lot, but I also use ActiveMQ outside of any Java EE container a lot too. Why? Because of the additional interoperability features it provides. Very handy to have around. And yes, before anyone comments on this, I know about the STOMP adapter from CodeHaus could probably be installed on OpenMQ.
- Support for Groovy, Groovy and Groovy.
- Lastly, I would like to see a Geronimo server plugin. Yeah, I know this a weird one considering I'm all Glassfish. However, I have one project where Geronimo was the best compromise I could reach. Maybe this is selfish but in my defense, I would probably have started coding this if it hadn't been for this thread here.
Monday, March 17, 2008
TopLink Lives
It was my hope that the union of BEA and Oracle would lead to the enventual demise of TopLink in favor of KODO(Apache OpenJPA). Obviously, Oracle being and enterprise player, any phase out plan would be over many, many years. For example, I think Oracle will move their customers to the vastly superior WebLogic over their own Java EE offering but will still probably continue to offer and develop OC4J for many years to come. However, when it comes to a Java EE server, they are many parts. Each part could conceivably be marketed and sold individually.
Of course, things were never that simple. The core of TopLink, TopLink Essentials, is the JPA version 1 reference implementation, is open source and ships with Sun's Glassfish server which also happens to be the Java EE 5 reference implementation.
Futhermore, Oracle donated not just Essentials but the full TopLink product a while back to the Eclipse foundation under, curiously enough, under a different, Eclipse compatible, license.
Today comes the announcement that TopLink Essentials is indeed being phased out but TopLink is moving up in the world. The full TopLink, the one donated to Eclipse, is now EclipseLink. EclipseLink has been chosen as the JPA version 2 reference implementation and will ship with the next version of Glassfish, also know as the Java EE 6 reference implementation.
All in all, this is good news nonetheless. The double donations, under different licenses no less, being consolidated in one code base is certainly less confusing. The Eclipse license, from EclipseLink, is also more permissive than the CDDL/GPL from TopLink Essentials. In fact, so permissive that the Apache Software Foundation considers it just fine too. For example, the Java compiler from Apache Harmony is actually the Eclipse Java compiler.
Now, if we can just get comprehensible error messsages from future releases, all should be good. That being said, I've been using TopLink Essentials more and more, and after a while, you get into this weird Zen state and actually start to recognize and understand the error messages. When you do, it actually works pretty well. That being said, I still think those error messages are nuts.
Of course, things were never that simple. The core of TopLink, TopLink Essentials, is the JPA version 1 reference implementation, is open source and ships with Sun's Glassfish server which also happens to be the Java EE 5 reference implementation.
Futhermore, Oracle donated not just Essentials but the full TopLink product a while back to the Eclipse foundation under, curiously enough, under a different, Eclipse compatible, license.
Today comes the announcement that TopLink Essentials is indeed being phased out but TopLink is moving up in the world. The full TopLink, the one donated to Eclipse, is now EclipseLink. EclipseLink has been chosen as the JPA version 2 reference implementation and will ship with the next version of Glassfish, also know as the Java EE 6 reference implementation.
All in all, this is good news nonetheless. The double donations, under different licenses no less, being consolidated in one code base is certainly less confusing. The Eclipse license, from EclipseLink, is also more permissive than the CDDL/GPL from TopLink Essentials. In fact, so permissive that the Apache Software Foundation considers it just fine too. For example, the Java compiler from Apache Harmony is actually the Eclipse Java compiler.
Now, if we can just get comprehensible error messsages from future releases, all should be good. That being said, I've been using TopLink Essentials more and more, and after a while, you get into this weird Zen state and actually start to recognize and understand the error messages. When you do, it actually works pretty well. That being said, I still think those error messages are nuts.
Tuesday, February 26, 2008
I'm Tired of Closing Files
Not long ago, color commentator Bruce Eckel shocked the Java world with his article entitled: "Java: Evolutionary Dead End".
The press went wild stating that Java was doomed since one of its biggest supporters was now shunning it. If you actually read the article, this doesn't call for the end of Java, just slowing down or completely stopping the adoption of new features to the language akin to what C and C++ are today. C and C++ are governed by slow ISO committees that make a new language specification every ten years or so. Instead, he argues, hit the reset button and make a new language on top of the JVM. Certainly, the JVM is no longer a stranger to non-Java languages, both Groovy and JRuby seem to be carving a niche for themselves.
Furthermore, the Java virtual machine, at least the one from Sun, is constantly improving both in terms of speed and memory consumption. The version 6 virtual machine of HotSpot from Sun is nothing short of spectacular. New language, same great infrastructure, sounds perfectly reasonable doesn't it?
Now, why would he choose such a tittle? I'm familiar enough with this author, I probably still have the 1st edition of Thinking in C++ somewhere, to know that it was probably on purpose. He knew the attention he would get with this kind of title than with one that more accurately portrayed the contents of his article. Nonetheless, it made a lot of people think about the core issue, should Java be frozen or not?
I've been thinking about that lately and I've come to the conclusion that I'm tired of closing files or any other type of resources for that matter. I think it's reasonable to freeze Java (the language) but only after it has indeed reached adulthood. You can talk about Java 7's closures, asynchronous I/O and super packages all you want but it doesn't change the fact that I'm still sick of closing files.
With a garbage collector present, it is no longer clear when the destructor/finalizer of a class will execute. If I were to write a program that operates on files, I would have to manually close any file object created or risk running out of file descriptors depending on the operating system I am running on. The same can be said for any object that holds kernel level resources. Coming from C++, this is something I no longer needed to care about, why should I care about it in Java?
C# does something interesting here, any object that implements the IDisposable interface can be used inside a "using" statement. This means that at the end of the "using" block, the dispose method is automatically called. Something like this:
In C++, the resource initialization is acquisition idiom is increasingly popular, made even more popular by the use of smart pointers, so assuming the use of shared_ptr here:
All this to say, that the equivalent construct is missing in Java. Not only, but I don't like the C# solution as it's possible to go further.
If you have multiple "using" (or "if") blocks, why can't we just make a list? In other words, if I can acquire this list of resources, then execute the block otherwise don't? For example:
The press went wild stating that Java was doomed since one of its biggest supporters was now shunning it. If you actually read the article, this doesn't call for the end of Java, just slowing down or completely stopping the adoption of new features to the language akin to what C and C++ are today. C and C++ are governed by slow ISO committees that make a new language specification every ten years or so. Instead, he argues, hit the reset button and make a new language on top of the JVM. Certainly, the JVM is no longer a stranger to non-Java languages, both Groovy and JRuby seem to be carving a niche for themselves.
Furthermore, the Java virtual machine, at least the one from Sun, is constantly improving both in terms of speed and memory consumption. The version 6 virtual machine of HotSpot from Sun is nothing short of spectacular. New language, same great infrastructure, sounds perfectly reasonable doesn't it?
Now, why would he choose such a tittle? I'm familiar enough with this author, I probably still have the 1st edition of Thinking in C++ somewhere, to know that it was probably on purpose. He knew the attention he would get with this kind of title than with one that more accurately portrayed the contents of his article. Nonetheless, it made a lot of people think about the core issue, should Java be frozen or not?
I've been thinking about that lately and I've come to the conclusion that I'm tired of closing files or any other type of resources for that matter. I think it's reasonable to freeze Java (the language) but only after it has indeed reached adulthood. You can talk about Java 7's closures, asynchronous I/O and super packages all you want but it doesn't change the fact that I'm still sick of closing files.
With a garbage collector present, it is no longer clear when the destructor/finalizer of a class will execute. If I were to write a program that operates on files, I would have to manually close any file object created or risk running out of file descriptors depending on the operating system I am running on. The same can be said for any object that holds kernel level resources. Coming from C++, this is something I no longer needed to care about, why should I care about it in Java
C# does something interesting here, any object that implements the IDisposable interface can be used inside a "using" statement. This means that at the end of the "using" block, the dispose method is automatically called. Something like this:
The problem I have with that is that it's still bound to one variable per "using" block. So, to copy a file to another, I need at least two "using" blocks.
using System;
using System.IO;
class Program {
static void Main(string[] args) {
using (Stream stream = File.Open("foo", FileMode.Open)) {
// Operate on stream to foo
}
}
}
In C++, the resource initialization is acquisition idiom is increasingly popular, made even more popular by the use of smart pointers, so assuming the use of shared_ptr here:
if (shared_ptr<x> p = someManager.get(id)) {
// operate on p
} else {
// p is also not in scope here
}
// p is no longer visible
All this to say, that the equivalent construct is missing in Java. Not only, but I don't like the C# solution as it's possible to go further.
If you have multiple "using" (or "if") blocks, why can't we just make a list? In other words, if I can acquire this list of resources, then execute the block otherwise don't? For example:
// Fake Java code sampleInstead, I have to do something like:
using (FileChannel r = new FileInputStream(path).getChannel(),
WritableByteChannel w =
Channels.newChannel(response.getOutputStream())) {
r.transferTo(0, length, w);
} finally {
// handle failure
}
// might throwI write a lot of Java code now and I'm really enjoying it, I wouldn't go back to C++ at this point. C++ is only the last resort language now, the language that makes things work if it doesn't anywhere else. So, when I hear things about freezing Java, I think about things like this. I wonder how much time Mr. Eckel spends writing code versus teaching it. As an educator, I can understand the importance of a non-moving target, but in the field, I need relief for some common idioms. Saying let's do a new language won't make all the tooling that's available today for Java suddenly appear on that language. For example, I really like Groovy but I don't use it. The IDE support in NetBeans just isn't good enough for me to work with it.
FileChannel fc = new FileInputStream(file).getChannel();
WritableByteChannel w =
Channels.newChannel(response.getOutputStream());
if (w != null)
fc.transferTo(0, file.length(), w);
// null or not, w is still in scope
// Don't really have to close, but waiting for GC might be fatal later on
fc.close();
BDJ Revisited
My last blog entry talked about Blu-Ray Java a.k.a. BDJ. Hanging out in the groups however, not all is well in the land of BDJ.
The first problem is fragmentation. BDJ is really young and the fact that fragmentation is already a problem is something I find completely unacceptable. Fragmentation means that either the reliability or availability of the code that ships with the device varies enough that you have to change your application code to work around bugs or missing features. In layman's term, it means you need to ship different SKUs and that costs money. Money to package, money to validate and money to distribute. Java ME fragmentation has really gotten out of control these last few years. The Transformers movie tie-in game is one of the biggest Java ME project ever undertaken. In all, some 25,000 SKUs shipped in order to support all the phones out there. Yes, that's 25,000, twenty five thousand SKUs. I can only imagine what the cost of getting that game to run on all these handsets was. No horror story of this magnitude in the land of BDJ yet, however the "Chicken Little" movie application apparently had 30 different variants in order to run.
Not all is lost however. Unlike Java ME (CLDC or CDC variants) on phones. The Java ME/CDC stack that is shipped with BDJ is upgradeable. If your device is networked, it can phone home and check for upgrades. If your player isn't networked, upgrades can still ship with a movie disk. I'm not sure what the experience is for the end user considering most users won't even understand what this is upgrading in the first place but let's hope it's very transparent.
For the moment anyway, this needs to be dealt with. Content authors are overwhelmingly choosing HDMV for their content over BDJ. Only 30 of the 600 or so Blu-Ray movies that have shipped, i.e., roughly 5%, use BDJ.
It could be just familiarity with HDMV since these authors have been using it for quite some time on regular non-HD disks, or could it be the complete lack of tools? This being the second problem. I've blogged before about JavaFX. JavaFX is many things, but what it really is a codeword to right all the past wrongs of Java on the client. So, even if we haven't seen any JavaFX authoring tools for designers, Sun has confirmed that it's working on components for Adobe products to output JavaFX scripts. Now that could be something that is enticing for content authors. The HDMV tools don't even come close to the Adobe design tools.
Finally, my last gripe is why did anyone even bother with Java ME in the first place for these devices? For crying out loud, these devices can decode and output 1080p video. I think they can handle the full Java SE platform. Considering that Sun has announced their intention to eventually phase out Java ME over the next decade to converge with Java SE, did they really have to add another few hundred million devices as part of that phase out plan?
The first problem is fragmentation. BDJ is really young and the fact that fragmentation is already a problem is something I find completely unacceptable. Fragmentation means that either the reliability or availability of the code that ships with the device varies enough that you have to change your application code to work around bugs or missing features. In layman's term, it means you need to ship different SKUs and that costs money. Money to package, money to validate and money to distribute. Java ME fragmentation has really gotten out of control these last few years. The Transformers movie tie-in game is one of the biggest Java ME project ever undertaken. In all, some 25,000 SKUs shipped in order to support all the phones out there. Yes, that's 25,000, twenty five thousand SKUs. I can only imagine what the cost of getting that game to run on all these handsets was. No horror story of this magnitude in the land of BDJ yet, however the "Chicken Little" movie application apparently had 30 different variants in order to run.
Not all is lost however. Unlike Java ME (CLDC or CDC variants) on phones. The Java ME/CDC stack that is shipped with BDJ is upgradeable. If your device is networked, it can phone home and check for upgrades. If your player isn't networked, upgrades can still ship with a movie disk. I'm not sure what the experience is for the end user considering most users won't even understand what this is upgrading in the first place but let's hope it's very transparent.
For the moment anyway, this needs to be dealt with. Content authors are overwhelmingly choosing HDMV for their content over BDJ. Only 30 of the 600 or so Blu-Ray movies that have shipped, i.e., roughly 5%, use BDJ.
It could be just familiarity with HDMV since these authors have been using it for quite some time on regular non-HD disks, or could it be the complete lack of tools? This being the second problem. I've blogged before about JavaFX. JavaFX is many things, but what it really is a codeword to right all the past wrongs of Java on the client. So, even if we haven't seen any JavaFX authoring tools for designers, Sun has confirmed that it's working on components for Adobe products to output JavaFX scripts. Now that could be something that is enticing for content authors. The HDMV tools don't even come close to the Adobe design tools.
Finally, my last gripe is why did anyone even bother with Java ME in the first place for these devices? For crying out loud, these devices can decode and output 1080p video. I think they can handle the full Java SE platform. Considering that Sun has announced their intention to eventually phase out Java ME over the next decade to converge with Java SE, did they really have to add another few hundred million devices as part of that phase out plan?
Tuesday, February 19, 2008
HD-DVD is Dead. Where's the SDK for BDJ again?
So, it finally hit the fan. Toshiba has ended its HD-DVD business. This obviously impacts consumers since most people have wisely decided to stay away from this market until one format won out against the other.
What consumers don't know about these mortal enemies is that this war was being fought on two fronts. The other front being software, mainly codecs and platforms. Unbeknownst to the regular DVD Joe and Sally, all Blu-Ray players are shipped with Java ME.
Considering the horror that is Java ME on phones, you'll be happy to know that the Java ME that ships on Blu-Ray devices is the CDC profile. The CDC profile has considerably more features than the CLDC one that usually ships on phones but still falls short of .Net Compact and Java SE. Unfortunately, the CDC still has many optional packages too which means that fragmentation card is still in the deck. I'm not sure anymore if .Net Compact was shipping on HD-DVD players, information on the subject is very scarce but my belief is that it was. I know for a fact that .Net Compact ships on the X-box 360.
Officially, the Java that ships on Blu-Ray is called BDJ and they are basically two profiles, one that offers networking and the other one does not. So, for example, the Java that ships with the PS3 is BDJ with networking. Well, all these features are basically meant to offer a richer interactive experience on BR disks. However, with the rise of casual gaming and the presence of USB ports on most of these devices, I wouldn't be too surprised if some games started coming down the pipe using this technology. The problem so far has been about getting an SDK. In other words, BDJ has not been widely available since the movie studios aren't sure if they want developers writing code for these devices. The fear is that these SDKs will be used for cracking the copy protection of disks.
Well, I don't know if this coincidental or not, but we are finally starting to see BDJ related bits being made publicly available. You can see a introduction to BDJ from its main architect here. The HD cookbook project is also available from java.net.
So what does this all mean for consumers and developers? Well, if you bought an HD-DVD drive, welcome to the world of betamax. If you bought a Blu-Ray player, congratulations, you'll be able to get content for many years to come. For the Java developer, it means yet another way to leverage your existing skill set. With potentially hundreds of millions of Blu-Ray players that will be sold in the next few years, you have yet another avenue to market applications. For the .Net Compact developer, you still have a small, but sturdy niche of Windows CE based smart phones that you can still code for but that's about it.
What consumers don't know about these mortal enemies is that this war was being fought on two fronts. The other front being software, mainly codecs and platforms. Unbeknownst to the regular DVD Joe and Sally, all Blu-Ray players are shipped with Java ME.
Considering the horror that is Java ME on phones, you'll be happy to know that the Java ME that ships on Blu-Ray devices is the CDC profile. The CDC profile has considerably more features than the CLDC one that usually ships on phones but still falls short of .Net Compact and Java SE. Unfortunately, the CDC still has many optional packages too which means that fragmentation card is still in the deck. I'm not sure anymore if .Net Compact was shipping on HD-DVD players, information on the subject is very scarce but my belief is that it was. I know for a fact that .Net Compact ships on the X-box 360.
Officially, the Java that ships on Blu-Ray is called BDJ and they are basically two profiles, one that offers networking and the other one does not. So, for example, the Java that ships with the PS3 is BDJ with networking. Well, all these features are basically meant to offer a richer interactive experience on BR disks. However, with the rise of casual gaming and the presence of USB ports on most of these devices, I wouldn't be too surprised if some games started coming down the pipe using this technology. The problem so far has been about getting an SDK. In other words, BDJ has not been widely available since the movie studios aren't sure if they want developers writing code for these devices. The fear is that these SDKs will be used for cracking the copy protection of disks.
Well, I don't know if this coincidental or not, but we are finally starting to see BDJ related bits being made publicly available. You can see a introduction to BDJ from its main architect here. The HD cookbook project is also available from java.net.
So what does this all mean for consumers and developers? Well, if you bought an HD-DVD drive, welcome to the world of betamax. If you bought a Blu-Ray player, congratulations, you'll be able to get content for many years to come. For the Java developer, it means yet another way to leverage your existing skill set. With potentially hundreds of millions of Blu-Ray players that will be sold in the next few years, you have yet another avenue to market applications. For the .Net Compact developer, you still have a small, but sturdy niche of Windows CE based smart phones that you can still code for but that's about it.
Sunday, February 17, 2008
No More Heroes Again
I just finished the game. This is what fun is all about. In any case, I want a sequel. So go buy it. If you don't own a Wii, there's never been a better excuse.
In any case, if you have played the game and are wondering what Jeane was talking about at the end, it's available from YouTube. No wonder it was fast forwarded in the game, that "M" rating would have turned to an "AO" one real easy. If you haven't played it yet, don't watch it, it spoils pretty much the ending.
In any case, if you have played the game and are wondering what Jeane was talking about at the end, it's available from YouTube. No wonder it was fast forwarded in the game, that "M" rating would have turned to an "AO" one real easy. If you haven't played it yet, don't watch it, it spoils pretty much the ending.
Subscribe to:
Posts (Atom)