www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Needed Keywords for java compatability [throws-instanceof]

reply kortex <kortex_member pathlink.com> writes:
i know in advance that D is great but as a javanese i [we] need some missing
keywords for COMPATABILITY with java i mean throws for checked exceptions
and instanceof of checkd typecasting
i know i can do everything with D but with a large code i [we] need to transform
from java to D it is a tedious work
so we NEED these keyword just for COMPATABILITY .
----------------------------------------------- 
CONSTRUCTOR:
i don't know why you choose to make D constructor like this 
i mean using this keyword as constructor 
i think it is a bad idea , inconvenient and unreadable for a while
i think you also must use the C++/java style for constructor
and this FOR COMPATABILITY only.
--------------------------------------------------
THANK YOU
kortex
Aug 12 2005
next sibling parent Sean Kelly <sean f4.ca> writes:
In article <ddig7b$m8m$1 digitaldaemon.com>, kortex says...
i know in advance that D is great but as a javanese i [we] need some missing
keywords for COMPATABILITY with java i mean throws for checked exceptions

As a C++ programmer, I think throws clauses are far more trouble than they're worth. Particularly for a language that can call C code which may in turn generate system errors that propagate as exceptions.
and instanceof of checkd typecasting

Dynamic typing will improve as D matures. Sean
Aug 12 2005
prev sibling next sibling parent reply Mike Parker <aldacron71 yahoo.com> writes:
kortex wrote:
 i know in advance that D is great but as a javanese i [we] need some missing
 keywords for COMPATABILITY with java i mean throws for checked exceptions
 and instanceof of checkd typecasting
 i know i can do everything with D but with a large code i [we] need to
transform
 from java to D it is a tedious work
 so we NEED these keyword just for COMPATABILITY .

For what it's worth, I'm a long time Java user and I utterly disagree with you. If D were to add keywords and operators to ease your issues of porting Java projects, where does it end? From how many other languages should keywords be added? While I would love to see some particular Java features implemented in D (reflection, introspection, dynamic instantiation), I don't expect them to be implemented the 'Java way'. Think of it this way, if you move to D permanently you only need to port the project once.
 ----------------------------------------------- 
 CONSTRUCTOR:
 i don't know why you choose to make D constructor like this 
 i mean using this keyword as constructor 
 i think it is a bad idea , inconvenient and unreadable for a while
 i think you also must use the C++/java style for constructor
 and this FOR COMPATABILITY only.
 --------------------------------------------------

D is not Java. D is not C++. The reason it seems foreign to you is that you are not 'Thinking in D'. Once you've worked with D for a while, this() as a constructor becomes quite natural. And contrary to your difficulties, I now find it much more readable than having constructors named after the class - this() just jumps out immediately and screems 'I'm a constructor!' because it's identical for every class. Maybe it will do the same for you over time.
Aug 12 2005
parent Dejan Lekic <leka entropy.tmok.com> writes:
Mr. Parker I was about to say almost the same as You did.
I, as C++ user, could (acually i would not - but just for an example :)
require *_cast , throws, using (...) keywords; Modula-3 developers would
require lock, thread, unsafe ; C# developers would require something else...

Kind regards

Dejan

-- 
...........
Dejan Lekic
  http://dejan.lekic.org
  
Aug 12 2005
prev sibling next sibling parent Chris Sauls <ibisbasenji gmail.com> writes:
kortex wrote:
 and instanceof of checkd typecasting

Already can be done, using cast(). # // Java # if (obj instanceof Foo) # // ... # // D # if (cast(Foo)obj !is null) # // ... -- Chris Sauls
Aug 12 2005
prev sibling parent reply =?utf-8?B?RGF3aWQgQ2nEmcW8YXJraWV3aWN6?= <araelx gmail.com> writes:
On Fri, 12 Aug 2005 17:45:47 +0200, kortex <kortex_member pathlink.com>  
wrote:

 so we NEED these keyword just for COMPATABILITY .

I dare to say, that java needs to drop this keywords for compatibility with D. Not reverse. Ha! :> ;) -- Dawid Ciężarkiewicz
Aug 12 2005
parent reply AJG <AJG_member pathlink.com> writes:
In article <op.svewd2yo58xlqs localhost.localdomain>,
=?utf-8?B?RGF3aWQgQ2nEmcW8YXJraWV3aWN6?= says...
On Fri, 12 Aug 2005 17:45:47 +0200, kortex <kortex_member pathlink.com>  
wrote:

 so we NEED these keyword just for COMPATABILITY .

I dare to say, that java needs to drop this keywords for compatibility with D. Not reverse. Ha! :> ;)

I second this notion and propose, furthermore, that the language Java be known henceforth as D--. Sun? --AJG.
Aug 12 2005
parent Hasan Aljudy <hasan.aljudy gmail.com> writes:
AJG wrote:
 In article <op.svewd2yo58xlqs localhost.localdomain>,
 =?utf-8?B?RGF3aWQgQ2nEmcW8YXJraWV3aWN6?= says...
 
On Fri, 12 Aug 2005 17:45:47 +0200, kortex <kortex_member pathlink.com>  
wrote:


so we NEED these keyword just for COMPATABILITY .

I dare to say, that java needs to drop this keywords for compatibility with D. Not reverse. Ha! :> ;)

I second this notion and propose, furthermore, that the language Java be known henceforth as D--. Sun? --AJG.

D-- LOL! You have a point there, we must deal with other languages from a position of strength.
Aug 12 2005