« first day (668 days earlier)      last day (4272 days later) » 

10:00 AM
supposedly, this Algorithm book I have, claims that a particular algorithm implemented using STL in C++ is slower than the C version using raw pointers
 
@TonyTheLion that may not be true, but is possible
 
that has to got to be tripe, I don't believe that a std::vector is slower than a int* into an array
 
@TonyTheLion either way, I bet it is a dam site easier to do it in C++ with STL
 
It's slower only if your compiler is crap.
 
@thecoshman that's something you can't argue about
 
10:01 AM
Your memory management model is bad, you should feel bad. Whilst you can get away with not deleting memory just before your program exits, it's very much like going on a murder spree and saying "it's OK, I was about commit suicide any way" — thecoshman 2 hours ago
lol
 
@thecoshman yes, for sure
 
@FredOverflow your welcome :D
 
It's slower if "the C version with raw pointers" doesn't do the same. Which seems to happen often in those benchmarks.
 
@TonyTheLion C has algorithms? Oh yeah, bsearch and qsort :)
 
@FredOverflow this was a Dijkstra shortest path
 
10:02 AM
@R.MartinhoFernandes what the hell man? Memory is totally a resource!
 
@thecoshman So?
 
shall I post the code?
so you guys can see?
 
"I can totally leak memory" is not a reason to say "RAII is only for library writers".
 
for giggles
 
@R.MartinhoFernandes was that comment not towards me?
 
10:03 AM
It was towards the OP.
 
still, I don't get your point
or did I miss the sarcasm tag?
 
@TonyTheLion Yes
 
@TonyTheLion What parts of the STL did they use?
 
(FUNNY: I typoed "TinyTheLion" at first)
 
10:04 AM
You can just type "@T" and then hit tab.
 
@kbok It's nice to think about it that way, i s'pose
 
> Seems that most the RAII and memory mgmt techniques are really geared towards library developers. If you developing custom in-house applications for a small group of users, and the program tends to be restarted often... don't worry about who owns your pointers..
@thecoshman this is just silly because RAII is not about memory.
 
@FredOverflow I usually type two or three letters to remove ambiguities
 
@FredOverflow vector<int> and vector<bool> and vector<T>::const_iteraror
 
10:07 AM
I wouldn't be surprised if vector<bool> was slower.
It's very dishonest of you to use a tool that exists to trade speed for space in a benchmark about speed.
 
> an instance of a class with a single boolean field takes up 16 bytes: 8 bytes of header, 1 byte for the boolean and 7 bytes of "padding" to make the size up to a multiple of 8
wow
 
@R.MartinhoFernandes RAII is not about memory no, but the concepts of RAII extend to how you manage memory. Admittedly the rise of smart pointers has negated this somewhat, but the idea that a class should be responsible for allocating and deleting it's own memory, how is that not a RAII concept?
 
@thecoshman RAII is about resources, and memory is a resource (you said it yourself!). I don't see where the conflict is.
I'm merely objecting to relegating RAII to being a "memory management technique".
 
@R.MartinhoFernandes maybe a confusion between 'memory' and 'memory management'
@R.MartinhoFernandes oh for sure, RAII is more then just MM
but when considering MM, the concept of RAII should be one of the main concerns
 
"C++ is a programming language for games", true or false?
now stop arguing
 
10:14 AM
we where arguing?
if anything, we where misunderstanding each other
 
@FredOverflow That's ambiguous
@FredOverflow But I think that C++ is well-fit for game development indeed
 
@kbok how?
@kbok no more then any other langauge
it has good library support, and is rather efficient language
 
Asset *cAsset=new Asset(szName,szTexture);
VectorAsset.push_back(*cAsset);
 
@thecoshman This statement can be understood as "C++ has been designed for gamedev" or "C++ is good for gamedev"
 
@FredOverflow Oh, the leaks.
 
10:19 AM
@kbok oh I suppose
 
@kbok Exactly. Just as "RAII is a technique for memory management" is ambiguous, but not wrong. RAII can be used for other things, and there are other techniques for managing memory.
 
@thecoshman Are you serious ? Try making a game in perl or haskell
 
@kbok I did "Connect Four" with AI in Haskell once.
 
@FredOverflow Now go make a FPS in haskell :)
 
C++ is good if you want to make game from scratch. Based on modern technologies though, I would say UnrealScript is game language\
 
10:21 AM
@kbok Why? Not all games are FPS. And I don't particularly like FPS.
 
It's just that technology (engine - renderer, etc) is coded in C++. Game logic is usually coded in higher-lvl language
And it's the logic that makes a game, not engine, IMHO
 
@kbok the languages them selves would be fine, they just do not have the library support. AFAIK perl has support for basic OS GUIs
 
@BartekBanachewicz Why would anyone in their right mind build a game entirely from scratch in C++? There is an infinity of C++ libraries relevant to game development.
 
0
Q: I am not a robot!

Konrad RudolphSome days ago, the spam protection was turned up a notch. Unfortunately, it overshot the target by far. Now, as soon as I make two edits in close succession (which happens often – I’m sloppy), I am presented with a “human verification” and a totally unreadable captcha. It takes an average of fiv...

 
What I mean is that in gamedev you need extreme optimizations as well as high-level programming, and compatibility with very specific platforms. Not all languages have that.
 
10:22 AM
There's no language that has that. Use 2 instead. Or more.
 
You don't need extreme optimizations in every game.
 
@FredOverflow You need certain optimizations.
 
@FredOverflow I think we aren't talking about the same kind of games. I'm talking about, like, AAA console games.
 
@kbok maybe for AAA at a push
 
10:24 AM
@kbok I'm not into these kinds of games. Casual games also make a lot of money, you know ;)
 
We need a ideone/LWS-like website that is not butt-ugly.
 
@kbok userscipts ftw
 
@TonyTheLion Why is it so distorted? Am I drunk?
 
@kbok No. You need that on some games.
 
So if we're talking about games in general, I think C++ is great, but many other languages would do
 
10:28 AM
like Lua <3
 
std::numeric_limits<int>::max(); <-- Not C.
 
@TonyTheLion How much slower is it?
 
@FredOverflow It is the syntax highlighting that overlays the fonts in slightly shifted location. Try to fiddle with text size in your borwser, it will get better /cc @kbok
 
@sehe I can make it bigger or smaller but not prettier :)
 
@kbok I would not do everything in just C++, I would make use of something like Lua for the flexibility
 
10:31 AM
@kbok Mmm in Opera it get's less blurry sometimes. LWS has funny inaccurate overlayed texts
 
"get's"? Seriously?
 
and depending on how complex things started to get, might look some sort of package system, so something like a monster can be packaged into one file, that combines art assets and logic for how it would be have in game
 
@thecoshman +1. would be true in any compiled language though
 
Erm, why? Many compiled languages (for some definition of compiled) allow you to load code at runtime.
 
@kbok Nope. Lisp is compiled, yet dynamic.
 
10:34 AM
@kbok well, I can see the appeal in having all game logic (and even some art assets) compiled into one black hole of an executable, to stop people modding, but I personal like the idea of people modding games
 
@BartekBanachewicz You're being pedantic.
 
If you mean compiled as in "completely ripped out of its C++ soul and turned into an assembly abomination that carries little of the original in it", then yes, it's true in any compiled language.
 
@kbok I'm being complete. + Being a secrete fanboy of lisp I couldn't not mention that
 
It appears there is a Java book written by someone named Poo. I think I'm dying.
 
 
10:36 AM
@FredOverflow oh christ, pure gold
 
@FredOverflow I nearly fell of my chair
 
@R.MartinhoFernandes perhaps I am being idiotic, but isn't dynamic loading of libraries a non standard thing in C++... but support by more or less everything?
 
@thecoshman ldlfcn and LoadLibrary
 
@thecoshman Then why did you say you prefer to put parts in Lua for flexibility?
 
Sorry I didn't read enough. The thing is, OOP is reversed in French so we write it POO. "Programmation Orientée Objet".
 
10:39 AM
@R.MartinhoFernandes it's easier for people to tweak stuff through a text file, then through a binary
 
I know a lot of people who put "Good knowledge of POO" in their resumes.
 
@thecoshman I don't know of many systems that allow you to load C++ source dynamically.
What you described above is not it.
 
@R.MartinhoFernandes it claims for a set of V = 16,386 and E 2,081,024 it takes the C++ one 2113.7 seconds and the C one 1215.6 seconds
 
@R.MartinhoFernandes I guess you could embed a compiler into your program... and at run time, compile a dynamic library and then load it...
 
@kbok What is RAII in french? IIAR? :)
 
10:41 AM
@TonyTheLion Welll, I'm sure vector<bool> is skewing results. It's written to be slow.
 
Maybe RAEI.
 
AREI?
 
@thecoshman that's sick. Gotta try it someday. When i'll be very bored and very lonely. But still, someday
 
10:42 AM
isn't vector<bool> optomissed for space, packing each bool into a single bit?
 
screw this
 
@R.MartinhoFernandes I had a suspicion about vector<bool>
 
what about CRTP? PTRC?
@FredOverflow it does that if you have lines too long
 
10:43 AM
@FredOverflow wtf?
 
 
@FredOverflow And this is why pseudonyms were invented.
 
it looks like line 33 is at fault.
 
@FredOverflow AREI I guess
 
@kbok It's fake. please tell me it's fake.
 
10:44 AM
@kbok Green Day comes to mind
 
@kbok Yeah, I know of that.
 
@ecatmur MTCR
 
Q: "How to express Java in statements?" A: "Java sucks."
 
10:46 AM
@kbok hmm... I think my idea is better
 
@FredOverflow What?
 
@R.MartinhoFernandes from the amazon description
> The book attempts to answer the following questions in its delivery: What is Java? What is the Java language composed of? How to express Java in statements? How does Java control the flow of execution? Is Java object-oriented? and How to handle inputs and outputs in Java?
 
@kbok ah, modele des templates curiosement recurrement, if I remember my Franglais.
 
@FredOverflow birds of a feather
 
ARhgehjer. I'm seeing "Use shared_ptr." all over! closes tab before eyes vanish in a pool of blood
 
10:48 AM
@FredOverflow A shit language. Keywords. It's shit. Shits all over it. Painfully so. Just don't.
 
@ecatmur "Curieusement" :) But the rest is good
 
Except it's lacking an accent, no?
 
@kbok should it not be PTCR, it's a pattern not a model
 
@DaoWen: I did but the "curious guy" flagged that and got it deleted, along with his comments about his ideas about my competence and someone else's motives. So maybe that will happen again. But anyway, the third paragraph has at least two interpretations, but both of them incorrect. In C++ you can inherit in an implementation of an interface, Java-style. That's what virtual inheritance is about in this context. The part that "curious guy" mentions in 2nd para is just indirectly relevant: it's part of the basis the allows the Java-like implementation inheritance, but it does not enable it. — Cheers and hth. - Alf 8 mins ago
^ how SO is infused by politics: question closed as duplicate of a closed question, comments about incorrectness flagged and removed. what's next?
 
@Cheersandhth.-Alf Your original comment was removed? Okay, it was maybe a bit offensive but it mostly explained what was wrong :s
I thought you removed it yourself
 
10:50 AM
From the looks of it, the discussion got heated (and knowing curiousguy, I have an idea of why that might have been)
 
No, it was flagged and removed by a mod.
 
I just avoid curiousguy in general.
 
@R.MartinhoFernandes I never answered his follow up comments. He called me incompetent and someone who upvoted my comment, inane.
 
(And a bunch of other problematic users; I keep a mental list)
 
@Cheersandhth.-Alf standard practice for mods, just sweep it all asside
 
10:53 AM
Was the question you linked earlier reopened?
I don't find it particularly interesting, but I don't think it's closeworthy.
 
@R.MartinhoFernandes does not the wiki have a name and shame section? or are we keeping that for chat-twats?
 
@thecoshman It's for chat, I think.
 
Ell
hi guys :)
 
@R.MartinhoFernandes it's a wiki :P
 
I'm sure most regulars here know of There is Nothing We Can Do. That's another one I avoid interaction with.
 
10:56 AM
0
Q: Interface as in java in c++?

Trall Possible Duplicate: How do you declare an interface in C++? Somebody asked me a qustion: "In C++ there are no interfaces like in java. But event then you could realize them in c++, how would you do that?" How? I would make a class with virtual methods. That would be look like an inter...

 
And MetallicPriest.
 
^Neads 3 (or <3) more reopen votes! :-)
 
And probably others that I recognize on sight but don't know off-hand.
 
Ell
anyone know what parser source code I can look at written in "good c++"?
Just to learn about parsers
I think I've asked this before. hmmm...
 
Look at Wide's parser. I'm sure it's crap, so you can at least learn what not to do.
joking
 
10:58 AM
@Ell for parsing what?
@R.MartinhoFernandes Wide is the puppy's 'thing' right?
 
Ell
well anything really, as long as it's not too complicated
 
@thecoshman Yeah.
 
Ell
Have any of you read through the wide spec?
 
@R.MartinhoFernandes it would strange if it did some how come to be a main stream langauge
 
10:59 AM
Well, most of it.
 
review time!
 
@R.MartinhoFernandes Bjarne Stroustrup said: "shared_ptr is not my first choice, it's actually my last choice."
 
@thecoshman That's pretty unlikely.
@FredOverflow Exactly!
 
@StackedCrooked Is that a figure of speech?
 
Ell
what alternatives to shared_ptr are there? o.O
for shared ownership
 
11:02 AM
@FredOverflow Yeah. The full expression is "Birds of a feather flock together."
 
The point not to use alternatives for shared ownership. It's to not use shared ownership when you have no need for it.
 
Ell
Ahh right
 
@StackedCrooked And what does that mean?
 
@FredOverflow It's also the name of a card trick. That's where I first learned the expression.
@FredOverflow People with similar interest hang out together.
@FredOverflow In this case: Danny Poo likes crappy languages.
 
Ah, that was a long shot. Thanks :)
 
11:05 AM
Yeah, it was a bit of a long shot :P
 
sbi
@BartekBanachewicz Yeah, I think I know that "sz" is a voiceless "sh". whereas "rz" is a voiced "zh". (The latter is necessary to pronounce Przewalski horses.) But That's about the extend of my knowledge there.
0
A: I am not a robot!

sbiOver almost 4 years on Stackoverflow, Konrad has earned almost 150k rep. A highly committed SO citizen, with 2.5k answers and a mere 60 questions, he's one of those users that made SO famous. He has 40(!) accounts across SE, 8 of which sport >1k rep. He is a moderator on one site. Is anybody re...

@R.MartinhoFernandes Yeah, curiousguy is a curious guy.
 
The eye-brain protocol on mice was cracked.
 
@sbi Bah. That's more than you need anyway. Most Polish ppl speak english, and even if you know a few Polish words, it's usually just for fun and conversations quickly switch to english/german
 
sbi
@R.MartinhoFernandes Are you trying to pull my leg?
 
@sbi I'm still reading about it, but I'm serious.
 
sbi
11:08 AM
@BartekBanachewicz Speaking English doesn't help me when I need to ask the way to Szczecin, though.
@R.MartinhoFernandes Link?
 
Seze - keze - sin, obviously.
 
@sbi Oh, true. You could always use the German name, though (Stettin). They are usually recognized, especially in the western Poland
@R.MartinhoFernandes ^^'
Oh, SO store is closed? :'(
 
sbi
@R.MartinhoFernandes "Obviously" is a word that doesn't apply to Polish. (They have an "L" letter that's pronounced — I believe — much like the English "W"!)
 
@sbi Only with the little slash, no?
 
sbi
11:11 AM
@BartekBanachewicz I'd rather use the local names and pronunciations when being abroad. I consider it a question of respect.
 
@sehe Unicode calls it "L with stroke" (except in all caps).
 
@sbi Oh, it certainly won't be seen as such; you're a guest, after all.
 
@sbi I feel the same.
 
sbi
@BartekBanachewicz I know, but it's hard to produce with my keyboard.
@BartekBanachewicz For good reasons, Germans haven't always been welcome in Poland.
Anyway, lunch time, I'm off again...
 
> In most non-European languages, it represents a voiceless alveolar lateral fricative or similar sound.
One day I'll learn what all that crap means.
 
11:14 AM
I think the exchange is one of the beast ways to break the barrier
 
Beast ways are not a good thing.
 
That was on purpose, actually. Didn't really know how to turn it into pun, though.
@sbi Actually, many Polish youngsters also find it hard -.- (as in your/you're in English) - just being lazy. The language is somewhat being simplified. While it makes mobile writing easier, it's kind of bad.
 
@R.MartinhoFernandes With a stroke. I hope it doesn't suffer braindamage
 
List of games shown at Gamescom 2012 gamescom-cologne.com/media/gamescom/downloads/pdf/presse/…. Check Valve's entry.
> It could of course me a mistake. It could be a joke by someone. It could be a crack in the fabric of time and space, allowing an entry from Gamescom 2098 to appear on 2012′s list.
 
Ell
11:18 AM
half life 3? :D
hopefully for linux tooo! :D
 
jesus fucking christ, it would be about damn time that Half-Life 3 actually existed.
 
pardon the language?
 
Ell
he meant fudging, surely
 
@DeadMG Hopefully it won't turn into Half-Life Forever.
 
why would jesus be fudging it?
@R.MartinhoFernandes That's more like full life
 
11:21 AM
@DeadMG Half-Life 3? we're still waiting for HL2 Episode 3 :p
 
@melak47 I think that's pretty guaranteed to not ever happen.
 
Ell
Going for a swim in the pool
talk to you guys later :)
 
after 5 years of waiting, I could care less :p
@Ell don't let your brother use up all the internet :)
 
lol, use up all the Internet
buy a better internets pipe
 
11:24 AM
Hi everyone.
 
@R.MartinhoFernandes lulz
@Ell whew. That was close. Pretty nearly went taking a swim in the dumpster
@DeadMG Half Pipe Forever
 
I like how "should" in "it should be." links to Lampshade Hanging.
 
lol
 
If I benchmark my code several times I get slightly different results each time. Should I note the best, the worst, average or median result?
 
Also, I shouldn't have clicked on it. rabidly closes TVTropes tabs
 
11:25 AM
@R.MartinhoFernandes rabidly? Who've you been reading lately
 
I'm currently reading Unseen Academicals by Pratchett. /cc @sbi :)
But this is not related.
 
You think
TIL: Robots have subconscious levels of thought
 
@StackedCrooked Depends. RT? - worst. End-user? Average (probably). Simulation? Maybe best
 
throw ex; // out of apartmentFredOverflow 8 secs ago
 
That's probably unsafe (for COM apartments)
 
11:28 AM
hehe
@BartekBanachewicz Marketing? "Adjusted" best.
 
@FredOverflow there should be a badge for trolling ancient questions — sehe 5 secs ago
 
@BartekBanachewicz Suppose my algorithm needs to calculate 1 million prime numbers. If the benchmark is sometimes a little slower then I could assume that's because the OS was occupying the CPU with something else while running the benchmark. So perhaps the best result should be considered the least influenced by outside factors.
 
24
A: Good C++ GUI library for Windows

jk.If you are looking for a modern C++ GUI library, then Adam & Eve from the Adobe Source Library (ASL) is the right thing (it relies heavily on the Boost libraries). What I really like about it, is that the design of the layout is completely decoupled from the code. The layout definition can ...

At first I thought this was an EDSL, and I was instantly near orgasm.
 
@StackedCrooked If you want to compare it to something else, you need to have that something else influenced by outside factors by the same amount, which is impossible, so you should use average.
@FredOverflow You may need to get laid.
 
@sehe - Did someone mention Robots ?
 
11:31 AM
@R.MartinhoFernandes I'm fine, thank you very much :)
Guys, do you usually browse C++ questions "newest" or "active" (or something else)?
 
@Rocketmagnet Not me
@FredOverflow None of the above
I troll questions on 'newest' only (if at all). 'Active' is more of a popularity contest. I go to reddit/youtube for that
 
@R.MartinhoFernandes Really, so one-sided? I have ^
 
@sehe There are too many questions if I include .
 
@Rocketmagnet So in other words, you're linkdumping, but instead of a question, you're dumping a site proposal.
 
11:36 AM
 
@sehe I don't suppose the c++-cli tag represents c++ without cli? :/
 
Naw, I'm good.
 
What, so I'm not allowed to mention another SE proposal ?
 
We don't like link-droppers.
 
11:40 AM
in fact, we hate link-droppers
normally I downvote, but I can't downvote a proposal.
 
Sorry to have made such a faux pas.
 
@melak47 it doesn't
 
constexpr unsigned long long operator"" bull();, lol groups.google.com/a/isocpp.org/forum/?fromgroups#!topic/…
 
0
Q: Another Way to do Templates in C++?

ApprenticeHackerI was just messing about, when I discovered this pre-processor dependent way of creating a template class: #include <iostream> #include <typeinfo> // Is this a valid template class? #define TEMPLATE_CLASS(T)\ class TemplateClass_ ## T\ {\ private:\ T value;\ public:\ void pr...

 
@ApprenticeHacker that guy's a pure genius
 
11:47 AM
@BartekBanachewicz Thanks. It's me. :D
 
@BartekBanachewicz It's himself.
 
Oh, hell, didn't notice ^^
 
Stroustrup considered a similar technique to simulate templates in C++ before they got real.
 
It's f***ing unfair he got downvoted for that question
 
@R.MartinhoFernandes are you doubting the puppy's ability to stick to working on Wide long enough to see it become a good viable language?
 
11:50 AM
Oh, I was ignoring that factor. It's pretty difficult for a language to become mainstream.
What are the most recent mainstream languages?
C#?
 
@thecoshman Hoe do you translate "Pattern" in French ?
 
@kbok Pattérn?
 
@R.MartinhoFernandes if he can produce a decent language, with decent support, I would consider using it. Though, he does have to compete with the fact that low level hardware APIs already exist for C++
 
"pattèrne"
 
11:54 AM
don't go all fancy with your 'correct' French
where's that bug when you need her?
 
@ecat Yeah... except int a[10] declares an array of ten integers, but the expression a[10] invokes undefined behavior :) Also, int &ref declares a reference to an integer, but the expression &ref is a pointer to an integer :) — FredOverflow 20 secs ago
 
Pretending for a moment that I wanted to do this stackoverflow.com/questions/11898657/…, I don't have any idea what I'd have to do besides writing a bunch of stuff (which is actually another issue).
 
@kbok patron?
 
@sehe Yes. That's very literal though.
@thecoshman That's not a real word :)
 
@R.MartinhoFernandes contact a publisher?
 

« first day (668 days earlier)      last day (4272 days later) »