digitalmars.D - Article about problems & suggestions for D 2.0
- Benjamin Thaut <code benjamin-thaut.de> Aug 27 2011
- Walter Bright <newshound2 digitalmars.com> Aug 27 2011
- Chris Molozian <chris cmoz.me> Aug 27 2011
- Benjamin Thaut <code benjamin-thaut.de> Aug 27 2011
- Walter Bright <newshound2 digitalmars.com> Aug 27 2011
- Walter Bright <newshound2 digitalmars.com> Aug 27 2011
- Christian Kamm <kamm-incasoftware removethis.de> Aug 27 2011
- Caligo <iteronvexor gmail.com> Aug 27 2011
- "Nick Sabalausky" <a a.a> Aug 27 2011
- Kagamin <spam here.lot> Aug 30 2011
- Mehrdad <wfunction hotmail.com> Aug 27 2011
- Mehrdad <wfunction hotmail.com> Aug 27 2011
- Stephan Soller <stephan.soller helionweb.de> Aug 29 2011
- Jonathan M Davis <jmdavisProg gmx.com> Aug 29 2011
- Andrej Mitrovic <andrej.mitrovich gmail.com> Aug 29 2011
- Trass3r <un known.com> Aug 30 2011
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
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
Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 8bit 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
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!
-- Kind Regards Benjamin Thaut
Aug 27 2011
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!
Better, but still a strain to read. The browser's default font size is usually the best size to use.
Aug 27 2011
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
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
--20cf307d04ac8c6b6704ab80e233 Content-Type: text/plain; charset=ISO-8859-1 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. --20cf307d04ac8c6b6704ab80e233 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable <br><br><div class=3D"gmail_quote">On Sat, Aug 27, 2011 at 12:39 PM, Walter= Bright <span dir=3D"ltr"><<a href=3D"mailto:newshound2 digitalmars.com"=newshound2 digitalmars.com</a>></span> wrote:<br><blockquote class=3D"g=
eft:1ex;"> <div><div></div><div class=3D"h5">On 8/27/2011 10:16 AM, Benjamin Thaut wro= te:<br> <blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p= x #ccc solid;padding-left:1ex"> After having used the D 2.0 programming language for a year now and having<= br> completed 3 projects with it, I wrote a small article about the problems I = had<br> with the D 2.0 programming language and what suggestions I have to improve = it.<br> <br> <a href=3D"http://3d.benjamin-thaut.de/?p=3D18" target=3D"_blank">http://3d= .benjamin-thaut.de/?<u></u>p=3D18</a><br> <br> Comments and criticism welcome<br> </blockquote> <br></div></div> I find it very hard to read. Can you boost the font size, please? Have pity= on us old guys!<br> </blockquote></div><br>Ctrl and + to increase the font size.=A0 should work= on any browser.<br> --20cf307d04ac8c6b6704ab80e233--
Aug 27 2011
"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
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
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
Aug 27 2011
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
Really sorry about spamming! :(
Aug 27 2011
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
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
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
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









Chris Molozian <chris cmoz.me> 