Re: [9fans] c++

2012-11-23 Thread Balwinder S Dheeman

On 11/22/2012 10:52 PM, tlaro...@polynum.com wrote:

On Thu, Nov 22, 2012 at 05:18:03PM +, Charles Forsyth wrote:

Yes, that would be silly. You need only the screwdriver, provided it's sonic,
but I suppose that just emphasises your point about tools.



You did not get the big picture: the screwdriver is for the engine; the
hammer is to deal with people coming arguing about why you use a
screwdriver...


LOL! ROTF!


On 22 November 2012 17:10, Kurt H Maier kh...@intma.in wrote:

If someone came to me and asked me to rebuild an engine with a hammer
and a screwdriver.


--
Balwinder S bdheeman Dheeman
(http://werc.homelinux.net/contact/)



Re: [9fans] C++

2012-11-23 Thread Gorka Guardiola
On Thu, Nov 22, 2012 at 11:32 PM, Winston Kodogo kod...@gmail.com wrote:

 But, let the record show, C++ has been scientifically shown to be an
 unbelievably crap and monstrously complex language, even though I earn
 my daily bread by using it. I was a contemporary of Dr Stroustrup when
 he was spending his time dragging the Cambridge mainframe to its knees
 using the Simula compiler - the kindest description I ever heard from
 friends in the computer lab was stubborn-  and occasionally, ok
 frequently, or indeed always, am tempted to view C++ as his revenge on
 the world for pointing out that he doesn't have a clue how to program
 efficiently.


Yes, this is why most games, which do not need speed or efficiency at all
are programmed in C++. I don't like C++, but it is a tool and as such, it
has shown it is useful in some environments. Is it aesthetically pleasant?
no. Is it more complex than needed? yes. But claiming that it is not possible
to program efficiently in C++ (or implying so) is going into religious grounds
and negating reality.

BTW, making ad-hominem attacks against a language author says more
about you than the language itself.


G.



Re: [9fans] C++

2012-11-23 Thread dexen deVries
On Friday 23 of November 2012 10:47:09 Gorka Guardiola wrote:
 On Thu, Nov 22, 2012 at 11:32 PM, Winston Kodogo kod...@gmail.com wrote:
  But, let the record show, C++ has been scientifically shown to be an
  unbelievably crap and monstrously complex language, even though I earn
  my daily bread by using it. I was a contemporary of Dr Stroustrup when
  he was spending his time dragging the Cambridge mainframe to its knees
  using the Simula compiler - the kindest description I ever heard from
  friends in the computer lab was stubborn-  and occasionally, ok
  frequently, or indeed always, am tempted to view C++ as his revenge on
  the world for pointing out that he doesn't have a clue how to program
  efficiently.
 
 Yes, this is why most games, which do not need speed or efficiency at all
 are programmed in C++. (...)

you've just stepped on my pet peeve, apologies in advance for what follows.

'NITPICK'
the bulk of in-game graphics processing is done via OpenGL calls/DirectX 
calls/whatever goes on the PS3' Cell CPU. the C++ parts could be replaced with 
Python and noone would be any the wiser.

similarily, Youtube flash player does not decode nor scale video in Flash' 
Actionscript; the GPU does it. unless you have broken drivers like i had once, 
in which case it is /slow/.

C++ for the assembly-line-style game development [1] is choosen as PHB's safe 
bet  -- a.k.a. ``industry's stadard practice'' -- and not on technical merits. 
cue picture of Scott Adams (of Dilbert fame).

if you really must, John Carmak writes idomatic C, not C++.
NITPICK;


[1] http://news.ycombinator.com/item?id=4821152 and countless other stories.

-- 
dexen deVries

[[[↓][→]]]


Reality is just a convenient measure of complexity.
-- Alvy Ray Smith



Re: [9fans] C++

2012-11-23 Thread Pedro Lamarão
Em 23/11/2012 08:21, dexen deVries escreveu:

 C++ for the assembly-line-style game development [1] is choosen as PHB's safe 
 bet  -- a.k.a. ``industry's stadard practice'' -- and not on technical 
 merits. 
 cue picture of Scott Adams (of Dilbert fame).

Are operating systems written in C for it's technical merits or because
it is industry standard practice?

--
 P.



Re: [9fans] C++

2012-11-23 Thread lucio
 Are operating systems written in C for it's technical merits or because
 it is industry standard practice?

Neither: pragmatism.  The language and Unix grew up together, teaching
each other many tricks.

++L




[9fans] C++

2012-11-23 Thread Winston Kodogo
 Been trying to read through this thread through the day and well I think
 the absurdity of your claim pretty much sums up a large portion of the
 thread, unfortunately.  Ay Caramba indeed :(


Hey, I haven't really been following this thread either. I have a day
job, and was just channeling my inner Boyd and venting in my spare
time because I entirely agree with Linus and jwz about C++. But thanks
for the compliment about my summarising prowess.

Bakul was right - that was rude. But he was also wrong, in that game
programmers pretty much all write in C, a most excellent language,
described in one of the finest books ever written about programming,
rather than C++. But I've bought every single copy of The C++
Programming Language since it came out, have waded through the
pompous and ponderous prose, grappled with the lack of a decent index,
and seriously, can you read chapter 22 of the Special Edition with a
straight face?



Re: [9fans] 9fans Digest, Vol 103, Issue 52

2012-11-23 Thread Winston Kodogo
Also, also, it was Gorka rather than Bakul who called me out for being
rude, so apologies to both.

But this is my favourite section from Herr Stroustrup's book - from
Section C.13.5 - although the following section (C.13.6 Template as a
Qualifier) is also good for a laugh. Right, I'll shut up and stop
trolling after this.

However, this does not allow us to write:
templateclass Cvoid f(Cv) {
C::iterator i=v.begin();//error
//... }

Unfortunately, the compiler isn’t required to be psychic, so it
doesn’t know that C::iterator is the name of a type. In the previous
example, the compiler could look at the declaration of vector to
determine that the iterator in vectorT::iterator was a type. That is
not possible when the qualifier is a type parameter. Naturally, a
compiler could postpone all checking until instantiation time where
all information is available and could then accept such examples.
However, that would be a nonstandard language extension.

Consider an example stripped of clues as to its meaning:

templateclass Tvoid f(Tv) {
T::x(y); // error? }

Is T::x a function called with a nonlocal variable y as its argument?
Or, are we declaring a variable y with the type T::x perversely using
redundant parentheses? We could imagine a context in which X::x(y) was
a function call and Y::x(y) was a declaration.

The resolution is simple: unless otherwise stated, an identifier is
assumed to refer to something that is not a type or a template. If we
want to state that something should be treated as a type, we can do so
using the typename keyword:
templateclass Cvoid f(Cv) {
typename C::iterator i=v.begin();
//... }
The typename keyword can be placed in front of a qualified name to
state that the entity named is a type. In this, it resembles struct
and class.
The typename keyword can also be used as an alternative to class in
template declarations. For example:
templatetypename Tvoid f(T);

Being an indifferent typist and always short of screen space, I prefer
the shorter:
templateclass Tvoid f(T);