Quantcast

Maximum PC

It is currently Thu Apr 17, 2014 3:16 pm

All times are UTC - 8 hours




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: C++ vs C#. FIGHT!
PostPosted: Mon Jun 20, 2011 4:14 am 
SON OF A GUN
SON OF A GUN
User avatar

Joined: Mon Nov 01, 2004 5:41 am
Posts: 11605
http://www.codeproject.com/KB/cross-pla ... otNet.aspx

I am pretty impressed with the effort this guy put into this article. It was a very good read and I am happy to see some real numbers put behind the arguments about speed.


Top
  Profile  
 
 Post subject: Re: C++ vs C#. FIGHT!
PostPosted: Mon Jun 20, 2011 6:00 pm 
Bitchin' Fast 3D Z8000*
Bitchin' Fast 3D Z8000*
User avatar

Joined: Tue Jun 29, 2004 11:32 pm
Posts: 2555
Location: Somewhere between compilation and linking
Not a big surprise to me. There was a guy from USC that did the same thing a few years back with Java and C++, and they were pretty competitive in everything except trig functions. Also, the MS C++ compiler is no speed demon either. The C++ hash table implementation is really bad! How did they bork that one? You would think that people would be howling so loudly that it would have been fixed within a month.

I found the GenericSum method amusing...
Code:
public static T GenericSum<T, Math>(List<T> list, Math M) where Math : IMath<T>
{
   T sum = M.Zero;
   for (int i = 0; i < list.Count; i++)
      sum = M.Add(sum, list[i]);
   return sum;
}

Five lines of code for the method, not including creating the list and calling, AND it only works on sums.
How can people tolerate programming in these languages?! =)
Code:
CL-USER> (reduce #'+ (list 1 2 3 4 5))
15

I think that I'll stick to the ancient languages... ;)


Top
  Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC - 8 hours


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group