1. Home
  2. Computing & Technology
  3. C / C++ / C#
photo of David Bolton
David's C / C++ / C# Blog

By David Bolton, About.com Guide to C / C++ / C#

Grace - Writing C++ In a more Modern Way

Sunday July 6, 2008
I can't see C++ purists really taking to this but those who have been learning other languages first then C++ might consider it. Grace is an attempt to hide some of the uglier parts of C++ programming and make it look a bit more readable. this snippet is from one of the examples.

    int main (void)
    {
        value greetings =
            $("world", "Hello") ->
            $("everyone", "Hi") ->
            $("you", "Hey") ;
            
        foreach (g, greetings)
        {
            fout.writeln ("%s, %s." %format (g, g.id())) ;
        }
        
        return 0;
    }

As well as the friendlier syntax it includes code for reading XML, CSV, INI files, JSON and is used in the OpenPanel project for ISPs. It's an interesting idea and worthy of a look. As usual I've added it to the C++ code library.

Comments
July 7, 2008 at 5:23 am
(1) L says:

Could you, please, add the relevant links not only to your library, but also directly into the article itself?
Always searching the library is annoying..
Thank you.

July 7, 2008 at 1:02 pm
(2) Yagami Light says:

Yep, I went to the wrong links a couple of times. Please consider pointing out (linking? anchoring?) what is being talked about as there’ll be likely much more multiple links with names or topics so similar in the future that it’s not fun trying to guess the link.

Leave a Comment

Line and paragraph breaks are automatic. Some HTML allowed: <a href="" title="">, <b>, <i>, <strike>

Explore C / C++ / C#
About.com Special Features

Stay connected and entertained with reviews on tips on the latest HDTVs, cellphones and more. More >

Easy ways to connect two computers for networking purposes. More >

  1. Home
  2. Computing & Technology
  3. C / C++ / C#

©2009 About.com, a part of The New York Times Company.

All rights reserved.