« first day (1561 days earlier)      last day (3379 days later) » 

3:00 PM
0
Q: RAII and modern C++ in game dev

KernaelAre the use of the RAII idiom and of the modern C++ principles adapted to game development in general ? Automatic memory management on the stack Smart pointers References Or, can these features cause a performance hit compared to Dynamic memory management on the heap Raw pointers : new / de...

lol
 
user1804599
 
I don't get this idea that people have
"are these new features good or do they ruin the sacred art of game dev set in the 90's?"
 
So I found an actual retailer for mobile GPU's for Sager/Clevo laptops
 
@AlexM. Thanks to you and Nooble V2.0, I may get some rep out of that:)
 
watch out
the question is offtopic
it's in this category
 
3:09 PM
Oh -hang on, I screwed up. I linked to the wrong poster. I meant to link to @Borgleader 'Notification' question.
 
> Questions about "how to get started," "what to learn next," or "which technology to use" are discussion-oriented questions which involve answers that are either based on opinion, or which are all equally valid. Those kinds of questions are outside the scope of this site. Visit our help center for more information.
 
@AlexM. its not surprising people ask these questions after reading blog posts and watching presentations by studio developers
like that cppcon presentation by Mike Acton... id expect tons of people to ask "should I use the STL, is it too slow for my asteroids game" after watching something like that
 
user1804599
I have a good idea.
 
user1804599
I'm going to put rotatable panels all around the planet and have people pay me for sunlight.
 
@Pris The problem with presentations like that is when "noobs" watch them, they start asking questions like "should i use this or that for performance reasons" without realizing you shouldn't care about performance until you have working code.
and most of them haven't even started coding the damn game yet
so its utterly pointless
 
3:16 PM
@рытфолд How do you plan to get the funds to start this? How will you service them?
 
user1804599
Kickstarter.
 
user1804599
Backers get free sunlight for a year.
 
@Pris It's the old story/syllogism: 'I used the STL for my Asteroids game. It was too slow. Therefore, the STL is too slow'. The other possible conclusions, like 'I have next-to-no design or coding skills', are conveniently forgotten.
 
user1804599
I'll be rich!
 
And what's stopping these backers from buying their own panels?
> pointless
 
3:18 PM
@MartinJames And then you look at their code and they use std::list everywhere
 
user1804599
@Nooble I won't give them sunlight if they are rebellious.
 
@Borgleader I agree with you in a sense but I'm very sympathetic to those people because I've written so much code that ends up being completely wrong and badly designed. That feeling of unsureness when you've been burned before is pretty daunting
 
@Borgleader Yeah:(
 
@Pris well, most code is badly designed. The trick is to not let that paralyze you
6
 
@Pris Every time I see one of these questions I wanna comment: "1. Make it work, 2. Make it pretty, 3. Make it fast. You're at step 1 come back when you reach step 3"
 
3:20 PM
@jalf sometimes key decisions you make early on completely cripple the ability to fix your mess.
 
@Pris And sometimes, agonizing over early key decisions completely cripples the ability to make any progress
 
@jalf extremely sound advice. I have an extremely bad problem with that actually and feel like its by far the worst aspect of me as a developer
 
@Borgleader lol, like the very common: 'I must have a lock-free solution' before trying any solution at all.
 
*advice <-> observation
 
@Pris Yeah, I definitely struggle with the same a lot. Funnily enough, recognizing the problem is much easier than actually overcoming it :D
 
3:21 PM
@MartinJames Obviously!
Locks are slow therefore lock free must be the solution
right?
 
@Borgleader Of course:)
 
@рытфолд I misunderstood you, I thought you meant that you will put solar panels around the world. Why would people pay you to kickstart what it basically world domination?
 
user1804599
Because people are idiots.
 
@рытфолд you can be like that guy who sells canned air in china
 
user1804599
I'll sell canned diet air.
 
user1804599
3:28 PM
Eco-friendly, too.
 
Yeah.
 
user1804599
And GREEN.
 
user1804599
And biological.
 
green air? :/
 
user1804599
Biological Green Eco-Friendly Diet Air! Now for only €20 per litre!
 
3:29 PM
First pollute the crap out of the world, then start selling breathable air.
 
user1804599
And if I sell this in the EU I'll be subsidised to heaven.
 
sell canned air on mars
 
It's like that movie with Dr. Seuss
 
user1804599
3:45 PM
$invocant .= method desugars to $invocant = $invocant.method.
 
user1804599
Shiny.
 
sbi
@wilx Yeah, I guessed they came from Dutch and @Pris already found a page explaining their origin.
@Pris I'd worry the day I look at old code of mine and do not think Oh My God! Because that would mean I haven't learned anything since.
Oh man. Now that I am, briefly, back among the living, everyone else has gone. :(
 
4:09 PM
@Borgleader You do realize that people new to programming are not aware of the concept of debugging, right? — dmg 39 mins ago
I wanted to answer "Yes that's why there are so many shitty questions on SO"
 
sbi
@dmg: OMG! Then, pleeeease, let's never mention the damn thing to them, so this won't change! — sbi 23 secs ago
 
:)
This story just seems fitting. — Joe 3 mins ago
 
@рытфолд You can call GetValueOrDefault() on a null value?
 
@JohanLarsson is that real?
 
4:23 PM
@JohanLarsson That looks really interesting. I bet the robot doesn't know the human's spin, though?
Should be easy to defeat it with spin.
 
@Pris I don't know the guy but it looks real to me.
 
Or just play shortly behind the net, it looksl like the robot's arm isn't long enough to reach there :)
 
or rewrite it in Java?
 
user1804599
@FredOverflow On a Nullable<T>.
 
sbi
> The ultimate archery trick is splitting an incoming arrow with your own. – youtube.com/watch?v=BEG-ly9tQGk
Die, TT robot.
 
user1804599
4:29 PM
public sealed class NonRetardedNullable<T> {
    private T value;
    private bool present;

    public NonRetardedNullable() { }
    public NonRetardedNullable(T value) { this.value = value; present = true; }

    public T Get() { if (!present) throw new Exception(); return value; }
    public T GetOrDefault() { if (present) return value; else return default(T); }
}
public static class NonRetardedNullableExtensions { /* LINQ shit */ }
 
user1804599
You want this instead.
 
But isn't value/present what C# does under the hood, anyway?
 
user1804599
Nullable<T> is broken in several ways. It only works for value types. It has implicit conversions. It doesn't have LINQ shit.
 
user1804599
It has all the problems of null except nullability being implicit.
 
How old is Nullable<T>, and how old is LinQ?
 
user1804599
4:34 PM
Hell, you cannot even do Nullable<Nullable<T>>.
 
@рытфолд when would that make sense?
 
user1804599
In generic code.
 
and considering nullable should have monadic properties, it's a monad you can't join / "compress" - oh sweet jesus
 
user1804599
Special cases in type systems make things horribly hideous.
 
user1804599
void is one of my favourite examples. Nullable<T> is now one as well.
 
4:40 PM
@sbi What?
 
sbi
@R.MartinhoFernandes Are you a table tennis robot?
 
Oh.
lol, not anything close.
 
@рытфолд it's a limitation inherent to the CLR
 
user1804599
@sehe Nullable could simply not have been there, and NonRetardedNullable could have been and called Nullable.
 
user1804599
If this shit is there because the CLR needs it, the CLR is shit.
 
4:42 PM
hahaha. Good luck with that. Implement it, please
 
user1804599
I just did, scroll up a bit.
 
@sbi This video is so awesome
 
@рытфолд IsUnit in Scala better? Can you have a list of units or something? :)
 
user1804599
You should be able to s/class/struct/ if you are in desperate need for that.
 
sbi
@Borgleader Innit? :)
 
user1804599
4:43 PM
@FredOverflow Yes. It's a normal type with normal behaviour which can be used as a type for variables and parameters.
 
@sbi got pretty viral already, eh
 
sbi
@BartekBanachewicz Did it? I hadn't looked.
 
@рытфолд Nullable<T>?
 
user1804599
template<typename T, typename F>
T f(F f) {
    auto result = f();
    g();
    return result;
}
 
How is that a special case?
 
user1804599
4:44 PM
Note how this breaks in C++ if f() returns void.
 
user1804599
You need a special case to make it works, because void is a special case.
 
user1804599
Unit wouldn't have had this problem.
 
I don't see how that would break with Nullable<T>
 
user1804599
@Jefffrey "The type `int?' must be a non-nullable value type in order to use it as type parameter `T' in the generic type", for one.
 
user1804599
Nullable<Nullable<T>>, for one.
 
user1804599
4:46 PM
Nullable<string> doesn't work for arbitrary reasons.
 
I have no idea what language you are using there, but by Nullable<T> I imagine an interface like Maybe so that: Nullable<T>() does not contain a value and Nullable<T>(t) does.
 
user1804599
C#.
 
user1804599
Nullable is most special.
 
user1804599
It's a language feature more so than a library feature.
 
@Borgleader Yeah, quite the difference there. "Can't answer with that, as it will get closed. Better leave a pointless remark, that will in no way help OP or any future visitors. That will help the community!" — dmg 5 mins ago
TIL learning to use a debugger is pointless
 
user1804599
4:49 PM
It should never be used, for most of the same reasons null should never be used.
 
user1804599
Why do you use String and null instead of Option[String] and None? — рытфолд 53 secs ago
 
user1804599
Coincidence. :P
 
user1804599
I'm super hungry.
 
user1804599
I just ate sandwiches but I'm still in need of food.
 
5:01 PM
Does editing questions give rep? I always seem to see low rep users make the shittiest/useless edits
 
Only when you're below 2000 or so
 
user1804599
You get 2 rep for accepted edits.
 
@CatPlusPlus Ah, that explains this then
 
So the path to rep victory is paved with sockpuppet accepts on useless edits?
 
apparently
 
5:05 PM
snack overflow
 
5:19 PM
this should work. it does notBorgleader 5 mins ago
 
> This sounds terribly moronic, but I get thrown off by GMT. Would it be too hard to give eastern US time as well as GMT?
 
user784668
@R.MartinhoFernandes ahahahahaha
 
user784668
sauce?
 
sbi
@R.MartinhoFernandes Addition and subtraction is beyond some mere mortals.
 
@Fanael Private in-game chatter.
 
5:28 PM
YAY!! What an FA cup day! Citeh and Chelski are deader than Haskell for mainstream development.
 
I could link you to it, but you wouldn't be able to see it.
 
user784668
@MartinJames Jose Mourinho is a football genius
 
I am really carsick. I never get carsick.
 
@Fanael Yeah, as an insomnia cause. Every post-match interview I fall asleep.
@Nooble Don't try to eat a whole one at once. Just munch on the wheels to start with.
 
@MartinJames I think it was the diesel... They forgot to drain it out.
 
5:41 PM
@Nooble Ugh!
 
5:51 PM
@MartinJames And it's a bit too rare for me. The door's undercooked.
 
@Nooble Yeah, I get that too. No matter how many times I ask for well-done, the chef seems to only interested in getting the car out quickly - burnt in some places and rare in others.
 
Fact of the day: 2015 in binary is a palindrome and has only one zero
@Nooble Contradiction much?
 

« first day (1561 days earlier)      last day (3379 days later) »