C is fastest

Rajinder Yadav devguy.ca-Re5JQEeQqe8AvxtiuMwx3w at public.gmane.org
Wed Oct 14 22:48:40 UTC 2009


On Wed, Oct 14, 2009 at 3:44 PM, Lennart Sorensen
<lsorense-1wCw9BSqJbv44Nm34jS7GywD8/FfD2ys at public.gmane.org> wrote:
> On Wed, Oct 14, 2009 at 03:12:33PM -0400, Rajinder Yadav wrote:
>> Dang you would be a hard partner to convince that using C++ is better
>> than C , that OO design/code is better than procedural C code and
>> mostly Ruby is better then tab indented Python code ;) ;) ....
>> kidding!!!
>
> Can you believe I learned C++ before C and in fact learned C by finding
> which parts of my code the compiler didn't like?

You wrote C++ code the compiler barfed up =) .... than I am sure
you're glad you don't need to worry about working with STL and C++
Template classes in C.

I went the other way C to C++, took a while to get use to OO
programming. I don't think about it that much. possibly I see things
more easily as object due to the long-term C++ exposure?

I remember when I worked at Nortel as a intern( when Nortel was the
place to be ). The server team wrote code in C only, they didn't
understand C++ and they feared it like no tomorrow. So I get it when
some people (not you) say they don't like C++ or any other OO
language.

>
> I do believe that if we actually want to take advantage of our now common
> 4 and 8 way machines, we need languages that are functional not OO so
> that the language and compiler can auto generate multithreaded code
> to take advantage of modern machines.  Most programmers can't write
> multithreaded code that works.  Preferably they shouldn't have to either,
> but I do believe they have to give up OO to get there.

We write C++ multi-thread code here at work and the last few places I
worked they wrote multi-threaded C++ code. I don't think OO gets in
the way of threading, just that some can't understand how to design
and code multi-threaded apps. If you gave them C in place of C++, they
would create the same multi-threaded mess only in C. I've written
multi-threaded code in C++ as well as multi-thread classes, not once
did I have to stop and say, damn this OO, it keep getting in the way,
let me drop down to C in this code module.

I mentioned RapidMind here before on a different thread. They built a
multi-processor, multi-threaded framework for C++ programmers, it also
harness the power for GPUs to parallelizes methods, algorithms and the
code in general.

http://www.rapidmind.net/technology.php

"With RapidMind, developers continue to write code in standard C++ and
use their existing skills, tools and processes. The RapidMind platform
then parallelizes the application across multiple cores and manages
its execution."

So C++ and threading can and do work very well. Seems like Rapidmind
is trying to let the platform take care of the parallel work to some
extent and not have it all fall on the programmer.

>Perhaps OO
> doesn't have to completely go, but certainly I don't believe java and
> C++ stand a chance here.  Microsoft may be able to do something with C#
> or more likely F# (which is a nice looking language, too bad I don't
> care to write code in Visual Studio on windows).
>
> 10 years ago, having more than one cpu core was for expensive servers.
> These days a laptop has 2 or 4 cores.  It's time to get used to it.
> The days of ever increasing clock frequencies are done.

I saw a video from MS a year or 2 ago that talked about one of their
small research lab trying to figure out how to parallelize code at the
compiler level without multi-threading getting in the way of the
programmer. The lady heading the lab was a manager type not a geek
type, and her work did sound challenging to say the least since she
has zero dedicated resource doing actual development work. I do know
MS is was looking into harnessing multi-core either at the OS level or
the compiler level, or a union of both. Their dilemma they were trying
to avoid and why they were slow getting out of the gate was not to
rush out with a solution to market and then handcuff the development
community with a poorly thought out way to do this.

They will probably do it in .NET with C# ... it seems C++ at MS
doesn't get much hype and attention, which is a shame. The last good
thing to come out of MS in term of C++ productivity was MFC and that
was in 1992... 17 years ago, my goodness has it been that long.

>
> --
> Len Sorensen
> --
> The Toronto Linux Users Group.      Meetings: http://gtalug.org/
> TLUG requests: Linux topics, No HTML, wrap text below 80 columns
> How to UNSUBSCRIBE: http://gtalug.org/wiki/Mailing_lists
>


-- 
Kind Regards,
Rajinder Yadav

http://devmentor.org
Do Good! ~ Share Freely
--
The Toronto Linux Users Group.      Meetings: http://gtalug.org/
TLUG requests: Linux topics, No HTML, wrap text below 80 columns
How to UNSUBSCRIBE: http://gtalug.org/wiki/Mailing_lists





More information about the Legacy mailing list