« first day (331 days earlier)      last day (4622 days later) » 

12:00 PM
This gives me the error :S
dynamic_cast<PlayerBeings*>(gameBeings[0])->getPlayerName() .c_str()

1 IntelliSense: expression must have class type
 
What's the type of gameBeings?
 
Does it compile? IntelliSense somethings freaks out for no reason. I would ignore it if the compiler accepts it.
Now, onto dynamic_cast... :)
Lunch time. I'll leave this to @Luc.
 
What the
I don't feel like explaining the misdesign of using dynamic_cast
 
Works now
I know ... you cannot be sure if it is the correct object that is casted to
 
No, it's a problem on a larger stage.
Why do you have a container of whatever element type it is right now if you need to downcast later on?
 
12:04 PM
I don't understand...the base class doesn't have the method of the derived class
 
Either the class hierarchy design or the use of the container is wrong.
Unless doing something clever.
 
No a player has a name...and not every game object has a name
so I don't need to put it in GameBeings class
 
Als
hmm Games what games
 
the crappy game I am making to learn C++ :P
 
Als
uhm...crappy...game...C++ All mutually exclusive
 
12:12 PM
lol xD
Have to to lunch now...later lads
 
Jeez, in latest 7zip the "open file" has disappeared. Archive as command line arg = no action. Dragging onto prog = "add to archive?". I have to laboriously click my way down folders to the relevant archive. Why are they fucking up all programs nowadays?
 
Meanwhile, on productive systems with CLI... :)
(Well I'm slacking right now actually.)
 
@LucDanton 7zip used to be pure cli
 
7zFM always sucked.
 
Other program that DOES NOT WORK anymore, WinAmp. It plain refuses to play certain AVI files, such as one Satch video. Plays fine in GSpot and VLC and even Windows Mediaplayer.
 
12:16 PM
Video with Winamp?
It barely ever worked for sound.
 
@CatPlusPlus Worked very nicely in the old days. You're too young kitten. The history of the thing is, the original developers left and then it went downhill, driven by managers.
 
Too young, or too smart to stick with an obsolete player?
 
@LucDanton I don't like to change just to follow the herd. I think like Ronald Reagan, don't fix it unless it's broken. But now WinAmp is definitely broken. Not just AVIs
And, it seems, also 7zip
I had license to WinZip on old computer, but that computer is very dead.
 
Sanity check: If I have a class X with one boolean data member and one constructor that initializes that boolean, it is impossible (under normal circumstances) to have an instance of X where that boolean data member is not initialized, right?
 
Hello, hello
 
12:31 PM
@FredOverflow I think so.
 
@FredOverflow yes, unless you count casts and stuff as normal circumstances
 
@FredOverflow X * p = static_cast<X *>(malloc(sizeof(X)));
 
@FredOverflow also, remember that "initialized" is not the same as "having definite value"
 
But malloc is hardly normal
At least not in C++
 
struct Bah { bool foo; Bah( bool v ): foo( v ) {} };

int main()
{
    bool indeterminate;
    Bah o( indeterminate );  // A bit UB, I think, but illustrates the point.
}
In the site that @Tony linked to, how does one get out of "console mode" without clearing biscuits?
 
12:38 PM
Like an idiot I attempted ^D.
 
@RMartinhoFernandes looks good but what is the big red thing?
 
sbi
1:19 PM
Oh my.
29
A: Teaching C++ to first time high school students: Where to draw the line?

Seth CarnegieI'm probably going to get a million downvotes, but I don't care. I think you should start with the data types that the language has built in like arrays and pointers, and when your students comprehend those, move on to classes and OO, then the STL. The reason is that you can teach people to und...

That guy doesn't even have a dozen downvotes yet. Please provide for advocating teaching built-in arrays over std::vector.
 
@sbi scary
 
@sbi he is right
One has to start from the basics :S
 
Right, like std::vector.
 
@AlfPSteinbach I updated my question, major brainfart on my part :)
 
std::vector isn't basics...
Maybe for intermediate programmers
 
1:23 PM
Okay, what's your resizable dynamic array of choice then?
 
@LewsTherin Vectors are a lot easier to use than arrays, that's the point.
 
Vectors definitely
 
There you go then.
 
But I wouldn't know that if I just started using vectors straight away
But then you could argue that an OO programmer doesn't have to know procedural programming
Ah well
 
I would never argue that.
 
1:26 PM
:)
 
"If you're teaching C++ to high-school students, then you've already crossed the line." -> nothing to add
 
Wtf? Why?
The dude should go on youtube...
 
@AlfPSteinbach It's chorizo.
 
"For many of the students on the team this will be their first introduction to programming." -> crossed
 
sbi
@LewsTherin That is nonsense. Just read my comment if you believe that.
 
1:30 PM
What is nonsense?
couldn't find your comment
 
Wait... how to initially get reputation again? ... damn that stuff
 
I think they should have used programming to teach math
The standards of teaching math in schools...awful
 
oh hai
 
sbi
@LewsTherin Please read the newbie hints. They explain how to get at the message another one refers to.
 
@LewsTherin very much agree
 
1:32 PM
@LewsTherin std::vector is the basics.
 
@LewsTherin But then you should probably teach Haskell instead of C++ ;)
 
you don't need to know what makes it so much better to use it
 
@FredOverflow they should ban that language..it isn't a language lol
 
What makes you think it's not a language?
 
@sbi ok I will.. @DeadMG Maybe you are right..but it would solidify the concepts
@FredOverflow I was trying to be funny...it is a language just goddamn hard to use
 
1:34 PM
@LewsTherin So what? Those concepts definitely aren't basic
it's a totally moronic idea that you should be able to implement std::vector before using std::vector
 
@DeadMG Unless you're teaching data structures.
But then, it wouldn't be before.
 
An array is like the ancestor of std::vector . It makes sense to learn that before or at the same time with std::vectors
 
More like "you know how to use vector, now here's how it's made".
 
well, even if you are teaching data structures, the implementation of std::vector has a lot more than just data structures- like exceptions, templates, etc
 
@sbi didn't find it
 
1:36 PM
@DeadMG Indeed.
 
@LewsTherin No, it doesn't. Arrays suck, and std::vector doesn't. I'd only teach people suck programming techniques when they don't suck.
 
@DeadMG Well, there's std::array now.
 
true true
 
loool isn't that backwards?
 
uh, no?
how else do you propose to get people to write non-sucky code?
if people suck as programmers and you teach them suck techniques, they can only write sucky code
 
1:38 PM
@LewsTherin No. And that's why pointers should be taught as late as possible.
 
if you only teach them non-sucky techniques, there's at least a solid chance they won't find suck techniques from the internet and might write code that doesn't suck
 
They only teach pointers after you are pretty much comfy with arrays
 
I'm back
 
Does that mean that when I was taught programming with OCaml I should have been taught how the runtime works? How does that help with anything :|
 
internet problems
 
1:39 PM
@TonyTheLion yo, mah homie
 
@LewsTherin Still way too early.
 
@DeadMG yo! What's up?
 
Eh, I'm currently in a Scheme class and they're teaching us how functions are executed.
 
Hi Lvalue.. @EtiennedeMartel when else would they learn about pointers?
 
I'm looking at your name
and I'm finding it to be most disappointing
it fails to trigger the normal associations in my head
@LewsTherin As late as possible.
 
1:41 PM
@LewsTherin I would show it right around polymorphism
(I know you can use polymorphism with references)
 
Lol, that's very late
 
yeah, I'd pick later than that
you can still use polymorphism with references
I'd teach pointers as one of the last things
 
Later than that? What the frack xD
 
Smart pointers should be enforced as well
 
well, you hardly ever need pointers in C++ programming, except to deal with legacy code
or implement stuff, and you need to know polymorphism before that
 
1:42 PM
Now that the standard has shared_ptr, there's no reason not to talk about them.
 
By the way I can do without the use of dynamic cast
 
@DeadMG like what associations?
 
sbi
@LewsTherin You seem to be right, I can't find it either. Anyway, in a message referring to another one, clikc the little up-and-left arrow on the left to get to the message referred to.
 
@LewsTherin You can dynamic_cast references.
 
@TonyTheLion Let me give you a hint: there's your name on one end, and "sex discussions makes him appear" on the other
 
1:43 PM
s∂x.
 
@DeadMG lol
 
actually
 
I have this
 
I have to suspect that there's probably your old avatar picture on the left side, instead of your name
 
string name ="Playername: " + dynamic_cast<PlayerBeings*>(gameBeings[0])->getPlayerName();
 
1:44 PM
@LewsTherin Why do you need to dynamic_cast?
 
well, I still mention sex sometimes, just as Tony The Lion instead of Tony The Tiger
 
But I want to do without it..I was told bad design
@EtiennedeMartel to access the derived function
 
dynamic_cast can be good design
 
@DeadMG Not in this case.
 
it's not inherently bad
we'd have to know a lot more about your general design to comment, though
@EtiennedeMartel You'd have to know the whole inheritance hierarchy and general setup to know that
 
1:45 PM
I have a base class GameBeings
which can update and draw
 
what I do know is that you must be storing raw pointers in gameBeings, which is bad design
 
@DeadMG Yeah, but something's weird with the fact that players (which are an edge case) are clumped together with all the other entities.
 
Why?
For polymorphism it is required?
 
@LewsTherin You could use smart pointers.
 
@LewsTherin Because you're just hoping that nobody throws any exceptions past your delete code? And that you remembered to put that delete code in all the appropriate locations?
use smart pointers, always
@EtiennedeMartel Depends how many players the system is intended to support- especially if that number can be variable
 
1:46 PM
But would that let me access the derived method?
 
Hopefully now that's the fourth time someone has said that you'll take the advice to heart.
 
@LewsTherin yes
 
OK then...so be it
 
there is a dynamic_cast style method for smart pointers
and in addition, you can just use dynamic_cast<T*>(ptr.get()) for the same result
 
1:47 PM
@DeadMG It's not the same as it is non-owning. The dynamic_pointer_cast is here for ownership, it's not an alternative.
 
OK brb
I will try and understand it
 
true, but he wasn't after an owning result
 
I still wonder why an entity has the player's name.
 
Hence dynamic_pointer_cast should not be mentioned :)
 
@EtiennedeMartel I just put that there to represent one player
for now...there is only one player
Do I need to know proxy pattern?
 
1:50 PM
generally speaking, we don't have a high opinion of patterns
most of the time, people use them to avoid having to think
 
I would have a Player class that refers to a GameBeings. A composition relationship, not an inheritance one.
 
What do you mean refers?
Has GameBeings has a member object? Or the other way round
@DeadMG yeah I don't want to think now
 
the problem with the composition is
first, you'd have to maintain two containers, one for players and one for everything else
 
Re 10 Technical Papers Every Programmer Should Read (At Least Twice), as far as my counting is correct there's 11 articles?
 
the other is that you would now have to update() and draw() the players separately, violating DRY
 
1:52 PM
@AlfPSteinbach Yes.
 
@DeadMG Well, no, because the player is not an entity.
 
:S
The player is
 
@LewsTherin I did not want to say "has a pointer".
 
@AlfPSteinbach I didn't really count them, I just copied the title and the link here
 
WHat is DRY by the way?
 
1:54 PM
@LewsTherin Don't Repeat Yourself.
 
@EtiennedeMartel It is. Players have to be drawn and updated too.
 
ah cool
 
hm, KISS and DRY. sounds like someone's drooling
 
what is KISS?
 
Keep It Simple, Stupid!
 
1:55 PM
:)
 
lmfao
I love programmers and their acronyms xD
 
That's how we roll.
 
Can I be a programmer too? :P
 
One day, you will be. Hopefully.
 
One day? That's gay! From Day one I've been hoping to be one
Seriously..
 
1:58 PM
much to learn you have, impossible it is not
 
Master Yoda, wise you are
 
@LewsTherin Careful with that G word, kid.
 

« first day (331 days earlier)      last day (4622 days later) »