Archive for September, 2006

D is Neither C++ Nor java

Friday, September 15th, 2006

Get it in your head right now: D is not C++ and D is not Java!

There is a natural tendency when learning a new language to, initially, attempt to use it the same as a language you are more familiar with. This is especially true when the two languages are similar in syntax. Since most newcomers to D seem to primarily come from C++ and Java, and since D is similar to both languages in many respects, people are naturally trying to shoehorn C++ and Java idioms into D, sometimes becoming frustrated when things don’t work as they expect.

Feature requests for functionality found in other languages are not uncommon on the D newsgroup. I personally think Walter has done a great job of sticking to his guns for the most part. Granted, some of the features that he relented on after the community harrassed him have turned out to be incredibly useful. Some have even given D a unique flavor that really sets it apart.

I would love to see reflection/introspection capabilities similar to Java or C#. That would really put D in a unique position, being the statically compiled systems language that it is. I wouldn’t mind seeing a more explicit syntax for properties, but it’s not something I consider a deal breaker. I can do without assignment overloads, but if such a thing ever did make it in, I wouldn’t cry about it.

So I have my opinions and everyone else has their own. But it’s not the feature requests and wishlists in and of themselves that prompted this post. It’s the reasoning behind some of them. I get the impression that some feature requests are made not because they are great ideas that would improve the language, but because they would bring D more in line with language X.

I shall repeat myself: D is not C++ and D is not Java!

One of the reasons so many C++ programmers have such a disdain for Java is because they can not, or will not, take their C++ hats off long enough to learn that Java isn’t C++. I have seen enough microbenchmarks, which are generally useless anyway, coded in Java by C++ programmers to know that C++ programmers can’t write Java code. When you whip out a Java compiler, you have to be wearing a Java hat.  Operator overloading is not a feature in Java, so if you are thinking in Java you won’t miss it. The same holds true in reverse, of course — Java programmers need to be wearing a C++ hat when Stroustrup comes off of the shelf.

One more time: D is not C++ and D is not Java!

When you come to the Land of D, drop whatever hat you are wearing at the gate. Keep your fundamentals, because you’ll need those. Keep the memory of what it was like to wear that other hat, because sometimes those C++ or Java tricks may come in handy in the D world. But under no circumstance should you expect to find yourself on familiar terrain. Sometimes you will, but familiar does not mean identical.

The next time you see yourself looking for that C++ or Java feature that D doesn’t have, ask yourself which hat you are wearing. When you have the D hat on, most of the time you’ll find that you just don’t need that feature at all.

Technorati Tags: , ,

Commercial Indie Game Goes Open-Source With D

Sunday, September 10th, 2006

A few years back Kai Backman released a game called Space Station Manager. Over time, that game evolved into a grander project called ShortHike. ShortHike was originally developed with C++, but a couple of years ago Kai began the transition to D.

I was just checking up on the project to see how the D version had progressed and was surprised to learn that, as of September 4th, ShortHike has gone open source. The code is released under the Apache 2.0 License. You can browse the source online at the ShortHike developer’s page and read more about the open source release in the ShortHike forums.

Technorati Tags: , , ,

Derelict-style Bindings for GLUT

Saturday, September 9th, 2006

Bradley Smith created Derelict-style bindings for Mark Kilgard’s GLUT (OpenGL Utility Toolkit). While I won’t be adding the package to the Derelict distribution, I do encourage anyone who wants to use GLUT from D to check it out. Creating Derelict bindings can be a tedious process sometimes, so it would be a shame to see no one use it after he put the effort into it. This is a direct link to the zip. One thing to note — he said it hasn’t  yet been tested on Linux, so you Linux-types are on your own. Enjoy!

Technorati Tags: , , ,

DDL 1.2 Beta

Tuesday, September 5th, 2006

Eric Anderton has released 1.2 beta of DDL. From the NG post:

This beta release features OMF object support that is stable and works
very well with the Win32 version of DMD.  Linux support, completed
documentation and tutorials are all still pending completion in the next
few months.

Technorati Tags: ,

SDWF 0.56

Friday, September 1st, 2006

Stewart Gordon has released SDWF 0.56. In addition to a couple of enhancements to SDWF, this releases includes a new tool Stewart calls RC2D (I keep wanting to type R2D2). RC2D extracts the defines from Windows resource modules (.rc) and places them in D modules for easy inclusion in your SDWF (or other Win32 in D) projects.

Technorati Tags: , ,