Label Cloud

Showing posts with label Java. Show all posts
Showing posts with label Java. Show all posts

Monday, December 08, 2008

Incremental Shortcuts in Eclipse

I am fairly new to Eclipse, but the more I use it, the more I like it.

My latest discovery is how efficient it is to use of shortcuts to find "stuff" in Eclipse. The lookups are incredibly fast and are very useful.

There is Open Type (CTRL+SHIFT+T) and start typing

image

Open Method (CTRL+O) and start typing

image

The typing part is critical. It is available even in preferences setup.

image

I really wish this functionality would exist out of the box in Visual Studio.


Share/Save/Bookmark

Saturday, May 31, 2008

1st Java annoyance

For the last month I've spent as much time writing Java code as C# code. And its definitely been a great learning experiences. Even though the core languages are very much alike, and you can usually find a function in .NET that corresponds to Java and the other way around, I've spent quite a bit of time yesterday trying something that should have been completely trivial.

The Problem:

having a Date variable loadDate that includes Date and Time, create two variables startDate and endDate where StartDate is the portion of the loadDate, and endDate is the startDate + 1 day

C# Code:

DateTime loadDate = DateTime.Now; DateTime startDate = loadDate.Date; DateTime endDate = startDate.AddDays(1);

Java Code#

GregorianCalendar cal = new GregorianCalendar( loadDate.getYear() + 1900, loadDate.getMonth(), loadDate.getDate()); Date startDate = cal.getTime(); cal.add(Calendar.DATE, 1); Date endDate = cal.getTime();

Why is the Date.getYear() function returning 108 for a year 2008? What is the logic behind that? Are the Java developers afraid of running out of integer values?

Why the Calendar class supplies the clearDate() function, but no clearTime() function?

Why I can't dd Dates the way I can other classes?

Why the Calendar.add() function doesn't return a result instead of replacing the internal value, the way other classes do?

Why is this not documented in the Date class?


Share/Save/Bookmark

Tuesday, October 02, 2007

Working with Java (pure Java)

Last couple of weeks I was writing a lot of code for a Proof Of Concept project. Having to switch from my "native" C# to Java brought out a very interesting experience. Here are some high lights

  • Java is not as evil as it might seems at first. - It is fast, clean and has LOTS and LOTS of libraries and tools available to support your work.
  • It is very possible port logic from GOOD C# code to java code. I am talking about server side code, not WinForms. The development style is very similar. The APIs and Frameworks are so similar, that often the difference in code is only the casing of the function calls.
  • Eclipse Rocks! - So far, I've worked in eclipse, and am totally loving it. One one hand it is a very easy to understand UI with great support for development. On the other hand, it has more options and variations then any other development tool I've ever seen. I wish someone would have adopted it for .NET development.
  • Some things I still don't understand and / or miss. For example - Properties definition instead of using Getters/Setters. Ability to write services. I am still not sure how to run Java daemons in a Unix environment, but for Windows they have to be wrapped into 3rd party tools.
  • It seems that Garbage Collection is implemented better in .NET. I've never had to worry about maximum and minimum heap sized, or freezes within my application for GC run. It seems that those are often the topic sand concerns of the Java world. I've hit the "Out of memory" exceptions on multiple occasions so already. The only time I've ever received one in .NET was with a recursion bug.

Overall. The experience of writing in a different language is excellent. It gives you a very different (and often the same) perspective on software development. I probably would have the chance to learn a new language if I can't apply it, however, if there is a way to apply a new language - I would say - Go for it.

Technorati Tags: , ,


Share/Save/Bookmark
Directory of Computers/Tech Blogs