Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c++ > #13543

Re: Event handler in c++

From "osmium" <r124c4u102@comcast.net>
Newsgroups comp.lang.c++
Subject Re: Event handler in c++
Date 2012-01-22 10:56 -0600
Message-ID <9o2teeFeiaU1@mid.individual.net> (permalink)
References <707d72e5-d35d-412c-bac8-efe54ad365cb@z12g2000yqm.googlegroups.com> <jfh8ub$fmg$1@dont-email.me>

Show all headers | View raw


"Alf P. Steinbach"

> On 22.01.2012 15:42, pratik lala wrote:
>>
>> I am trying to create a game which requires the use of keyboard.The
>> game is about falling items and I have to collect the item using the
>> paddle .So I know that we can make the terminal to operate in raw mode
>> and make the paddle move using the keyboard input.But i am not sure if
>> it will work as efficiently as an event handler works in other
>> languages.
>
> Other languages are generally implemented in either C or C++, or in some 
> language that ultimately is implemented in C or C++.
>
> That means (logically) that whatever the other language does, you can do 
> it just as efficiently in C++.
>
> And in general the problem is the opposite: can some other and otherwise 
> desirable language, do something as efficiently as C++?
>
> It is rare indeed that some high level language beats C++ on efficiency. 
> When you understand what's going on, what overhead the typical language 
> implementation adds, then you know that any test putting C++ low on 
> efficiency must be flawed. Like an observation that claims the moon is 
> much larger than the sun is necessarily flawed.
>
> The "language efficiency" thing for C++ is more a question of 
> /productivity/. If it involves much more work to do the thing efficiently 
> in C++ than to do it efficiently in e.g. C#, then likely efficiency will 
> suffer for C++. So your concern is not entirely misplaced on general 
> grounds, but it's based on an incorrect perception of the issues.

IMO, the lack of co-routines is a serious impediment for some problems - 
such as event simulation -  in C++.  For example, I don't see any way to 
implement an event handler in as neatly and intuitively satisfying a way as 
in the first incarnation of Simula.

Does anyone know, does Simula 67 have co-routines? I took a course in it but 
the it was very superficial. and directed at the  goal of using Simula 67 as 
a general purpose language. 

Back to comp.lang.c++ | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Event handler in c++ pratik lala <pratik3558@gmail.com> - 2012-01-22 06:42 -0800
  Re: Event handler in c++ "Alf P. Steinbach" <alf.p.steinbach+usenet@gmail.com> - 2012-01-22 16:11 +0100
    Re: Event handler in c++ "osmium" <r124c4u102@comcast.net> - 2012-01-22 10:56 -0600
      Re: Event handler in c++ Robert Wessel <robertwessel2@yahoo.com> - 2012-01-22 21:32 -0600
      Re: Event handler in c++ Christopher <cpisz@austin.rr.com> - 2012-01-24 08:25 -0800
        Re: Event handler in c++ Robin Tucker <robinmjtucker@gmail.com> - 2012-02-13 03:52 -0800
          Re: Event handler in c++ 88888 Dihedral <dihedral88888@googlemail.com> - 2012-02-14 02:14 -0800
            Re: Event handler in c++ Ian Collins <ian-news@hotmail.com> - 2012-02-15 07:17 +1300
              Re: Event handler in c++ 88888 Dihedral <dihedral88888@googlemail.com> - 2012-02-14 11:51 -0800
                Re: Event handler in c++ Ian Collins <ian-news@hotmail.com> - 2012-02-15 16:59 +1300
                Re: Event handler in c++ MiB <michael.boehnisch@gmail.com> - 2012-02-15 02:11 -0800
                Re: Event handler in c++ Ian Collins <ian-news@hotmail.com> - 2012-02-16 07:46 +1300
                Re: Event handler in c++ Robert Wessel <robertwessel2@yahoo.com> - 2012-02-15 15:32 -0600
                Re: Event handler in c++ MiB <michael.boehnisch@gmail.com> - 2012-02-16 17:56 -0800
          Re: Event handler in c++ Rui Maciel <rui.maciel@gmail.com> - 2012-02-15 23:11 +0000
    Re: Event handler in c++ pratik lala <pratik3558@gmail.com> - 2012-01-22 16:14 -0800
      Re: Event handler in c++ "Alf P. Steinbach" <alf.p.steinbach+usenet@gmail.com> - 2012-01-23 03:54 +0100

csiph-web