www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Article about problems & suggestions for D 2.0

reply Benjamin Thaut <code benjamin-thaut.de> writes:
After having used the D 2.0 programming language for a year now and 
having completed 3 projects with it, I wrote a small article about the 
problems I had with the D 2.0 programming language and what suggestions 
I have to improve it.

http://3d.benjamin-thaut.de/?p=18

Comments and criticism welcome
-- 
Kind Regards
Benjamin Thaut
Aug 27 2011
next sibling parent reply Walter Bright <newshound2 digitalmars.com> writes:
On 8/27/2011 10:16 AM, Benjamin Thaut wrote:
 After having used the D 2.0 programming language for a year now and having
 completed 3 projects with it, I wrote a small article about the problems I had
 with the D 2.0 programming language and what suggestions I have to improve it.

 http://3d.benjamin-thaut.de/?p=18

 Comments and criticism welcome
I find it very hard to read. Can you boost the font size, please? Have pity on us old guys!
Aug 27 2011
next sibling parent reply Caligo <iteronvexor gmail.com> writes:
On Sat, Aug 27, 2011 at 12:39 PM, Walter Bright
<newshound2 digitalmars.com>wrote:

 On 8/27/2011 10:16 AM, Benjamin Thaut wrote:

 After having used the D 2.0 programming language for a year now and having
 completed 3 projects with it, I wrote a small article about the problems I
 had
 with the D 2.0 programming language and what suggestions I have to improve
 it.

 http://3d.benjamin-thaut.de/?**p=18 <http://3d.benjamin-thaut.de/?p=18>

 Comments and criticism welcome
I find it very hard to read. Can you boost the font size, please? Have pity on us old guys!
Ctrl and + to increase the font size. should work on any browser.
Aug 27 2011
next sibling parent reply "Nick Sabalausky" <a a.a> writes:
"Caligo" <iteronvexor gmail.com> wrote in message 
news:mailman.2547.1314469962.14074.digitalmars-d puremagic.com...
 On Sat, Aug 27, 2011 at 12:39 PM, Walter Bright
 <newshound2 digitalmars.com>wrote:

 I find it very hard to read. Can you boost the font size, please? Have 
 pity
 on us old guys!
Ctrl and + to increase the font size. should work on any browser.
I like Ctrl-ScrollWheel. Don't know if that's cross-browser, though. Works on FF. The font size on that page is pretty small though, I had to increase it a few clicks. But it was a nice change from so many of the newer sites these days that have everything cranked up so rediculously large it feels like you're trying to view the web through a pinhole. ------------------------------- Not sent from an iPhone.
Aug 27 2011
parent Kagamin <spam here.lot> writes:
Nick Sabalausky Wrote:

 I like Ctrl-ScrollWheel. Don't know if that's cross-browser, though. Works 
 on FF. The font size on that page is pretty small though, I had to increase 
 it a few clicks. But it was a nice change from so many of the newer sites 
 these days that have everything cranked up so rediculously large it feels 
 like you're trying to view the web through a pinhole.
Selecting View - Page Style - No Style fixes colors too :3
Aug 30 2011
prev sibling parent Walter Bright <newshound2 digitalmars.com> writes:
On 8/27/2011 11:32 AM, Caligo wrote:
 Ctrl and + to increase the font size.  should work on any browser.
Thanks, I didn't know that. Tried it, it works.
Aug 27 2011
prev sibling next sibling parent Chris Molozian <chris cmoz.me> writes:
Hope this works.

Just click this link: Ingrater%u2019s 3D Blog ï¿1/2 Suggestions for the 
D 2.0 Programming Language <http://3d.benjamin-thaut.de/?p=18>

------------------------------------------------------------------------

Sent from Readability <http://lab.arc90.com/experiments/readability/> | 
An Arc90 <http://www.arc90.com> lab experiment


On 08/27/11 18:39, Walter Bright wrote:
 On 8/27/2011 10:16 AM, Benjamin Thaut wrote:
 After having used the D 2.0 programming language for a year now and 
 having
 completed 3 projects with it, I wrote a small article about the 
 problems I had
 with the D 2.0 programming language and what suggestions I have to 
 improve it.

 http://3d.benjamin-thaut.de/?p=18

 Comments and criticism welcome
I find it very hard to read. Can you boost the font size, please? Have pity on us old guys!
Aug 27 2011
prev sibling parent reply Benjamin Thaut <code benjamin-thaut.de> writes:
Am 27.08.2011 19:39, schrieb Walter Bright:
 On 8/27/2011 10:16 AM, Benjamin Thaut wrote:
 After having used the D 2.0 programming language for a year now and
 having
 completed 3 projects with it, I wrote a small article about the
 problems I had
 with the D 2.0 programming language and what suggestions I have to
 improve it.

 http://3d.benjamin-thaut.de/?p=18

 Comments and criticism welcome
I find it very hard to read. Can you boost the font size, please? Have pity on us old guys!
Increased the font size a bit, I hope it is better that way -- Kind Regards Benjamin Thaut
Aug 27 2011
parent Walter Bright <newshound2 digitalmars.com> writes:
On 8/27/2011 12:29 PM, Benjamin Thaut wrote:
 Am 27.08.2011 19:39, schrieb Walter Bright:
 I find it very hard to read. Can you boost the font size, please? Have
 pity on us old guys!
Increased the font size a bit, I hope it is better that way
Better, but still a strain to read. The browser's default font size is usually the best size to use.
Aug 27 2011
prev sibling next sibling parent Christian Kamm <kamm-incasoftware removethis.de> writes:
Benjamin Thaut wrote:

 After having used the D 2.0 programming language for a year now and
 having completed 3 projects with it, I wrote a small article about the
 problems I had with the D 2.0 programming language and what suggestions
 I have to improve it.
 
 http://3d.benjamin-thaut.de/?p=18
 
 Comments and criticism welcome
About assert: you can probably set a breakpoint on onAssertError/ onAssertErrorMsg or use core.exception.setAssertHandler to override the throwing behavior (though that is deprecated).
Aug 27 2011
prev sibling next sibling parent reply Mehrdad <wfunction hotmail.com> writes:
Weird... is it just me, or is my reply not appearing in the posts? (I'm 
using Thunderbird... I CAN see my post on the HTTP version, but not on 
Thunderbird. Ideas?)

(Sorry for the meta-spam...)

On 8/27/2011 12:01 PM, Mehrdad wrote:
 On 8/27/2011 10:14 AM, Benjamin Thaut wrote:
 After having used the D 2.0 programming language for a year now and 
 having completed 3 projects with it, I wrote a small article about 
 the problems I had with the D 2.0 programming language and what 
 suggestions I have to improve it.

 http://3d.benjamin-thaut.de/?p=18

 Comments and criticism welcome
<snip>
Aug 27 2011
parent Mehrdad <wfunction hotmail.com> writes:
On 8/27/2011 1:39 PM, Mehrdad wrote:
 Weird... is it just me, or is my reply not appearing in the posts? 
 (I'm using Thunderbird... I CAN see my post on the HTTP version, but 
 not on Thunderbird. Ideas?)

 (Sorry for the meta-spam...)

 On 8/27/2011 12:01 PM, Mehrdad wrote:
 On 8/27/2011 10:14 AM, Benjamin Thaut wrote:
 After having used the D 2.0 programming language for a year now and 
 having completed 3 projects with it, I wrote a small article about 
 the problems I had with the D 2.0 programming language and what 
 suggestions I have to improve it.

 http://3d.benjamin-thaut.de/?p=18

 Comments and criticism welcome
<snip>
Oh whoops, my bad -- I sent it to the wrong thread apparently. Really sorry about spamming! :(
Aug 27 2011
prev sibling parent reply Stephan Soller <stephan.soller helionweb.de> writes:
On 27.08.2011 19:16, Benjamin Thaut wrote:
 After having used the D 2.0 programming language for a year now and
 having completed 3 projects with it, I wrote a small article about the
 problems I had with the D 2.0 programming language and what suggestions
 I have to improve it.

 http://3d.benjamin-thaut.de/?p=18

 Comments and criticism welcome
As for point no. 3 (Structs not having identity): Structs have a postblit constructor. These have access to the new struct but not the old one. Maybe you can use this to register a new reference. If I remember this right the old reference should be cleaned up (unregistered) by the destructor but I'm not sure. You article implies that the destructor is not called for every copy of the struct. Point no. 5, "Shared": I actually had pretty much the same trouble with the syntax for shared delegates. The compiler output is very misleading. In the end this syntax mostly worked: shared(void delegate(const char[])) message_handler; Still had to cast away the shared on the rhs expression of an assigment. Maybe the full code can shed some light on this: // An array of message handlers private shared( shared(void delegate(const char[]))[] ) message_handlers; // Function to register new handlers public shared void hook(shared(void function(const char[])) message_handler){ typeof(message_handlers[0]) handler_dg; handler_dg.funcptr = cast(void function(const const(char[]))) message_handler; synchronized(mutex) message_handlers ~= handler_dg; } The typeof trick to define the handler_dg variable is there because nothing else seemed to work. I worked with Benjamin on the space shooter game. The above code is actually from the logger of that project (base/logger.d). Point no. 7, "Associative array invariance": This was my most frequent identifiable bug source. Pretty much what Benjamin said: it's annoying the program just crashes. However bugs like that are easy to find with a debugger... usually. Point no. 8, "No function overloading with template parameters": Got the same problem while templating some functions of an overload set. It's not possible to mix overloads with templates. That wasn't much of a problem but converting everything to templates doesn't work ether. In the end I used templates that generate normal function overloads and explicitly instantiated those templates. Happy programming Stephan Soller
Aug 29 2011
next sibling parent reply Jonathan M Davis <jmdavisProg gmx.com> writes:
On Tuesday, August 30, 2011 03:44:33 Stephan Soller wrote:
 On 27.08.2011 19:16, Benjamin Thaut wrote:
 After having used the D 2.0 programming language for a year now and
 having completed 3 projects with it, I wrote a small article about the
 problems I had with the D 2.0 programming language and what suggestions
 I have to improve it.
 
 http://3d.benjamin-thaut.de/?p=18
 
 Comments and criticism welcome
As for point no. 3 (Structs not having identity): Structs have a postblit constructor. These have access to the new struct but not the old one. Maybe you can use this to register a new reference. If I remember this right the old reference should be cleaned up (unregistered) by the destructor but I'm not sure. You article implies that the destructor is not called for every copy of the struct.
It's not called on _moves_. In a number of cases, the compiler moves a struct via a bitwise copy rather than actually copying it (which would involve calling the postblit constructor and the destructor). When that happens, the address of the struct changes. And since he was doing something where he was keeping track of the structs based on their addresses on the stack, it messed up his tracking. So, he can't really do what he's trying to do the way that he's trying to do it.
 Point no. 8, "No function overloading with template parameters":
 
 Got the same problem while templating some functions of an overload set.
 It's not possible to mix overloads with templates. That wasn't much of a
 problem but converting everything to templates doesn't work ether. In
 the end I used templates that generate normal function overloads and
 explicitly instantiated those templates.
You can often add empty parens to templatize a function - e.g. int func()(int i) - to get around the problem without really changing your function. But it's definitely true that allowing overloads between templatized and non-templatized functions would be an improvement. Hopefully, we get it at some point. - Jonathan M Davis
Aug 29 2011
parent Trass3r <un known.com> writes:
 But it's definitely true that allowing overloads between templatized and  
 non-templatized functions would be an improvement. Hopefully, we get it  
 at some point.
In the end this is not an "enhancement" but it is *required* to do proper D2 style operator overloading.
Aug 30 2011
prev sibling parent Andrej Mitrovic <andrej.mitrovich gmail.com> writes:
On 8/30/11, Jonathan M Davis <jmdavisProg gmx.com> wrote:
 But
 it's
 definitely true that allowing overloads between templatized and
 non-templatized
 functions would be an improvement. Hopefully, we get it at some point.
Seeing as example code that uses such overloading is already in TDPL, this is probably only a matter of time before it's implemented.
Aug 29 2011