Fog Creek Software
Discussion Board




.Net devs that went to Java and won't go back?

I meet a *lot* of former Java devs doing .Net. Former as in "I'm not going back" - they have issues with the language, the IDEs (plural, and spoken with scorn), with broken frameworks, etc.

Obviously, in my line of work, those are the people I'm likely to meet. :-)

I'm curious - do we have people here who have delivered .Net apps, but left .Net for Java and now wouldn't go back if they were paid to? What are the reasons for disliking .Net?

Philo

Philo
Wednesday, July 14, 2004

I hear a lot of folks comment that .NET gets everything right that Java gets wrong, but I'm not yet knowlegable in .NET to make a jugement.  I'm still learning C#

muppet
Wednesday, July 14, 2004

I've used both, and they're both tools. I think .NET is a better all around toolset for the work that I do compared to Java. I would be fine being paid to write either one. I'd prefer to be paid to write Ruby. ;)

Brad Wilson (dotnetguy.techieswithcats.com)
Wednesday, July 14, 2004

Make .NET run better on *NIX servers damn it.  There is no cross platform story for .NET from Microsoft, although I give the mono guys a lot of credit.

As a developer I like .NET (except for value types and boxing (ack) ).

As an admin I hate that I am stuck on Windows and IIS.  Why do you still have to do most of your admining through the UI?  Plus I still don't trust its security.  I've just been burned once too many times by IIS.  Plus kernel mode HTTP --  what crack addict came up with that idea? 

christopher (baus.net)
Wednesday, July 14, 2004

From 1997 up until last year I had been developing in Java. I really like the language from an OO perspective but in my current gig I'm developing in .Net (mixture of C# and VB.Net).

Would I go back to Java. Absolutely - I have barely any complaints with it.

Reasons for disliking .Net? Not so much language based, but more to do with the tools. Even with the Resharper plugin, Visual Studio 2003 just rankles me. I really miss the power of IntelliJ Idea.

As an aside, it amazes me the number of people who say "gee, isn't .Net amazing because it can do XYZ". I just shrug and tell them Java has had that functionality for ages... ;-)

TheGeezer
Wednesday, July 14, 2004

I do both.  They're about equally good.  .Net cleans up the language a bit, but there are a lot more good APIs available in Java.  So, for my own projects I'd choose Java.  But in general I'll do whatever pays.  There's really very little difference.

Dan G
Wednesday, July 14, 2004

"Why do you still have to do most of your admining through the UI?"

Not everything is in here, but probably more than you're aware of:
http://www.amazon.com/exec/obidos/tg/detail/-/0596001487/

(I have a copy on my desk)

Philo

Philo
Thursday, July 15, 2004

I meet alot of developers who are moving away from .NET to Java or even not considering .NET as anything that is mature enough to even get a second of their time. They are giving the  .NET technology 5 more years to mature and waiting for all the numerous security holes to show up.

Ha
Thursday, July 15, 2004

Give me .NET anyday. Java is a mother in law to manage.
Java/JSP is  pure hell man. I downloaded Sun  Forte once when i was in college, and did i suffer?.

Everything is a damned struggle. There is this specific directpry you need to put the classes12.zip to connect to oracle from Forte. No proper help at all.  The IDE is so slow that it takes forever to load.  One day i moved some JSP files to the server and the same application is not working there.

We got it to work of course, but its a hell for beginners. Now, experienced folks, dont flame me when i say java sucks.It may be a good tool once you know it in depth, but just to get some work done quickly, java is hell.

Asa  aprogramming language, VB.NET still sucks i think. But its light years ahead in usability and ease of use.

I actually use another tool from Gupta corporation for coding.




Karthik
Thursday, July 15, 2004

you're trying to set up an IDE for Java, and you complain that you can't get things done quickly in it?

Text editors are your friend, son.  I write all my java code in syn, which is little more than a glorified notepad.

muppet
Thursday, July 15, 2004

A while back Phil (call me Phillip) Greenspun wrote a note about how the students in his web development class got to chose the language they used during the semester.

The PHP and .Net/c# guys were doing ok, but the Java boys were failing and wanting to switch languages.

Billy Joel on Software
Thursday, July 15, 2004

If all I cared about was developing apps for Windows devices, I'd probably go with .NET too.  It's got a lot going for it.

I mean, even outside of the fact that Java runs on many architectures (not even is biggest selling point for me), it just has a lot of nice stuff and makes a lot of things possible.  .NET seems to take all this a step further...for Windows.

Crimson
Thursday, July 15, 2004

Most of my experience is with Java, but i've been working with .Net recently. I'd prefer Java anyday as i find it's libraries easier to use and more logical. And unlike others, i just dislike the visual studio environment. Maybe we're doing something wrong, but it crashes quite frequently during debugging on all the machines at our office.

Karan
Thursday, July 15, 2004

I swing both ways baby, a bit of .NET and a bit of Java. In my view they are almost the same. Other than .NET being limited to Windows, I don't see much reason for using one over the other.

What gives Java the edge, as far as I am concerned, is the IDE I use. IntelliJ IDEA for Java is fantastic, and unfortunately after using it Visual Studio seems clunky.

Herr Herr
Thursday, July 15, 2004

Somewhat off topic -- but I've never talked to anyone who tried Python and didn't stay with it, despite (relative) lack of tool support compared to e.g. Java or .NET.

Me, I have mostly dislike for Java and no opinion of .NET yet.

Ori Berger
Thursday, July 15, 2004

I am using IDEAJ as environment and open source components as libraries. Once you have all the jakarta-commons packages and beanshell, well, it's a dream to work with (and you have the source of all libs so that learning becomes easier).

I started studying .NET and made some apps. Well, looks fine but the learning curve is not worth it for the apps I am doing

Phil
Thursday, July 15, 2004

"I've never talked to anyone who tried Python and didn't stay
with it"

Take a look at Ruby uses.  A lot of them, like me, moved to Ruby from Python.

More here:

http://groups-beta.google.com/group/comp.lang.ruby/browse_frm/thread/ef42af929493898f/9f8ec5f29796b710?scrollSave=&

Ged Byrne
Thursday, July 15, 2004

I really love .NET, but it has to be said that at least for now Java is more mature. There is just too much stuff in 1.1 that requires calling out to unmanaged code.

Just me (Sir to you)
Thursday, July 15, 2004

Also the direction which .NET is heading for the web, i.e. abstracting all functionality into re-usable components, all wired together with javascript, and sent differently to different browsers, is enough to make me not want to use it EVER for web based stuff. I like it for WinForms stuff, it's quick and easy and gets the job done well, but I just don't have enough control over it's web output.

That's more than enough to stop me using it for web apps, which is a shame. Any chance of you passing a note to the planning team Philo? I could give them plenty of detail about why I don't like asp.net, and it would be constructive...

Andrew Cherry
Thursday, July 15, 2004

So, Andrew, you want a phone directly to God?

lol
Thursday, July 15, 2004

As a total language junkie, four (Algol, PL/I, Asm-360, Fortran) prior to graduating Junior High, and many, many since, I was quite struck that someone found Java, the framework, and/or the libraries, sensible or logical.  I have always used structured/object oriented techniques here (despite the language blocks) but nothing in Java makes sense to me.  After wading through several books on Java, including Thinking in Java and the Java Black Book, I still don't get it.  I call Java 'C++ in a straight jacket and rubber room on 500 hits of LSD' and I mean it.

.NET?  The languages (VB.NET/C#) aren't any better, IMNSHO.  And if you want to protect yourself from the outside user/cracker-cretin, well forget it with them.  They merrily will allow you to create buffer overruns, underruns, and every other cardinal sin at the drop of a hat.  C++ wrapped around .NET is pretty doable but hard, worthwhile work.  What I do love about .NET is that the namespaces (libs) make structural/cognitive sense here.  I've been drilling down around in there since I met it and I've yet to be surprised at all.  I sure can't say that about Java!  Actually, I rarely see .NET code spewing its guts all over my system but Java sure likes to do it.  In any case, no matter what if you want to write secure code, you need to validate inputs from the user (especially potential cracker-cretins) and your outputs for each function/block/program.  I don't see any of these making that easy.  [NB:  could someone add strong typing with inherent grep-like pattern matching to a real language?)

I'm at work on a .NET project here and will be giving it a full workout as well as Mono 1.0.  It'll be interesting since I have most of the pre-.NET application equivalent worked out as well but it won't be any fun at all (exception management from hell folks).

Asides:  where Mono shines is the Mono-GTK# lash-up which will only get better methinks.  Ruby/Python, neat languages, already keeping an eye on them, more Ruby than Python.  I'd also like to see Forth.NET grow and I am most definitely NOT a Forth programmer/evangelist (Amiga/C, yep, dead on!).  It is a definite candidate for inline parameter validation.

Brian J. Bartlett
Thursday, July 15, 2004

I learnt Java, and learnt enough to work out "there needs to be something better". What I particularly didn't like at the time was the lack of a decent IDE, a formidable class structure and the performance. Perhaps these days you could write a high performance server-side app in Java but in the heady days of 2000 it was nt so easy.

.NET is the dogs bollocks. The IDE is mostly good. The class library is probably just as formidable but I was more incentivised to learn it.

Unfortunately it doesn't work on non-Windows. The Mono project seems to be attempting this but everytime I look at the classes available the ones I want to use have not yet been implemented. It only takes one or two to scupper your plans.

I was also never sure just how relieable / universal JDBC was and as databases are the cornerstone of all my development this was a big worry.

Also, back in 2000 it was looking like Java wasn't going to be supported in Windows, and if it was then it would be very begrudgingly so... which doesn't imply a reliable / safe environment.

gwyn
Thursday, July 15, 2004

gwyn,

the inclusion of that joke of a JDBC/ODBC bridge driver by Sun was a serious mistake. It gave people a bad first impression of the platform. Then again, it seems a rather typical example of the nature of the Java effort by Sun. They seemed more concerned with preventing it from running good on Windows, than giving it a fighting chance.

Just me (Sir to you)
Thursday, July 15, 2004

The thing I liked about JAVA more than .NET is that while JAVA's code can look more complicated, its syntax seems to lend itself to cleaner implementations in the long run.  Of course, I have a lot more experience with JAVA than .NET, but I am referring mostly to VB.NET programmers coming from VB and not really nesting classes that much.  Most of the VB stuff I've seen is a big, flat list of classes.  That's all well and good, but most of the JAVA stuff I've seen nests those classes more efficiently, so you don't have to trace around to figure out what the program does as much, etc.

sir_flexalot
Thursday, July 15, 2004

I am a long time Java programmer and did a small project in .NET about six months ago.  I really like it.  I do think .NET overall is slightly better (my subjective observation) but definitely not to a degree which you could not pay me to do Java again.  The competetion should be good for Java.  But since my employer uses UNIX .NET really isn't a good solution.

Bill Rushmore
Thursday, July 15, 2004

"But since my employer uses UNIX .NET really isn't a good solution."

I think that summarizes the difference in a nutshell.  Client side Windows app:  .NET.  Anything server side:  Java, because you're being irresponsible to your customer/employer if you tie yourself to just one server platform.

I work with WebObjects, which is still the most powerful web application framework I've seen, once you understand its design and architecture.  People who don't understand the design have a very hard time with it, but once you "get" it, you can really do a lot with very little code.  And Enterprise Objects Framework is still da bomb; similar open source Object/Relational tools are out there, but none are nearly as easy to configure, get up and running, develop with, and deploy, from what I've seen.

And I say this even without many significant features added in the last few years.  Other frameworks are still struggling to catch up to WO, even with WO standing still.

Jim Rankin
Thursday, July 15, 2004


If I was in a completely Windows environment with no intention of going/using things on any of the *nix's, then I might consider .Net exclusively.

Realistically though, I've always found a wealth of libraries and functionality in Java (and the Java community) that .Net just doesn't seem to have.

For example, I found an "Open Source" .Net committee a few months ago.  I started going through their hosted projects and quickly found that *none* of their things were Open Source.  They were highly overpriced libraries with dismal support, minimal documentation, and no source code available.

If I'm going to get dismal support and minimal documentation, there's no way I'm going to pay you for the compiled code.

KC
Thursday, July 15, 2004

Although I'm unlikely to go to Java (it's a great example of how to do it wrong in my book), after a few months solid of ASP.NET work, I tried porting my last project to PHP.  PHP was much much easier to work with and produced a very streamlined application.  PHP was also much easier to deploy than the .NET app.

I can't say that I won't go back to .NET.  I have a wife, two kids and a mortgage.  Language snobbery isn't a luxury I can afford.  But if I get to choose between two positions, I'll take the one that lets me use PHP.

Clay Dowling
Thursday, July 15, 2004

I've been working with Java for 7 years and .NET (C# only) for 1 year (both professionally), and I much prefer Java.  The libraries seem more complete, they're better-documented, and I like having the option of looking through the library sources for more detail on how stuff works.

I greatly prefer C# to VB, C, C++, etc., and .NET would be my tool of choice for a Windows app, but it seems to me like .NET still lags behind Java significantly.  If you compare to java 1.0, it might be a tossup, but .NET still doesn't come close to modern Java (IMHO).

Of course, I prefer inner classes to delegates, checked exceptions to unchecked (when the decision between checked/unchecked is made correctly according to the JLS), property-accessor methods to smart properties, no operator overloading, etc. - if my philosophies were more in sync with .NETs, my reaction might be different.

And .NET could have been much more compelling if DevStudio was more like Idea from the beginning.  DevStudio was best-of-breed until Idea came along, and they're miserably behind in that race as well.

schmoe
Thursday, July 15, 2004

actually, I'd like to see operator overloading in Java.

muppet
Thursday, July 15, 2004

One bit of functionality:  .NET properties!  Not having to write crappy getter & setter functions make life worth living!

anon
Thursday, July 15, 2004

why not just make them public members and be done with it, then?

How silly.  The whole point of getter/setter methods is that you're not necessarily dealing directly with the property in question.

muppet
Thursday, July 15, 2004

I think anon is saying that public field members are an advantage of .NET - that you don't need to write the get and set. Of course every best practice of .NET says that you should use a property (get/set) instead...

I really don't understand why they didn't just block public members, and added a keyword to expose a properly automatically for simple properties (where there are no rules). i.e.

private int _name;
public int Name property _name;

(or something like that)

Dennis Forbes
Thursday, July 15, 2004

Err.. I can have public members of a class in every language I code in, including PHP, Perl, Java....

how is it an advantage of .NET?

muppet
Thursday, July 15, 2004

Why? Because many are confused into thinking that in .NET

public int age;

...is equal to...

public int Age
{
  get
    {
      return _age;
    }
    set
    {
        _age = value;
    }
}

While it isn't (the IL is entirely different, and it's a breaking changing when you switch to a property from a public field member).

Dennis Forbes
Thursday, July 15, 2004

>> "why not just make them public members and be done with it, then?"

>> "I think anon is saying that public field members are an advantage of .NET - that you don't need to write the get and set. Of course every best practice of .NET says that you should use a property (get/set) instead..."

I would never think of making a data member public.  What I meant to say was, I love that .NET lets the client feel like he's working with a property.

Thing.Height = 1200
saveHeight = Thing.Height

feels more natural than

Thing.setHeight(1200)
saveHeight = Thing.getHeight()

Also, when looking at the class methods, you simply look for the property and you can see if it's read-only without having to scroll down to the set* methods.  Just a syntactical thing, but many people love it.

anon
Thursday, July 15, 2004

Ah, sorry anon. I coincidentally had a discussion with a peer who confused Java best practices with the .NET possible, so I presumed the same.

Client transparency is nice, although there's the risk I mentioned in the prior post that it actually is creating get/set code in the class user (it's language transparency, but it isn't IL transparency), which means that a lot of people are surprized when they change a backend class from using a public field member (which is sadly very common) to using a property, and previously compiled components break.

Dennis Forbes
Thursday, July 15, 2004

Woohoo, .Net turns your getters and setters into a property! Just like VB6, VB5, C++/COM, and almost every other programming environment on Earth does.

Even Flash (Actionscript 2.0) allows you to do this.  Did you live under a rock previously?

Wayne
Thursday, July 15, 2004

My current employer has been dallying with .NET for 18 months now, and is starting to (finally!) put an application in production.

However, we just hired a new CTO, and one day he asked the fateful question: "Why aren't you guys using Java?"

So, we just got through with an evaluation of the two technologies.  He's made a presentation to the CEO & the board, and they've decided that our problems *aren't* the result of mismanagement, churn, & indecision (kindly refer back to the 18 months it took to get an app into production), but the fault of the technology that was used.

So.... we're changing to J2EE, using BEA WebLogic.
[sigh]

I haven't used Java since the 1.0 jdk days (I'm seriously rusty!).  I hated it then because the tools were so primitive, but things have gotten better (I could grow to like Eclipse).  Anyone got a suggestion for a intro to EJB and J2EE technologies book or two?

I'll let you know in a few months if I want to go back to .NET.

example
Thursday, July 15, 2004


I've been impressed by everything I've ever bought from O'Reilly.  Although I can't recommend a specific book offhand, you might check there.


In the Enterprise Architecture vein, I'd recommend Martin Fowler's book on the EA Design Patterns.  It will be useful in any OOP scenario.

KC
Thursday, July 15, 2004

O'Reilly has been a crap shoot for me.  Between them and Wrox I've had good luck.  I don't particularly like the O'Reilly Learning Java book, too much theory and not enough Try This sort of examples, like Wrox has (and is the best way for me to learn)

muppet
Thursday, July 15, 2004

I switched to Java pre-.NET because I wanted the advantages of OOP without having to learn C++ (having been a former VB/ASP3.0 developer).  Then I switched to .NET because I constantly found myself in an uphill battle to integrate with the Windows network domain environment.  Also, I found managing the IIS environment far easier than that of the J2EE app servers for a one-man department.

But I'd have no problem going back to Java again.  They both have their trade-offs.

Joe
Thursday, July 15, 2004

example: Check out the Spring Framework and leave EJBs in the past: http://www.springframework.org/

Chris Winters
Thursday, July 15, 2004

> Language snobbery isn't a luxury I can afford.

What he said.

To me the *only* important questions about languages are the big-ticket ones:

1. Can the language get the job done when wielded by reasonably competent people who are trying to make it work? (Consider the Yahoo site written in Lisp as an example)

2.  Does the language have the broad industry support (tools, developers, mindshare etc) that it needs to succeed?

IMO, the Yahoo site in Lisp fails by this metric, even though the underlying implementation undoubtably succeeded.

Similarly, Ruby and Python simply don't have the same mindshare as Java and C#, regardless of their merits, and thus simply aren't considered for many tasks, again regardless of their merits.

3. Does the language have the support it needs in the particular environment that it's intended for?

.NET is probably not a good fit for a Unix shop, and if your boss is convinced that PHP is bad, it may be best to simply find another tool.

Portabella
Thursday, July 15, 2004

I'm ok programming either, but I have a feeling a lot of business owners/decision makers will go with java just because its open and free.  Personally, I think .NET's web stuff is way superior to java, but thats only a small part of development, and not enough to convince managers to spend thousands on a microsoft only solution. 

vince
Thursday, July 15, 2004

Vince -- a lot of decision makers will also pick .NET over Java because of the illusion of being supported by Microsoft.  I say illusion, because odds are you'll end up on a community website, message board, or newsgroup before you'll pay several hundred dollars to MS for a support incident.  Which of course is the same place you'd end up at with a free/OSS product, but that's how business people tend to think.

Also, MS solutions don't necessarily cost big ticket dollars.  Windows Server 2003 Web Edition (although only available via OEM) is only like $500 +/-.  And while there is a lot of OSS stuff for Java, it has plenty of pricey software in its camp too (like WebSphere).

Joe
Thursday, July 15, 2004

"Perhaps these days you could write a high performance server-side app in Java but in the heady days of 2000 it was nt so easy."

You mean like:
* eBay
* Google
* iTunes Music Store

???

Walter Rumsby
Thursday, July 15, 2004

Walter, in gwyn's defense, those are all projects with huge staff and budget allowances...to call it "easy," it shouldn't require a team of 50+ to accomplish :)

Joe
Thursday, July 15, 2004

I'm not sure the implementation of (at least a rough cut of) eBay or iTMS would be that hard - it's the business model and marketing clout that are really the hard work in those two cases. eBay's architecture is a model of simplicity.

Walter Rumsby
Thursday, July 15, 2004

>> The thing I liked about JAVA more than .NET is that while JAVA's code can look more complicated, its syntax seems to lend itself to cleaner implementations in the long run....but I am referring mostly to VB.NET programmers coming from VB and not really nesting classes that much.  Most of the VB stuff I've seen is a big, flat list of classes.  That's all well and good, but most of the JAVA stuff I've seen nests those classes more efficiently, so you don't have to trace around to figure out what the program does as much, etc.

Your criticism should be more appropriately aimed at certain .NET *developers*, not a *.NET* itself.  Can you code .NET just as neatly if not more so than Java, but you have to know what you are going in both languages.


>> Although I'm unlikely to go to Java (it's a great example of how to do it wrong in my book), after a few months solid of ASP.NET work, I tried porting my last project to PHP.  PHP was much much easier to work with and produced a very streamlined application.  PHP was also much easier to deploy than the .NET app.... I can't say that I won't go back to .NET.  I have a wife, two kids and a mortgage.  Language snobbery isn't a luxury I can afford.  But if I get to choose between two positions, I'll take the one that lets me use PHP.

For clarification, discussions of .NET and ASP.NET should be seperate.  MS definitely made some design decisions with ASP.NET which many don't agree with, but ASP.NET was built on top of the .NET framework not vice versa.  Criticisms of ASP.NET should not be taken to apply to all of .NET, and definitely not to .NET languages like C# or VB.NET.

>> One bit of functionality:  .NET properties!  Not having to write crappy getter & setter functions make life worth living!

Agreed 100%!

>> why not just make them public members and be done with it, then? How silly.  The whole point of getter/setter methods is that you're not necessarily dealing directly with the property in question.

It is not silly.  1.) Fields and Properties have different binary signatures (unfortunately) so if you code with one and later need to change your clients will need to be recompiled too.  2.) get/set properties are there for exactly that reason, i.e. not to deal directly with the property in question (though I am mixing your terms with .NETs)  Properties in .NET allow you to use normal syntax (i.e. obj.prop= value) to assign a property, but still use code in get/set routines if need be.

>> private int _name;
>> public int Name property _name;

I would LOVE it if they would do something like that.

>> While it isn't (the IL is entirely different, and it's a breaking changing when you switch to a property from a public field member).

EXACTLY (and its a damn shame MS designed in that way, IMNSHO)

>> Woohoo, .Net turns your getters and setters into a property! Just like VB6, VB5, C++/COM, and almost every other programming environment on Earth does.

From my understanding neither Java nor C++ offer get/set properties.  Am I wrong on this?

>> However, we just hired a new CTO, and one day he asked the fateful question: "Why aren't you guys using Java?"

You gotta love ideologists! :-0

>> To me the *only* important questions about languages are the big-ticket ones:

You forgot:
-- Can I find and/or afford to hire someone who has expertise in that technology?
-- What's its future?

>> Vince -- a lot of decision makers will also pick .NET over Java because of the illusion of being supported by Microsoft.  I say illusion, because odds are you'll end up on a community website, message board, or newsgroup before you'll pay several hundred dollars to MS for a support incident.  Which of course is the same place you'd end up at with a free/OSS product, but that's how business people tend to think.

A lot of business people tend to pick the thing that is most supported (see Geoffrey Moore's Crossing the Chasm.)  By support, community website, message board, and newsgroups are as much a part of that support as going to MS.  One area where .NET leads recently is MS has many of its core developers blogging about their languages, and I have learned more from reading thoses blogs that I could on a month of paid tech suport calls.  The Java community doesn't seem to offer the same level of support on their blogs (yet?)

>> "Perhaps these days you could write a high performance server-side app in Java but in the heady days of 2000 it was nt so easy." 
>> You mean like: * eBay * Google  * iTunes Music Store

Yup, those were easy apps to write and were turned out in no time in someone's garage. And without the benefit of any VC funding, I might add (not!) :-)

Mike Schinkel
Friday, July 16, 2004

"From my understanding neither Java nor C++ offer get/set properties.  Am I wrong on this?"

I don't know about C++, but for Java, that properties-style functionality is a large part of what JavaBeans are all about, and they're getting a lot of play in various frameworks because of it.

Justin Johnson
Friday, July 16, 2004

example:  Check out Matt Rabble's 'AppFuse' (which includes Spring) which should give you a jump-start into a working J2EE app, using current technologies (Spring, Hibernate, Ant, XDoclet). 

As far as a Java IDE, I'd suggest IntelliJ's IDEA.  Only if you can't get that would I suggest checking out Eclipse & NetBeans (the latter /used/ to be very slow, but the current version is supposed to be very different)

Gwyn Evans
Friday, July 16, 2004

> You forgot:

No I didn't. These are all summed up in the phrase "broad industry support".

Portabella
Friday, July 16, 2004

"What I meant to say was, I love that .NET lets the client feel like he's working with a property.

Thing.Height = 1200
saveHeight = Thing.Height"

I think this is awful.  What if the invisible getter does something like

  Height = value;
  DeleteImportantDataFile();

Silly example, yes.  But there is no indication that this might do something other than assign a value.  With the equivalent code in Java, you know for sure nothing other than the value being set is happening here.

This is the problem with operator overloading like things in general.  What appears to be happening and what is really happening might be two very different things.

I'm a big fan of simplicity in programming languages.  The characters saved by typing

  saveHeight = Thing.Height

vs.

  saveHeight = Thing.height()

aren't worth the increase in language complexity.

IMHO.

Jim Rankin
Friday, July 16, 2004

For what it's worth, a number of functional languages (Dylan and Cecil at least) consider 'x.y' to be syntactic sugar for 'y(x)'.  In those languages, then, you know when you do 'x.y' you're *always* calling a function, so there's nothing being "hidden" there.

Phillip J. Eby
Friday, July 16, 2004

"saveHeight = Thing.Height

vs.

  saveHeight = Thing.height()"

You also have to remember that with height(), you have to write the contents of the method in order to return the height -- so in addition to the two parentheses involved when calling it, you also have write

public float height()
{
  return this.height;
}

Still, I generally agree that the characters saved in typing ain't that big of a deal, especially when working with an IDE that can generate getters and setters.  In programming the primary limiting factors are thinking time and reading time, not typing time.

T. Norman
Friday, July 16, 2004

I don't know about other IDEs, but Eclipse has a function to generate simple getters and setters automatically (including boolean getters/setters), so the complaint that you have to write the function is a non-starter.  You only have to write the function body if you want more complicated functionality, in which case you'd be writing it anyway.

Justin Johnson
Friday, July 16, 2004

*  Recent Topics

*  Fog Creek Home