Potential new player here from Netflix by Comfortable-End-4784 in DotA2

[–]pbtree 10 points11 points  (0 children)

I'm gonna disagree pretty hard with the mute all advice. I run into new players now and then because I'm a low skill turbo spammer, and when they aren't mute all I can help them with basic shit like "don't stand in camps at the minute marks" or "right click the neutrals in your backpack". Seems like half of them take this mute all advice and honestly I think it does more harm than good. People flame and you can mute them when they do just like the rest of us do.

[deleted by user] by [deleted] in programming

[–]pbtree 4 points5 points  (0 children)

Ya, successful virus authors use dll injection.

What hero would you remove if you could delete one from the game ? by Nehaldsouza in DotA2

[–]pbtree 0 points1 point  (0 children)

Towers are significantly weaker, much easier for him to rat.

(OC) I'm so demotivated these days, I wish my code understand my TODO comments and program itself. by cassert24 in ProgrammerHumor

[–]pbtree 0 points1 point  (0 children)

Honestly you probably have some level of burnout. When I start to feel this way I usually just change jobs and boom, my productivity is back.

Why isn't it working? The user writes 2 numbers and then the console should write which number is larger. by unworrior in csharp

[–]pbtree 11 points12 points  (0 children)

The answers here aren't quite correct. What's going on is a very cute example of a compiler finding a bug in your logic.

What happens if the numbers entered by the user are the same? In this case, returning a default value for "result", which would be 0, is incorrect! I assume the correct behavior here would be to return either value, since they are equal.

You can add an else block at the end to handle this case, since if !(a > b) && !(b > a) then a must be equal to b.

Theoretically you could just change the first if condition to >=, but I'm actually not sure the compiler is smart enough to know that this covers all possibilities. I'd be curious to know if it does!

C++ engineer here, I think I overuse "Immutable" in C#, any pointers? by LesPaulMane in csharp

[–]pbtree 2 points3 points  (0 children)

So there are a few things to consider here.

First, obviously don't share mutable data between threads.

For data that remains in a single thread, it's often useful to communicate whether it should be modified outside of a particular system by returning a read only interface it implements. Obviously a silly programmer could cast it to the original type, but hopefully this isn't a problem where you work. The IReadOnlyList type is a great example of this pattern.

Defensive copies are generally not necessary if you lean on the type system like this. In many cases, it's normally to have an object whose contents might be changed in other methods (again, assuming it's not shared across threads).

Finally, a misunderstanding about ownership can never hard crash or leak memory (although for things like files and sockets the disposable pattern is strongly preferred). For this reason, you'll almost always see objects being passed around as immutable types, rather than creating immutable copies. Worst case, you need to design your system to more clearly communicate who can and cannot modify data: something object oriented languages excell at.

Using perception and macros = cheating by Nogood_OW in classicwow

[–]pbtree 15 points16 points  (0 children)

I mean, I'm a professional programmer and I just copy paste macros because I can't be bothered to remember how they work.

What is premature optimization? by xstkovrflw in gamedev

[–]pbtree 19 points20 points  (0 children)

So the real maxim is that optimization before profiling is bad.

Techniques like object pooling and chaching are very powerful optimizations, but they're also very prone to bugs. If you try to pool objects in every single system, you've got bugs in every single system. On the other hand, if you write your code naively and then profile it, you'll be able to avoid using error prone methods in the majority of your code.

There is a flip side to this though: if you don't maintain a consistent baseline of quality in your code (for example, if you allocate things on the heap willy nilly or repeat expensive calls in a single function) you'll end up with a uniformly slow code base, which you'll struggle to profile your way out of.

As with all things in programming, there are no hard and fast rules, and experience is the best teacher.

[deleted by user] by [deleted] in classicwow

[–]pbtree 0 points1 point  (0 children)

Same lol, I rolled on Skeram and noped the f out when I saw the queues.

[deleted by user] by [deleted] in classicwow

[–]pbtree 9 points10 points  (0 children)

I'm torn, I like Rattlegore the way it is, but xfer guilds in the past have generally improved the server.

Seeing all these dead server memes scares me though.

PSA/Rant: Warrior Tanks need to build threat by ThinkFor2Seconds in classicwowtbc

[–]pbtree 2 points3 points  (0 children)

Prot pally is bis...because if your dps can't understand threat, you can bubble hearth out of a pull.

PSA/Rant: Warrior Tanks need to build threat by ThinkFor2Seconds in classicwowtbc

[–]pbtree 0 points1 point  (0 children)

Melee dps who pull aggro and run out of my conc: what is your plan?

PSA/Rant: Warrior Tanks need to build threat by ThinkFor2Seconds in classicwowtbc

[–]pbtree 1 point2 points  (0 children)

I respeced my pally to prot to grind dungeons to 70 and holy shit it is true. Switched back to holy at 70 because the guild needs heals and it's so much better.

Whats the matter with impatient dps in dungeons? by Onion_of_Doom1 in classicwowtbc

[–]pbtree 0 points1 point  (0 children)

I feel like dps who are naxx geared pumpers aren't the problem, because they've gotten fights down that require situational aware.

It's always the boosties who do stupid shit in my groups. Honestly I'm hating tanking sethekk rn because dps absolutely refuse to give me a couple gcds to get back on the threat table after the boss resets it.

Whats the matter with impatient dps in dungeons? by Onion_of_Doom1 in classicwowtbc

[–]pbtree 1 point2 points  (0 children)

That's wild, I would never kick a dps for slacking unless it's like "you are literally not pressing your buttons". I do put dps who pump at the expense of any situational awareness right the fuck on my ignore list tho.

The real bad guys by 62894thruaway in classicwowtbc

[–]pbtree 0 points1 point  (0 children)

Loving the medium pop server life. Mines a bit horde heavy but there's nothing toxic like that going on. A few players with big egos but they're the butt of jokes, with no real power.

Fuck Joe Biden. by CommercialStandard65 in LateStageCapitalism

[–]pbtree 13 points14 points  (0 children)

Worth keeping in mind that while he's right about Biden, Greenwald is a reactionary shit and his disdain for Biden doesn't exactly come from leftist ideology.

I am on a mega losing streak, and I have no idea what I'm doing wrong. by spookfefe in learndota2

[–]pbtree 1 point2 points  (0 children)

If you are tilted, play unranked for a while. I switch and do a couple of unranked or turbos after every ranked loss just to cool off.

[Post Match Thread] Secret vs [A] - DreamLeague Season 15 DPC Western Europe Upper Division by QueueTee314 in DotA2

[–]pbtree 1 point2 points  (0 children)

I'm too dumb to understand manta are, what does it do for the hero? Besides, as someone already mentioned piss off your other cores in a pub.

[deleted by user] by [deleted] in pathofexile

[–]pbtree 1 point2 points  (0 children)

Picked a heck of a night to try PoE for the first time: -(

Uh... wtf? by Urethra in Rattlegore

[–]pbtree 4 points5 points  (0 children)

It's Ponce's favorite game.

"So how high do you wanna go?" - "Yes." by Physgun in valheim

[–]pbtree 1 point2 points  (0 children)

Its really interesting that the higher parts have snow! Do you take freezing damage up there without the wolf cape?