C++, D: Dinosaurs?

Nick Sabalausky a at a.a
Mon Nov 3 17:55:41 PST 2008


"Piotrek" <starpit at tlen.pl> wrote in message 
news:geo14c$ol9$1 at digitalmars.com...
> Nick Sabalausky wrote:
>> [...]The concept of domain-specific languages is ultra-trendy these days 
>> (probably promoted by the same knuckleheads that hailed things like 
>> pure-OO, pure-functional, and Extreme Programming as silver bullets). But 
>> I consider domain-specific languages to be purely a symptom of a strong 
>> need for a better general purpose language.
>>
>
> Totally agree. At my point of view it looks excacly the same. I started 
> with pascal then moved to c/c++ at university but I abandoned it because 
> of its ugliness and non intuitive application development. Then I found 
> working with PHP/JAVA much easier but I was disappointed by its 
> fundamentals (please let me forget about PHP as a programming language). 
> And when I was left without any hope I saw a Bright light. :D
>
> For me D takes the best of everything I have seen. Of course it isn't 
> perfect but takes the right course and I want to be aboard.
>
>> Let's face it: programming needs and uses have expanded so much over the 
>> last decade or so that C/C++ hasn't really been a "general purpose" 
>> language for quite some time. These days it's a systems/performance 
>> language instead. True, all the attempts at retrofitting it with 
>> modern-ish features to try to keep it general-purpose have turned it into 
>> a regular frankenstein's monster of a language, but that does nothing to 
>> disprove the viability of general purpose languages in general. It just 
>> demonstrates that C++ needs a reboot (hence: D). Heck, D is already far 
>> better as a general-purpose language than C/C++ (although it's still not 
>> quite there yet).
>
> Those words are mine (I wish) ;)
>
>> I'd *much* rather use a true general-purpose language (which, again, C++ 
>> is no longer an example of) than muck around with 500 different languages 
>> for every stupid little thing.
>>
>> For example, have you ever tried doing web development? You can't 
>> realistically do anything nontrivial without tripping over at least 
>> handful of different, essentially domain-specific, languages: ECMAScript, 
>> (T)SQL, (X)HTML, XML, CSS, and either PHP, ASP/VBScript, ASP.NET/C#, 
>> Python or Ruby. And that's just the bare minimum for any non-trivial web 
>> site. For one thing, most of those are great examples of the fact that 
>> domain-specific languages do nothing to prevent piss-poor language 
>> design. But besides that: Conceptually, web development is one of the 
>> most trivial forms of programming out there. But the domain-specific 
>> language-soup realities of it have turned what should have been trivial 
>> into one of the programming world's biggest pains-in-the-ass. It's an 
>> absolute mess.
>
> That's why I'm planing to use D + Tango + Mango and blow up everything 
> else including existing http servers.

I've found that, unfortunately, to not be quite enough. Not because of any 
limitations of D/Tango/Mango, but because:

#1: In the commercial world there are a lot of times when you, as the 
programmer, have little to no say on how the server is set up and what 
languages are available (for instance, I've done plenty of PHP and VBScript, 
but never by choice).

#2: You have basically no control over the client-side environment, so for 
that you're still stuck with de-facto standards like ECMAScript, and a lack 
of the upcoming/proposed improvements to (X)HTML (things I've thought should 
have been in HTML all along...*grumble*).

This is why I've recently been getting interested in high-level language 
translation, and have been playing around with writing such a tool. I'd like 
to be able to write code in a sensible language like D and just translate 
that into whatever horrible scripting language the 
sysadmin/netadmin/browser-vendor decided would be suitable.

> (I had also questions in my mind why the hell databases relies on SQL so 
> much).
>

I agree. I'd much rather just use a sensible API (DBMS-agnostic of course). 
Pasting together SQL snippets is just plain ugly, and why dynamically 
generate code just for the DBMS to go and parse it? I mean, geez, just cut 
the middleman and pass the request directly. LINQ is better, but I'm still 
not convinced it's the right approach. TSQL stored procedures are something 
I'd rather, well, just write in a more "normal" language.  And then, of 
course, there's the bizarre "insert" vs. "update" syntax inconsistencies and 
general incompatibilities across vendors (ex: insert a row and retreive the 
auto-gen id <- which is really a rather common thing to need to do, 
particularly if you've got any foreign keys in the DB design, which again is 
rather common).

To be fair though, I have to say that without some of the advanced features 
we've been starting to see in languages like D, C#, Python and Ruby, using 
an API for any non-trivial queries could potentially get ugly. 





More information about the Digitalmars-d mailing list