www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Designing a consistent language is *very* hard

reply "Guillaume Chatelet" <chatelet.guillaume gmail.com> writes:
Sorry for the noise but I think a few language designer out there 
might like this one :
http://me.veekun.com/blog/2012/04/09/php-a-fractal-of-bad-design/

I think Walter and Andrei will smile ( or cry ) reading it.
It's no trolling here, I do think this post is very valuable and 
relevant from a language design perspective.
Apr 28 2012
next sibling parent reply Paulo Pinto <pjmlp progtools.org> writes:
Am 28.04.2012 10:18, schrieb Guillaume Chatelet:
 Sorry for the noise but I think a few language designer out there might
 like this one :
 http://me.veekun.com/blog/2012/04/09/php-a-fractal-of-bad-design/

 I think Walter and Andrei will smile ( or cry ) reading it.
 It's no trolling here, I do think this post is very valuable and
 relevant from a language design perspective.

Well, I cry everytime I am using it on my web site, but the effort to port the scripts is not worth it.
Apr 28 2012
parent reply "Nick Sabalausky" <SeeWebsiteToContactMe semitwist.com> writes:
"Paulo Pinto" <pjmlp progtools.org> wrote in message 
news:jngarb$14un$1 digitalmars.com...
 Am 28.04.2012 10:18, schrieb Guillaume Chatelet:
 Sorry for the noise but I think a few language designer out there might
 like this one :
 http://me.veekun.com/blog/2012/04/09/php-a-fractal-of-bad-design/

 I think Walter and Andrei will smile ( or cry ) reading it.
 It's no trolling here, I do think this post is very valuable and
 relevant from a language design perspective.

Well, I cry everytime I am using it on my web site, but the effort to port the scripts is not worth it.

Abandoning PHP is *always* "worth it".
Apr 28 2012
parent "Nick Sabalausky" <SeeWebsiteToContactMe semitwist.com> writes:
"Paulo Pinto" <pjmlp progtools.org> wrote in message 
news:oughgmvgoiiietkedaxa forum.dlang.org...
 On Saturday, 28 April 2012 at 09:41:06 UTC, Nick Sabalausky wrote:
 "Paulo Pinto" <pjmlp progtools.org> wrote in message
 news:jngarb$14un$1 digitalmars.com...
 Well, I cry everytime I am using it on my web site, but the effort to
 port the scripts is not worth it.

Abandoning PHP is *always* "worth it".

Rewriting seldom brings anything new. It almost like starting from zero, without the benefit from all the bug fixes the software has had along the years.

Well, rewriting != porting.
 The hours wasted porting to a new language, could be used adding
 features to existing code base, or refactoring.

I had a big project recently that was about half Flash. About halfway through, I ported all the Flash from AS2 to Haxe (and switched the resource-embedding from the Flash IDE to swfmill): It wasn't particularly difficult, and it more than paid off in the end.
 I know how I am speaking about, many of the big bucks we get on
 consultancy jobs, are from companies that decide to keep rewriting
 their software on the flavour of the month framework, just because
 "everyone else is doing it".

Well, yea, *that* would certainly be a problem. And I agree there are times when porting languages is not worth it. But I do have a very hard time imagining that porting away from PHP could ever be unworthwhile. I'm not trying to talk you into porting your stuff, though. Just sayin'.
 So I rather keep my "almost clean" PHP scripts running, as getting
 to the trouble of switching ISP just to be able to rewrite the site
 in a more sane language.

Eh, personally, I find the PHP-only webhosts to always be nightmares to deal with. Even the shared hosts that are nice enough allow native-compiled CGI still tend to be a pain. I switched to Linode (VPS) about a couple months ago, and I'm absolutely in love with it already. Heck, last night, I even got the thought in my head of converting one of my client's sites (that's hosted on a real shit PHP-only webhost) to my linode server, and just making their server proxy to mine (via PHP if I have to). I don't think I actually will, but it's a tempting thought (after all, I have gotten him to agree, at least in principle, to switching to shared host that allows native-compiled CGI). But I guess I'm rambling now. And YMMV, FWIW, Etc, OMGWTFBBQ...
Apr 28 2012
prev sibling next sibling parent reply "Nick Sabalausky" <SeeWebsiteToContactMe semitwist.com> writes:
"Guillaume Chatelet" <chatelet.guillaume gmail.com> wrote in message 
news:vwpzirpppabcgylmvpsx forum.dlang.org...
 Sorry for the noise but I think a few language designer out there might 
 like this one :
 http://me.veekun.com/blog/2012/04/09/php-a-fractal-of-bad-design/

"PHP: a fractal of bad design" is the absolute most perfect summary of PHP anyone could ever possibly make. It is the world's worst still-living non-joke language, period. Although, I genuinely cringe at calling it a "non-joke" language. Or "living" - PHP is like one of those botched homunculi from Fullmetal Alchemist, writhing around in an unholy half-existence. Even if you use something like Haxe-compiled-to-PHP to escape the language itself, you've still only escaped part of PHP's gruesome hell. His sections "An Analogy" through "Core Language" are absolute spot-on perfection. One of my (many) favorite quotes here is "PHP is a community of amateurs". So very, very true. Speaking of which, the fact that they botched the PHP4 -> PHP5 transition so completely, when there were obvious trivial ways to handle it sensibly, has always been my personal favorite evidence of PHP's extreme amaterishness. I couldn't bear to get even as far as half-way through this tome, but I do have this to say about it: I hope I *never* end up knowing anywhere near as much about PHP as this guy is cursed to know. With each passing day, I grow more and more convinced: The true measure of a web developer is how much they hate PHP. (Note: Not intended self-referentially - No narcissism implied.)
Apr 28 2012
next sibling parent "Nick Sabalausky" <SeeWebsiteToContactMe semitwist.com> writes:
"Nick Sabalausky" <SeeWebsiteToContactMe semitwist.com> wrote in message 
news:jngd63$18m1$1 digitalmars.com...
 With each passing day, I grow more and more convinced: The true measure of 
 a web developer is how much they hate PHP. (Note: Not intended 
 self-referentially - No narcissism implied.)

Actually, what I really meant was: The true measure of a web developer is how much they hate web technologies. (PHP, of coruse, being a fairly major part of that.) There does always seem to be an inverse correlation between a web developer's abilities and their opinion of popular web technologies.
Apr 28 2012
prev sibling parent reply deadalnix <deadalnix gmail.com> writes:
Le 28/04/2012 11:27, Nick Sabalausky a écrit :
 "Guillaume Chatelet"<chatelet.guillaume gmail.com>  wrote in message
 news:vwpzirpppabcgylmvpsx forum.dlang.org...
 Sorry for the noise but I think a few language designer out there might
 like this one :
 http://me.veekun.com/blog/2012/04/09/php-a-fractal-of-bad-design/

"PHP: a fractal of bad design" is the absolute most perfect summary of PHP anyone could ever possibly make. It is the world's worst still-living non-joke language, period.

Please note that Rasmus Ledorf stated many time that He « don't know how to design a programming language », « never intended to create a programing language », « don't like programing » and probably the funniest one « don't how to stop it » it being the success of PHP. Back on the article, the author is wrong when stating that it isn't possible to run several different versions of PHP on the same server. This is possible, I did it several times and for big websites.
Apr 28 2012
parent "Nick Sabalausky" <SeeWebsiteToContactMe semitwist.com> writes:
"deadalnix" <deadalnix gmail.com> wrote in message 
news:jngirs$1jlf$1 digitalmars.com...
 Le 28/04/2012 11:27, Nick Sabalausky a écrit :
 "Guillaume Chatelet"<chatelet.guillaume gmail.com>  wrote in message
 news:vwpzirpppabcgylmvpsx forum.dlang.org...
 Sorry for the noise but I think a few language designer out there might
 like this one :
 http://me.veekun.com/blog/2012/04/09/php-a-fractal-of-bad-design/

"PHP: a fractal of bad design" is the absolute most perfect summary of PHP anyone could ever possibly make. It is the world's worst still-living non-joke language, period.

Please note that Rasmus Ledorf stated many time that He « don't know how to design a programming language », « never intended to create a programing language », « don't like programing » and probably the funniest one « don't how to stop it » it being the success of PHP.

Ugh. That just makes the whole situation even more pathetic.
Apr 28 2012
prev sibling next sibling parent "Paulo Pinto" <pjmlp progtools.org> writes:
On Saturday, 28 April 2012 at 09:41:06 UTC, Nick Sabalausky wrote:
 "Paulo Pinto" <pjmlp progtools.org> wrote in message
 news:jngarb$14un$1 digitalmars.com...
 Am 28.04.2012 10:18, schrieb Guillaume Chatelet:
 Sorry for the noise but I think a few language designer out 
 there might
 like this one :
 http://me.veekun.com/blog/2012/04/09/php-a-fractal-of-bad-design/

 I think Walter and Andrei will smile ( or cry ) reading it.
 It's no trolling here, I do think this post is very valuable 
 and
 relevant from a language design perspective.

Well, I cry everytime I am using it on my web site, but the effort to port the scripts is not worth it.

Abandoning PHP is *always* "worth it".

Rewriting seldom brings anything new. It almost like starting from zero, without the benefit from all the bug fixes the software has had along the years. The hours wasted porting to a new language, could be used adding features to existing code base, or refactoring. I know how I am speaking about, many of the big bucks we get on consultancy jobs, are from companies that decide to keep rewriting their software on the flavour of the month framework, just because "everyone else is doing it". So I rather keep my "almost clean" PHP scripts running, as getting to the trouble of switching ISP just to be able to rewrite the site in a more sane language. -- Paulo
Apr 28 2012
prev sibling next sibling parent "Era Scarecrow" <rtcvb32 yahoo.com> writes:
On Saturday, 28 April 2012 at 11:42:19 UTC, Paulo Pinto wrote:
 Rewriting seldom brings anything new. It almost like starting
 from zero, without the benefit from all the bug fixes the
 software has had along the years.

 The hours wasted porting to a new language, could be used adding
 features to existing code base, or refactoring.

There are times where a full re-write is better than keeping the old code. I'm rewriting my code for SmartMerger (TES3 project) from C to D, will probably be renamed to SmartMergeD). I'm getting stuck more and more adding and rewriting portions of code that are basically simple containers for different types; like associative arrays and array searching of different types. It is quite refreshing to see how compact and simpler the code is; And this is the first project I'm fully embracing OO. I can't wait to see how D will look as it matures and the compiler gets to a fully stable condition.
Apr 28 2012
prev sibling next sibling parent "Paulo Pinto" <pjmlp progtools.org> writes:
On Saturday, 28 April 2012 at 12:32:17 UTC, Era Scarecrow wrote:
 On Saturday, 28 April 2012 at 11:42:19 UTC, Paulo Pinto wrote:
 Rewriting seldom brings anything new. It almost like starting
 from zero, without the benefit from all the bug fixes the
 software has had along the years.

 The hours wasted porting to a new language, could be used 
 adding
 features to existing code base, or refactoring.

There are times where a full re-write is better than keeping the old code. I'm rewriting my code for SmartMerger (TES3 project) from C to D, will probably be renamed to SmartMergeD). I'm getting stuck more and more adding and rewriting portions of code that are basically simple containers for different types; like associative arrays and array searching of different types. It is quite refreshing to see how compact and simpler the code is; And this is the first project I'm fully embracing OO. I can't wait to see how D will look as it matures and the compiler gets to a fully stable condition.

My statement is based in a few Fortune 500 projects, where I took part in the migration project. Some of those took several years to complete, and the only impact on the business was dropping the revenue. But I do concede, that there are use cases where it makes sense. -- Paulo
Apr 28 2012
prev sibling next sibling parent reply "H. S. Teoh" <hsteoh quickfur.ath.cx> writes:
On Sat, Apr 28, 2012 at 10:18:33AM +0200, Guillaume Chatelet wrote:
 Sorry for the noise but I think a few language designer out there
 might like this one :
 http://me.veekun.com/blog/2012/04/09/php-a-fractal-of-bad-design/
 
 I think Walter and Andrei will smile ( or cry ) reading it.
 It's no trolling here, I do think this post is very valuable and
 relevant from a language design perspective.

I've written some simple apps in PHP... never learned enough of it to run into all the problems listed on that page. But I *did* run into stupidities involving ===. IMNSHO, *any* language that has === is fundamentally, irreparably dainbramaged, and needs to be scrapped and redesigned from scratch. This includes that hellspawn of evil incarnate known as Javascript. After reading this article, I'm seriously considering adopting D as my language of choice for CGI. ;-) T -- "Computer Science is no more about computers than astronomy is about telescopes." -- E.W. Dijkstra
Apr 28 2012
next sibling parent reply Walter Bright <newshound2 digitalmars.com> writes:
On 4/28/2012 11:10 AM, H. S. Teoh wrote:
 But the overload of 'is' as an operator with 'is()' as an expression
 (and its various ugly arbitrarily assigned syntaxes)? WAT.

It's not that unusual for an operator to have a binary form that is totally different from its unary form. Like *
 Seriously, one of the first things I'd like to see in D3 is a complete
 overhaul of is(). I say again, the various *semantics* of it are
 extremely useful, and are part of what makes D rock so much. But the
 *syntax* badly needs a total redesign. We need much saner syntax
 assigned to each of the current uses of is(), that doesn't look like it
 was grafted in from a PHP development branch.

I agree that the IsExpression syntax is a bit of a disaster. Eventually we can redesign it (D3), but there's no way we have time to do that now.
Apr 28 2012
next sibling parent deadalnix <deadalnix gmail.com> writes:
Le 28/04/2012 21:27, q66 a écrit :
 On Saturday, 28 April 2012 at 18:43:32 UTC, Walter Bright wrote:
 On 4/28/2012 11:10 AM, H. S. Teoh wrote:
 But the overload of 'is' as an operator with 'is()' as an expression
 (and its various ugly arbitrarily assigned syntaxes)? WAT.

It's not that unusual for an operator to have a binary form that is totally different from its unary form. Like *
 Seriously, one of the first things I'd like to see in D3 is a complete
 overhaul of is(). I say again, the various *semantics* of it are
 extremely useful, and are part of what makes D rock so much. But the
 *syntax* badly needs a total redesign. We need much saner syntax
 assigned to each of the current uses of is(), that doesn't look like it
 was grafted in from a PHP development branch.

I agree that the IsExpression syntax is a bit of a disaster. Eventually we can redesign it (D3), but there's no way we have time to do that now.

So .. D3 is coming? *runs*

I think it is too soon for D3, but at some point, breaking changes will have to be introduced.
Apr 28 2012
prev sibling parent Walter Bright <newshound2 digitalmars.com> writes:
On 4/28/2012 12:27 PM, q66 wrote:
 So .. D3 is coming? *runs*

Not anytime soon.
Apr 28 2012
prev sibling parent "Nick Sabalausky" <SeeWebsiteToContactMe semitwist.com> writes:
"H. S. Teoh" <hsteoh quickfur.ath.cx> wrote in message 
news:mailman.45.1335627900.24740.digitalmars-d puremagic.com...
 On Sat, Apr 28, 2012 at 10:18:33AM +0200, Guillaume Chatelet wrote:
 Sorry for the noise but I think a few language designer out there
 might like this one :
 http://me.veekun.com/blog/2012/04/09/php-a-fractal-of-bad-design/

 I think Walter and Andrei will smile ( or cry ) reading it.
 It's no trolling here, I do think this post is very valuable and
 relevant from a language design perspective.

I've written some simple apps in PHP... never learned enough of it to run into all the problems listed on that page. But I *did* run into stupidities involving ===. IMNSHO, *any* language that has === is fundamentally, irreparably dainbramaged, and needs to be scrapped and redesigned from scratch. This includes that hellspawn of evil incarnate known as Javascript.

So true.
 After reading this article, I'm seriously considering adopting D as my
 language of choice for CGI. ;-)

I've already been sold on it for quite some time. Unfortunately, my biggest, most important web project is built in Haxe that's compiled down to *both* PHP and Flash, so I can't realistically switch until I have a way to keep the common server/client code *common*, without dupicating it in two different langauges for client and server (hence, my HaxeD project). Being able to have a common codebase for client/server is seriously such a killer feature, or at least it has been for my particular project.
Apr 28 2012
prev sibling next sibling parent "Adam D. Ruppe" <destructionator gmail.com> writes:
On Saturday, 28 April 2012 at 15:43:52 UTC, H. S. Teoh wrote:
 After reading this article, I'm seriously considering adopting 
 D as my language of choice for CGI. ;-)

D rox.
Apr 28 2012
prev sibling next sibling parent "David Nadlinger" <see klickverbot.at> writes:
On Saturday, 28 April 2012 at 15:43:52 UTC, H. S. Teoh wrote:
 IMNSHO, *any* language that has === is
 fundamentally, irreparably dainbramaged, and needs to be 
 scrapped and
 redesigned from scratch.

Well, in D we have "is", so… (/me ducks) David
Apr 28 2012
prev sibling next sibling parent "H. S. Teoh" <hsteoh quickfur.ath.cx> writes:
On Sat, Apr 28, 2012 at 06:19:44PM +0200, David Nadlinger wrote:
 On Saturday, 28 April 2012 at 15:43:52 UTC, H. S. Teoh wrote:
IMNSHO, *any* language that has === is fundamentally, irreparably
dainbramaged, and needs to be scrapped and redesigned from scratch.

Well, in D we have "is", so… (/me ducks)

To be frank, I find the various syntaxes of 'is' very inconsistent and jarring. It has elicited several WATs from me while learning D. There's no question that the various *uses* to which the syntax has been assigned is extremely useful, but the syntax itself could do with a redesign. I mean, first you have: is(A==B) is the type A is equal to the type B If it were up to me, I'd have used instead the syntax: A==B since, after all, A and B are already known to be types. Then you have: is(A : B) is the type A implicitly convertible to B OK, not the best thing, but at least type comparisons are consistently done in is() syntax, so it's partly palatable. Using : for implicit convertibility is questionable, but at least there's an analogy with base class syntax. So OK. But then: is(A B) if type A is a valid type, alias it to B WAT? There's absolutely no correspondence between this syntax and the previous two cases. NOBODY reading this code would be able to guess its meaning unless they have already learnt the syntax. (Nobody would guess what that piece of PHP code does unless they have already memorized its meaning.) Worse, you have: is(A B : C[D]) if type A is the same as (or is a subclass of) some kind of associative array OK, there's no doubt the *meaning* of this construct is extremely useful, but seriously, the syntax is just as bad as PHP's predisposition to unexpected exceptions to arbitrary rules. Then you have the overload of 'is' to mean a pointer comparison operator: A is B if A and B point to the same thing This I can accept, since with D's implicit pointer deferencing, you'd expect == to compare values, so when you want to compare identity (i.e. are these two references pointing to one and the same thing?) you do need a different syntax for it. But the overload of 'is' as an operator with 'is()' as an expression (and its various ugly arbitrarily assigned syntaxes)? WAT. Seriously, one of the first things I'd like to see in D3 is a complete overhaul of is(). I say again, the various *semantics* of it are extremely useful, and are part of what makes D rock so much. But the *syntax* badly needs a total redesign. We need much saner syntax assigned to each of the current uses of is(), that doesn't look like it was grafted in from a PHP development branch. T -- Life is unfair. Ask too much from it, and it may decide you don't deserve what you have now either.
Apr 28 2012
prev sibling next sibling parent "q66" <quaker66 gmail.com> writes:
On Saturday, 28 April 2012 at 18:43:32 UTC, Walter Bright wrote:
 On 4/28/2012 11:10 AM, H. S. Teoh wrote:
 But the overload of 'is' as an operator with 'is()' as an 
 expression
 (and its various ugly arbitrarily assigned syntaxes)? WAT.

It's not that unusual for an operator to have a binary form that is totally different from its unary form. Like *
 Seriously, one of the first things I'd like to see in D3 is a 
 complete
 overhaul of is(). I say again, the various *semantics* of it 
 are
 extremely useful, and are part of what makes D rock so much. 
 But the
 *syntax* badly needs a total redesign. We need much saner 
 syntax
 assigned to each of the current uses of is(), that doesn't 
 look like it
 was grafted in from a PHP development branch.

I agree that the IsExpression syntax is a bit of a disaster. Eventually we can redesign it (D3), but there's no way we have time to do that now.

So .. D3 is coming? *runs*
Apr 28 2012
prev sibling next sibling parent "H. S. Teoh" <hsteoh quickfur.ath.cx> writes:
On Sat, Apr 28, 2012 at 11:42:47AM -0700, Walter Bright wrote:
 On 4/28/2012 11:10 AM, H. S. Teoh wrote:
But the overload of 'is' as an operator with 'is()' as an expression
(and its various ugly arbitrarily assigned syntaxes)? WAT.

It's not that unusual for an operator to have a binary form that is totally different from its unary form. Like *

So the 'is' in 'is()' is an _operator_? WAT? That's like saying the 'f' in 'f(1,2,3)' is an operator. I thought it was the '(1,2,3)' that was the operator that calls the function f.
Seriously, one of the first things I'd like to see in D3 is a
complete overhaul of is(). I say again, the various *semantics* of it
are extremely useful, and are part of what makes D rock so much. But
the *syntax* badly needs a total redesign. We need much saner syntax
assigned to each of the current uses of is(), that doesn't look like
it was grafted in from a PHP development branch.

I agree that the IsExpression syntax is a bit of a disaster. Eventually we can redesign it (D3), but there's no way we have time to do that now.

I'm not suggesting that we do that now. :-) But it *is* a disaster, and when the time comes for D3, whenever that may be, it definitely needs an overhaul. T -- Life is too short to run proprietary software. -- Bdale Garbee
Apr 28 2012
prev sibling parent Jonathan M Davis <jmdavisProg gmx.com> writes:
On Saturday, April 28, 2012 21:27:28 q66 wrote:
 So .. D3 is coming? *runs*

I think that the last time that Andrei mentioned anything about D3, he said something about maybe 10 years from now. Certainly, if we were to embark on D3 now, we'd just hamstring D2 and probably kill it. Once D2 is fully stable and well-established, we can look at what's worked with it and what hasn't and look at creating a new iteration of the language. But doing that before D2 is fully stable is suicide. We're taking long enough to reach that _without_ doing does of feature changes. We can probably add backwards-compatible features later on, but for now, the focus needs to be on stabilizing what we have, and we _definitely_ don't want to completely redesign any aspects of the language at this point. - Jonathan M Davis
Apr 28 2012