<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:copyright="http://blogs.law.harvard.edu/tech/rss" xmlns:image="http://purl.org/rss/1.0/modules/image/">
    <channel>
        <title>java</title>
        <link>http://geekswithblogs.net/alternativedotnet/category/10459.aspx</link>
        <description>java</description>
        <language>en-US</language>
        <copyright>Michel Grootjans</copyright>
        <managingEditor>michel.grootjans@gmail.com</managingEditor>
        <generator>Subtext Version 0.0.0.0</generator>
        <item>
            <title>java vs .net: the community</title>
            <link>http://geekswithblogs.net/alternativedotnet/archive/2009/08/31/134405.aspx</link>
            <description>Since the beginning of July, I've been working on a java project. The language is very close to C#, although it has some minor irritating differences, like the lack good generic support, extension methods and closures. The big difference however is not in the language, the tools, the libraries or the utilities. One of the big differences I've seen is the &lt;em&gt;community&lt;/em&gt;.&lt;br /&gt;
&lt;br /&gt;
I've been on many projects that have worked exclusively with Microsoft tools, libraries and (god forbid) examples. When the subject is raised of alternatives like an open source ORM or IoC container the response is predictable. It's a raised eyebrow stating clearly that non-MS solutions couldn't possibly be better than libraries like the EF, EntLib and such. Oh, and were you suggesting using anything else than stored procedures for data access?&lt;br /&gt;
&lt;br /&gt;
Your idea won't scale...&lt;br /&gt;
Your idea won't perform...&lt;br /&gt;
Your idea won't be secure...&lt;br /&gt;
Your idea will be buggy...&lt;br /&gt;
Have you thought about the maintenance ...&lt;br /&gt;
&lt;br /&gt;
Let's look over the wall now, shall we? If you announce proudly that you're going to work on a java project with hibernate and spring, you get a blank look from your fellow devs. "Duh! Of course! What else?". This best of breed approach took some years to mature but is way ahead of the default .net crowd.&lt;br /&gt;
&lt;br /&gt;
The alt.net movement, the NHibernate mafia and all those alternative folks who don't adhere to the true MSDN way of doing software development are actually very close to this. The difference is that we are there by choice and by experience. The java guys are there, almost by default. This means that the mainstream java dev knows and understands things like IoC, AoP, ORM. He might have forgotten (or doesn't know) why these practices were introduced, but he's been using them daily for some years. Just like we forgot about writing our own compilers and practicing bit shifts to divide by 2.&lt;br /&gt;
&lt;br /&gt;
I think it is our responsibility to enlighten our colleagues, one at a time, for the rest of our professional lives. To try and bridge that gap between alt.net and the mainstream .net development. And ultimately, as a community, help Microsoft on the course it is taking to embrace open source.&lt;br /&gt;
&lt;br /&gt;
Quoting a fellow alt.net colleague I value greatly: &lt;a href="http://davybrion.com/blog/2008/08/altnet-what-does-it-mean/"&gt;How on earth did it ever get this far in our industry for this mindset to be considered alternative?&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div class="zemanta-pixie"&gt;&lt;img src="http://img.zemanta.com/pixy.gif?x-id=63884d63-970f-889a-b1ff-46157c37c63b" alt="" class="zemanta-pixie-img" /&gt;&lt;/div&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=134405"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=134405" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/alternativedotnet/aggbug/134405.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Michel Grootjans</dc:creator>
            <guid>http://geekswithblogs.net/alternativedotnet/archive/2009/08/31/134405.aspx</guid>
            <pubDate>Mon, 31 Aug 2009 16:32:07 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/alternativedotnet/comments/134405.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/alternativedotnet/archive/2009/08/31/134405.aspx#feedback</comments>
            <slash:comments>11</slash:comments>
            <wfw:commentRss>http://geekswithblogs.net/alternativedotnet/comments/commentRss/134405.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/alternativedotnet/services/trackbacks/134405.aspx</trackback:ping>
        </item>
        <item>
            <title>java vs .net: the language</title>
            <link>http://geekswithblogs.net/alternativedotnet/archive/2009/08/09/133998.aspx</link>
            <description>I'd like to compare the java language to .net as I'm experiencing it. First of all, I'd like to point out that the differences are less than the similarities. Purely seen from a syntax point there really are no differences. Except of course if you're used to .net 3.5. This is irritating at first, but after a while you're just resigned to it. Take the simple properties we're so used to in .net&lt;br /&gt;
&lt;br /&gt;
Compare these two identical pieces of code:&lt;br /&gt;
&lt;em&gt;java:&lt;br /&gt;
&lt;/em&gt;&lt;blockquote&gt;&lt;font face="monospace"&gt;private int counter;&lt;br /&gt;
&lt;br /&gt;
public int getCounter(){&lt;br /&gt;
    return counter;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
public void setCounter(int value){&lt;br /&gt;
    counter = value;&lt;br /&gt;
}&lt;/font&gt;&lt;br /&gt;
&lt;/blockquote&gt;&lt;br /&gt;
&lt;em&gt;.net:&lt;br /&gt;
&lt;/em&gt;&lt;blockquote&gt;&lt;font face="monospace"&gt;public Counter{get; set;}&lt;/font&gt;&lt;br /&gt;
&lt;/blockquote&gt;I know we didn't have them before .net 3.5, and I realize the dangers of overexposing members, but I love the conciseness of automatic properties. For 7 properties I have 7 lines of code in .net and 70 lines of code in java.&lt;br /&gt;
&lt;br /&gt;
Other things you don't get in java are anonymous methods, so that's no lambdas or LINQ either. No extension methods, so bye bye to simple readability like &lt;font face="monospace"&gt;1.February(2005)&lt;/font&gt;. Access modifiers are slightly different but that's just something you accept and move in. All in all it's like having to go back to .net 2.0, which a lot of us have to do from time to time.&lt;br /&gt;
&lt;br /&gt;
However, the thing that the .net platform really nailed, compared to java, is generics. I'm going to illustrate this with an example.&lt;br /&gt;
&lt;em&gt;.net:&lt;br /&gt;
&lt;/em&gt;&lt;blockquote&gt;&lt;font face="monospace"&gt;public T Get&amp;lt;T&amp;gt;(int id)&lt;/font&gt;&lt;br /&gt;
&lt;font face="monospace"&gt;{&lt;br /&gt;
&lt;/font&gt;&lt;font face="monospace"&gt;    return session.Get&amp;lt;T&amp;gt;(id);&lt;/font&gt;&lt;br /&gt;
&lt;font face="monospace"&gt;}&lt;/font&gt;&lt;br /&gt;
&lt;/blockquote&gt;This is just not possible in java. For example, you cannot ask the type of T at runtime like this &lt;font face="monospace"&gt;typeof(T))&lt;/font&gt;. Generics are just a little syntactical sugar at design time and as a compiler check.&lt;br /&gt;
In java, your code will look like this:&lt;br /&gt;
&lt;blockquote&gt;&lt;font face="monospace"&gt;&amp;lt;T&amp;gt; public T get(Class&amp;lt;T&amp;gt; clazz, int id){&lt;/font&gt;&lt;br /&gt;
&lt;font face="monospace"&gt;    return (T) session.get(clazz, id);&lt;/font&gt;&lt;br /&gt;
&lt;font face="monospace"&gt;}&lt;/font&gt;&lt;br /&gt;
&lt;/blockquote&gt;Which makes every caller look like this:&lt;br /&gt;
&lt;blockquote&gt;&lt;font face="monospace"&gt;repository.get(Person.class, id);&lt;/font&gt;&lt;br /&gt;
&lt;/blockquote&gt;The cast to T might even fail at runtime if the type returned by &lt;em&gt;session&lt;/em&gt; is not of T.&lt;br /&gt;
&lt;br /&gt;
Primitive types are also something to get used to. In .net, you can easily do &lt;span style="font-family: Courier New;"&gt;1.ToString()&lt;/span&gt;. No such luck in java. &lt;span style="font-family: Courier New;"&gt;new Integer(1).toString()&lt;/span&gt; is the way to go, since &lt;span style="font-family: Courier New;"&gt;1&lt;/span&gt; is not an object. To me, java seems a more technical language where it is harder to express &lt;span style="font-style: italic;"&gt;intent&lt;/span&gt; without giving in too much into technical implementation.&lt;br /&gt;
&lt;br /&gt;
I might sound a little whiny in this post, but all things taken into account, I enjoy this journey into a new, albeit a similar language. I can't wait to get an offer to try Ruby on Rails ;-)&lt;br /&gt;
&lt;br /&gt;
&lt;div class="zemanta-pixie"&gt;&lt;img class="zemanta-pixie-img" alt="" src="http://img.zemanta.com/pixy.gif?x-id=cd33a01a-9493-843f-b7b0-9d4fdfbab1c0" /&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=133998"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=133998" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/alternativedotnet/aggbug/133998.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Michel Grootjans</dc:creator>
            <guid>http://geekswithblogs.net/alternativedotnet/archive/2009/08/09/133998.aspx</guid>
            <pubDate>Sun, 09 Aug 2009 15:43:53 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/alternativedotnet/comments/133998.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/alternativedotnet/archive/2009/08/09/133998.aspx#feedback</comments>
            <slash:comments>3</slash:comments>
            <wfw:commentRss>http://geekswithblogs.net/alternativedotnet/comments/commentRss/133998.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/alternativedotnet/services/trackbacks/133998.aspx</trackback:ping>
        </item>
        <item>
            <title>Polyglot programming</title>
            <link>http://geekswithblogs.net/alternativedotnet/archive/2009/08/06/133934.aspx</link>
            <description>&lt;blockquote&gt;
&lt;p&gt;For many developers, the one-language notion is a sign of lack of professionalism. This is best exemplified by the &lt;a href="http://www.pragmaticprogrammer.com/ppbook/index.shtml"&gt;Pragmatic Programmers'&lt;/a&gt; advice to learn a new language every year. The point here is that programming languages do affect the way you think about programming, and learning new languages can do a lot to help you think about solving problems in different ways.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;From Martin Fowler’s at &lt;a href="http://martinfowler.com/bliki/OneLanguage.html" title="http://martinfowler.com/bliki/OneLanguage.html"&gt;http://martinfowler.com/bliki/OneLanguage.html&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;I got the opportunity to participate in a java project since July. I’m going to share the pleasure and pain this brings to a .net developer. There are interesting differences in language, conventions, tools, application servers, IDE, … Since all I’m doing in the next weeks and maybe months will be java, you’ll hear that from me.&lt;/p&gt;
&lt;p&gt;Too bad Martin fowler ended his paragraph with:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;It's important to learn languages that are quite different in order to get the benefit of this. Java and C# are too similar to count.&lt;/p&gt;
&lt;/blockquote&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=133934"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=133934" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/alternativedotnet/aggbug/133934.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Michel Grootjans</dc:creator>
            <guid>http://geekswithblogs.net/alternativedotnet/archive/2009/08/06/133934.aspx</guid>
            <pubDate>Thu, 06 Aug 2009 06:11:59 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/alternativedotnet/comments/133934.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/alternativedotnet/archive/2009/08/06/133934.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/alternativedotnet/comments/commentRss/133934.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/alternativedotnet/services/trackbacks/133934.aspx</trackback:ping>
        </item>
    </channel>
</rss>