Re: My thoughts on C# and gaming.

Bill Kelly <[email protected]>
Newsgroups gmane.games.devel.sweng
Message-ID <[email protected]>
Richard wrote:
> In article <[email protected]>,
>     Emil Dotchevski <[email protected]>  writes:
> 
>> It's not difficult to imagine a C++ library which lets you do:
>>
>> auto managers=3Dpartition(employees,is_manager());
> 
> Sometimes when I read other people's C++ code, they forget to build
> themselves a vocabulary of reusable idioms in the language and end up
> with the kind of laborious code shown at the pastebin link.  The
> standard library is getting better at encapsulating more and more
> idiomatic uses of the language so that you can get more succinct.
> When I read the ruby statements, that's what I see: the language was
> created after these idioms became commonplace, so they are cooked into
> the syntax of the language.  C++ is flexible enough that it can absorb
> these idioms as well, without having to change the core syntax of the
> language.
> 
> FTP protocol chatter follows a grammar and implementing a client to
> parse that grammar using something like Spirit would result in an
> implementation that would be just as succinct as Ruby I imagine.
> Spirit and Ruby are both talking at a high-level at that point.
> However, the C++ code on pastebin is operating in the "let me think
> about everything as strings and characters" mentality and not
> operating at the level of thinking of the FTP chatter as something
> that follows a grammar.  Thus, all the low-level parsing details are
> constantly getting all up in your face.

Thanks for the tip regarding Spirit, I was indeed unaware of it.

However, it's unlikely I would have used that library in this case,
for the same reason I opted to avoid boost:regex in this particular
module.  It struck me as unreasonable to pull in some hefty, non-
standard dependencies just for this one parsing function.

I do indeed use higher-level tools (like boost:regex) in other
contexts.


Regards,

Bill


_______________________________________________
Sweng-Gamedev mailing list
[email protected]
http://lists.midnightryder.com/listinfo.cgi/sweng-gamedev-midnightryder.com
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.