« first day (1427 days earlier)      last day (3747 days later) » 

20:03
Hello everyone!
I just stumped on this: http://www.quora.com/Why-was-the-computer-language-following-C-called-C++-and-not-C+/answer/Saurabh-Singhal-9
What do you think?
What I think is that Quora is shite.
@PolymorphicPotato haha I hear that most of the times... Anyways, I got adblock and ghostery, probably that's why I didn't reveive that popup
> Interestingly, this question was asked to me in one of my on-campus placement interviews during my final year.

C has a postfix increment operator (++). The effect of applying the postfix increment operator is that the operand's value is increased by one unit of the appropriate type.

It is important to note that a postfix increment expression evaluates to the value of the expression prior to application of the operator. The increment operation occurs after the operand is evaluated.

Thus, C++ actually means it has most of the properties of C but is one step ahead of it.
That's funny; I also use AdBlock and Ghostery.
I'm feeling gay today.
Our postmortem of yesterday's troubles, subtitled "You didn't want really want that CSS, anyway" http://stackstatus.net/post/97322396704/outage-postmortem-sepember-11th-2014
> Our thanks to the team to ButtFlare for helping us to track down exactly what went wrong
20:18
^ found on reddit of course ....
@StackedCrooked can I squeeze your butt
no.
I mean I don't care.
it's not like I like stacked or anything
@PolymorphicPotato squeezes @AlexM.'s butt.
20:20
you so tsun-tsun
plantsoen-tsoen
Today I learned the existence of an apparently important person. The reason that I learned about him is because he died and it's in the news.
^ This happens a lot.
So it's a good thing people die.
Otherwise I'd never hear about them.
Men are more interesting.
I'm interested in knowing if my answer is any good. The original post has, what I believe to be code smells, but I'm not sure if my design is good approach.
oops, that did not go quite as planned...
@StackedCrooked Seems to be pretty typical that when you die, your importance is treated as about a million times what it really is.
@jliv902 A) it's shit B) I always downvote dumpers
@Puppy Could you care to explain why it's a bad way of doing this? I can't see how the OP's way is better?
He probably can't.
@jliv902 Scratch that. The OP's code is CONSIDERABLY better. His code does not involve endless shitting around with derived classes and manually instantiating function objects. Your code is just a shitty re-implementation of std::function.
@Mysticial "fammit"
20:48
@Puppy The other answer just says "your way is fine, but don't store pointers."
the only dumb thing the OP did is store raw owning pointers in a static vector, which is admittedly dumb, but not quite as dumb as re-implementing the class from scratch.
@jliv902 I misread his std::function as function pointer the first time around.
@Puppy, doing it the OP's way, he has a add a new member-function for every class he creates though. He's also using a static vector for some reason, which seems to me like a code smell.
it is.
but better that than pointlessly re-inventing a Standard class.
also his member function is trivial and mostly irrelevant.
If he had ten classes, then he'd have to add ten member-functions. With a little refactoring, I'd say my way is more scalable.
lol no.
your way involves adding a bunch of new classes every time.
20:53
@Puppy to be fair, didn't really just dump
not like must twats do
his member functions are trivial one-liners that don't really need to be member functions at all.
yours is re-implementing std::function but worse.
@jliv902 it is starting to seem that you are terrible
@Puppy Good point, I didn't think about the new classes.
@StackedCrooked ?? I was just asking for opinions.
once terrible, always terrible. sorry
@StackedCrooked Trolling? Or is there any meaning to your post?
20:57
Les Terribles
I'm not a troll. I'm StackedCrooked!
StackedTroll
Supertroll!
@StackedCrooked if you hadn't been like that for so long, we'd have you re-stacked.
@StackedCrooked TIL it's usual in Belgium that politicians are interviewed from behind a cord.
@PolymorphicPotato behind a cord?
oh, a rope :P
velvet in this case
B******** is a rather nice song.
o_0 why the censoring?
No idea. It's the name of the song. vOv
lol
who by?
21:07
Rammstein.
T***s?
lol YouTube audio quality
Google's most annoying feature is that it does not allow you to search for command line options.
yeah, that's not YT's fault
That is, unless you remove the leading minus sign.
21:09
oh yeah lol
but then, I'd do that anyway :S
YouTube's most annoying feature is that it does not allow you to search for spoken text.
Well, and the fact YouTube comments exist.
It would also be nice if YT allowed you to just stream the audio of a video
I should get earrings.
...
why?
Because they're nice.
21:13
what sort, like a little stud?
A dragon or something like that.
Or large rings.
dangly ones you mean?
get a tattoo instead, much better :D
Beh permanent shit.
Rather have small permanent scars in my ears than large permanent pictures on my skin.
21:20
at least tattoos can't get caught on something and be ripped out
Well, true. :P
if you go for the plug/gauged ears thing, I've seen some awesome yolks. They are like the baby alien from the Alien films, you have the head just poking through your ear with the tail dangling down in a curl.
this game has a good soundtrack
21:35
@thecoshman ah they're called hoops.
//set newret to NULL so debug errors did not appear.
int newret = NULL; // = NULL;
> int
For some reason, these gold bars look delicious.
@PolymorphicPotato hint: they are gold
They look so tender and yummy!
have you ever welded?
21:44
@StackedCrooked +"--option"
molten welds look so frigging tasty
I'm gonna drink this with my gold bars.
@sehe + now refers to Google+ crap.
It's just "…" now.
@PolymorphicPotato I recall when they changed that. For ~ 2 months tops
Oh did they change it back?
I never used + after they changed it the first time.
Nice.
Ell
Ell
21:54
I stopped using Google plus today
When I found out they merged the contacts :S
nobody likes the Google+ orgasm
@sehe <2 is another way of writing it.
doesn't convey the vagueness
@Ell "merged the contacts" - of what with what?
@Ell what do you mean?
@PolymorphicPotato I hated it so much I just kept on trying and found it appeared to work. Dunno about any official stance
22:00
IMO Google+ actually has a fairly decent way of managing who sees what, a bit confusing, but at least you have control.
Ell
Ell
Google plus contacts/friends were together with gmail contacts
For me
oh, well yeah...
Google plus monads
if you know the person you know the person
@thecoshman You have control on Facebook too. vOv
You can specify exactly who can see what.
22:01
officially
@Feeds which feeds were those
I added Skeet on google+, we have not chatted much.
The only thing I've done with +
Google+ is very confusing to people coming from Facebook.
Lol. Would it be a good idea to trie that. I don't think so. Where's your existing code? — sehe 8 secs ago
@PolymorphicPotato maybe now, but when G+ start, it impressed me with how you can control the groups you want to put people in and what groups you want to post to.
Facebook lists!
22:05
It's very much you control who can see what.
hibt: I don't use facecrap
@sehe Thanks, that was very empowering.
Acer rules.
Did you mean, Conan rules? Or sumtin
@Remy isn't in here is he?
22:22
@sehe Team Coco is a great source of entertainment.
@BenVoigt Not for quite a few days AFAIK
Hello everyone, can I ask your opinion on something?
His answer is getting worse with each edit, and I was hoping to get him in chat and go through the problems one at a time.
Hi guys, I'm an amateur programmer who is currently looking to bind C++ functions into Lua to allow me to do GUI, AI, Cutscene, and Ability scripting. I make heavy use of inheritance and composition within my class structure. What binding might be useful to use, and are there any hidden gems?
Hmmm.... considered a flat API for your script bindings? It can consume all the fancy multiple-inheritance magic it wants, but scripting might be easier with fewer layers.
22:32
@BenVoigt I lost the plot at the very first sentence there. That's... a strange text
What exactly is a flat API?
@sehe: What's even more amazing is that it's getting upvotes.
@Cinch: One without inheritance and minimal nesting.
@Cinch Like in a car radio, when there's a button for each channel
The problem is that I've already developed a core GUI within C++ and SDL. But here's how it currently works
@Cinch It means it's a good api.
22:35
Nested would be if you have to select a "group" first (FM1, FM2, AM3, AM1) and then select a channel.
Well here....
I currently have an abstract class called GUI_Element
Or worse, if you have to select the "radio options" menu item with a jog dial, down arrow 3 times for "channel presets", then jog dial for the channel you want, then push to tune
All my classes in the GUI derive from this element
Besides the GUI_Engine, with integrates with my GameEnginge
Doesn't flat API also mean a list of free functions rather than objects and methods?
Oh I see
Uh...
22:37
Oooh. I just noticed the "kick-mute" feature. Whom can I try this on?!
@sehe: Most probably you have to go to the radio manufacturer's website, select the frequency you want to listen, upload that to the car manufacturer, print it out on a barcode, and use that to program the radio.
@StackedCrooked izza ma point
My API for building GUI elements is bound to my GUI_Engine
good job
Like here's my code right now for building a GUI:
gui_engine.add_button(gui_engine.get_gui_skin(), 100, 100, 64, 32, true, "Button", "Menu");
gui_engine.add_textbox(gui_engine.get_gui_skin(), 100, 180, 128, 32, true, "Textbox", "Menu", "Text");
gui_engine.add_textbox(gui_engine.get_gui_skin(), 50, 50, 64, 32, true, "Textbox2", "Menu", "Name");
22:38
Flat APIs are nice because you can get away with forward declarations. (You can never call a method on a forward declaration.)
It's all bound to that one class
@Cinch that looks bad
@Cinch: That's already pretty flat. When you said "I used lots of inheritance and composition" I was especting to see
Well you see, here's the body of the add_button function
void GUI_Engine::add_button(SpritePool gui_skin, int x, int y, int w, int h, bool visible, std::string str, std::string parent_name)
{
GUI_Window* parent_window = get_window(parent_name);
GUI_Element* parent = parent_window;

GUI_Button* button = new GUI_Button(gui_skin, x, y, w, h, visible, str, parent);

parent_window->add_element(button);
}
In object-oriented programming, a god object is an object that knows too much or does too much. The god object is an example of an anti-pattern. The basic idea behind object-oriented programming is that a big problem is separated into several smaller problems (a divide and conquer strategy) and solutions are created for each of them. Once the small problems have been solved, the big problem as a whole has been solved. Therefore there is only one object about which an object needs to know everything: itself. Likewise, there is only one set of problems an object needs to solve: its own. A program...
22:39
don't write APIs with functions taking over 5 params TIA
@Cinch ho ho hold on. No need to spam the room
every language on the planet has structures
use them
Okay sehe
Button b = new PushButton(); b->size = Size(100, 32);  b->location.X = 100;  gui_engine::active_window()->widgets().add(b);
No but here's the thing:
22:40
@BartekBanachewicz BASIC didn't have them iirc.
@BartekBanachewicz old school basic doesn't have structures :P best it has is arrays
Sehe
That's quite a thing
is it really a god object if it is a sub-object of my GameState
It simply manages the GUI system
You judge that. I responded to what you said, of course I have no context, since we can't make it up
22:42
@sehe okay
But anyways
Is there a way I can simply call C++ member functions within Lua?
Ell
Ell
@cinch what is "managing"?
@Eli Well, heres how it works:
@Cinch Such a deep insight. I'm reminded of Plato and Beethoven.
Blaathoven
My GUI_Engine loads a GUI_Skin for my GUI to use
22:43
@Cinch use Sol
There. God has spoken
Oh I remember you Bartek. Why Sol? Is it lightweight enough for Android?
inb4 he wrote it (?)
Ell
Ell
Rapptz and derp wrote it
c++ member functions, probably not. extern "C" functions that call member functions on C++ objects? sure.
22:45
> SourceView is a new product to be offered by Lebeau Software. It is a standalone source code viewer and basic editor. It has searching and syntax highlighting capabilities for many common file formats that are used by software developers
I never knew there was such a great demand for crippled editors with ugly UI source
I don't see why it shouldn't work on Android
@sehe I want a semantically aware editor though
You're in your tunnel, mate
So, how would I go about integrating my current GUI functions with Lua?
Would I need to wrap it in C functions first?
You write the code, and you call it
How many times do I repeat "use Sol"
22:46
But doesn't Lua get hung up on the objects?
@Cinch: Have you ever used Tk, or any other popular script binding for UI?
@Cinch Conceptually, yes. A wrapper lib could save you some work
Lol "some"
Lundi was absurdly complex, and Sol is even more
@Cinch What does that mean
ah man
I feel so bad for Dick.
22:47
According to many of the bindings a lot of them have trouble with C++ object's member functions
Or so I think I understand
the Big Giant Head is a mean poo-poo head.
And then would I be able to access C++ objects in Lua in a lightweight manner?
no.
Ok I'm done here
You can make it easy/lightweight for the person writing Lua script.
22:48
Bartek I'll definitely look at Sol, it looks very simple
It's simple on the outside
Lua C api is awful to work with directly
But your Lua<->C++ interface isn't gonna be lightweight. Maybe you can use SWiG or something.
Just for gods sake please stop using the word lightweight
Android runs Java
Yeah, I'm gonna have to integrate my Lua AND C++ into Java, aren't I?
@Cinch That's why it's easier with a wrapper library. Yes, you'll need to jump through hoops, but Lua itself is also OO-aware AFAIK so it should be possible to map things.
22:49
Sigh.
I'm working on a lightweight code.
Well, Dalvik. But I agree it's not the pinnacle of efficiency.
@BartekBanachewicz Yeah, Google's super lightweight Dalvik VM :)
@sehe It's not, especially, OO-aware.
Ell
Ell
@bartek jvm
22:50
@Puppy can't have a class in Lua?
@BenVoigt IIRC they dropped it for one based on LLVM.
@sehe No.
Ell
Ell
Its prototype based iirc
@sehe: No, it's prototype based.
Lua is not an acronym
Ah. That spirit.
22:50
also, the OO-ness of the language is less relevant than the OO-ness of the API.
which it isn't, at all.
Arhh too many people wrong around
@Puppy But if both have 'classes' (and the corresponding object identities) there would surely be less work in mapping
Help give me leave link
@sehe They don't.
it's one of the shittiest APIs ever invented.
it's the worst of the OGL API.
SOMEONE IS WRONG ON THE INTERNET
22:51
implicit state mutation with invisible stack-based state.
Uh, Bartek
it's like assembler.
I'm sure you could wrap it with something that creates a Lua object with the method table preset to the right C accessor wrappers.
How would I go about modeling dynamically-allocated memory such as a std::vector of object*?
22:52
@Puppy Thanks for your contribution
While binding to Lua
You don't do that.
Don't operate on raw c++ memory
Just don't. Model how your object should behave.
Well here's the deal
Why do keep people doing that
Don't
22:52
@Cinch everything starts with a vision. a dream.
No I store pointers because
Store pointers, fine. Let Lua see them, uh-uh
ffs create idiomatic APIs whatever you are writing in
@Cinch So, are you asking or telling?
22:53
What's so hard in that
Well let me explain; I'm sure you guys have a better paradigm for doing this:
Ell
Ell
@bartek calm down young bartek - anger is the path to the dark side
I'll eventually have a pool of units (objects) that I'll need to update and check and stuff
I can't someone's wrong
Like attacking or defending or buffing and stuff
So I store pointers to those objects
22:54
I am addicted to correcting people
@BartekBanachewicz knowing what is idiomatic :/
Say I want to write my attack/ability functions in Lua
@BartekBanachewicz s/some/every/
Don't use pointers
Can I pass these objects to Lua, have Lua act on it, and then that's it?
22:54
Oh wait
Don't point users
So it's not only the Lua you are having problems with
Well how is storing pointers to my objects a problem?
I have a system for ensuring that they get removed and added accordingly
22:55
@Cinch that question requires a book to answer
NHS Jwbshsjs
Value semantica
Well I'm forced to with SDL_Texture*
Why do keep people doing that
Oh my effing and sdl
"Inheritance is the base class of evil"
TBH I don't think the time is ripe for our fresh gamedev to convert to modern C++. Let alone bind lua to it in grand style.
22:57
@Cinch okay so being serious for a while, because I am apparently tired. According to my professional opinion, you're doing everything in a way I have concluded wrong during my gamedev career.
And "shared pointers might as well be global variables"
First study good Lua code. Then decide what objects should exist in your Lua interface. Finally, write C++ code to implement those, using your existing UI framework as building blocks.
@sehe I was gonna add: "if you are ready for it". But I didn't want to seem pretentious :)
@BartekBanachewicz And let him be on his merry way. One day, he'll understand what you were trying to say
22:58
I have good intentions. That counts, right?
Yeah you see I'm actually a freshmen in college who's in a class where they teach noobs "printf"...
but I do C++ on my own so yeah
@Cinch unless they are to const objects
Is there a better way to manage objects?
non-shared pointers
@Cinch Ah, the first signs are there: you realize that's odd. You'll get there
22:59
printf prints "f" right?
@StackedCrooked but when working with Lua, it could become very natural to have the shared ptr
Okay then can you help redesign my Sprite_Pool?
@StackedCrooked it's a euphemism. You know what it prints...
BTW my first 15 minutes on Codementor are free

« first day (1427 days earlier)      last day (3747 days later) »