Re: Java versus Python

  • From: Jamal Mazrui <empower@xxxxxxxxx>
  • To: programmingblind@xxxxxxxxxxxxx
  • Date: Tue, 21 Jun 2011 11:04:49 -0400 (EDT)

I just researched this, and stand corrected. I thought that C# 4.0 depended on .NET 4 in order to implement default and named parameters, but that does not seem to be the case because Visual Basic .NET has included that feature for years. It looks like it is accomplished by use of attributes in the IL that a compiler produces. So C# 4.0 has a smarter compiler that can read and write the necessary attributes to support this feature.



Jamal
On Tue, 21 Jun 2011, Christopher Coale wrote:

Date: Tue, 21 Jun 2011 07:08:25 -0700
From: Christopher Coale <ccoale427@xxxxxxxxx>
Reply-To: programmingblind@xxxxxxxxxxxxx
To: programmingblind@xxxxxxxxxxxxx
Subject: Re: Java versus Python

Not to be picky, but let me correct you on that. Named arguments are a feature of C# 4.0, not .NET 4.0. You can use named arguments using .NET 1.1 if you wish, so long as you use Visual Studio 2010 (in order to use C# 4.0).

On 6/21/2011 6:52 AM, Jamal Mazrui wrote:
I think reasoned debates on these topics are appropriate for this list, as long as we avoid getting personal.

I'm curious -- does Java have optional and named arguments like Python? I think these are generally a superior way of overloading functions as compared to defining multiple functions with the same name but different parameter types. It took until version 4 of the .NET Framework for these to be added as capabilities that a .NET language can use.

I also think it is worth pointing out that Python generally assumes interfaces rather than data types. So, any type supporting, say, the iterable interface, can be passed to a function that relies on that capability, be it a string, list, tuple, etc. If the object passed does not support the expected interface, a runtime error occurs.

Jamal

__________
View the list's information and change your settings at //www.freelists.org/list/programmingblind


__________
View the list's information and change your settings at //www.freelists.org/list/programmingblind

__________
View the list's information and change your settings at //www.freelists.org/list/programmingblind

Other related posts: