« first day (3185 days earlier)      last day (1825 days later) » 

1:31 AM
Hey there! How is everyone tonight?
 
I'm single malt-tastic.
And yourself?
 
Im good
 
1:54 AM
Okay thats a lie.
I'm writing tests
 
Unit tests?
 
yes
 
2:10 AM
Do you use a premade system like JUnit, etc or something home cooked?
 
Im using GTest
TBH this is my first time writing unit tests and I am still learning both the process and the framework. codereview.stackexchange.com/questions/217810/…
 
That's solid feedback. I maybe disagree a bit with the strength of the first point. It's true that a unit test should have a very limited scope. But as was sort of alluded to later, testing everything is hard. In some cases, it may not even be possible, especially at the atomic level. So I often broad my tests up past the textbook definition of unit.
The review did hit on my heuristic for how big a test should be - it should give you a pretty specific idea about what failed and in what fashion it did so.
 
2:27 AM
> I think that testing trivial logic like a setter that simply forwards to a backing field together with a getter that reads that field is not worth the effort to write the tests.
I particularly liked that line
 
If all your setter does is put store the value straight up in a field, that's probably true.
Such functionality is usually covered by more interesting tests.
 
I'm almost done with the rewrite so I can post again :]
 
Nice.
 
Maybe at the end of all this I will eventually know what I am doing
 
I like the bit about avoiding the happy path. When I taught data structures, that one was an easy way to catch code off guard.
 
2:32 AM
Yeah, That's part of what I'm struggling with. Im not sure how to write a test for that.
What happens if you pass the wrong type to an explicit contructor at run-time?
std::bad_alloc?
 
When I write tests like that for myself, I use it to test assumptions about the data that I might later forget.
Not sure, my C++ is way out of date.
Let me look at the code again....
 
(I can always just run it and see)
 
Are you asking about a situation like passing the constructor an array of fonts, or a float or a ham sandwich instead of a single font or something like that?
 
yes
 
My take is: it depends, but not on much. If the mistake is something that is wouldn't compile - not your problem.
If the mistake is something that will compile, but always fail at run time due to the language rules - probably not your problem. the minor exception might be - you expect the mistake to happen like a lot & to be difficult to tell from other mistakes. Then a custom error might be warranted as a courtesy.
If the mistake passes the first two situations, then you need to think about it more.
In my experience, parameter type isn't going to create the situations for deep thought.
 
2:45 AM
(Apparently it performs a narrowing conversion, even though I thought explicit prevented that.) <-- at least with float. I didn't try with non-numbers. No I don't expect the error to happen. I compile with -w4 -wX so it fails to compile if I accidentally use it wrong
That said I have considered streaming data from file instead of hard-coding, so maybe it could get problematic then.
@Pikalek That's fair. Thanks for the input.
 
Let's say for whatever reason, your code only works with fonts that are mono-spaced. Then checking that assumption in the constructor would be a good idea. It catches the problem before it can move any further, and it's a problem that might not be obvious.
For instance, I have some computational geometry code that does stuff with 2 convex polygons. But the guts of the math fails in hard to predictable ways if one is clockwise & the other is counter clockwise.
So that's something I check as soon as I initialize. It's a subtle feature that isn't type dependent & future me might forget. Worse yet, some cases don't crash fail they just give back junk answers. So I check at init to make sure both polys are in agreement.
 
Yeah I still am not good at noticing what my assumptions are.
I think that is something I will need to get better at
 
Also, there's a million ways I might generate a division by zero. But there are very few places that a DisagreeingGeomtryException might come about.
It's tough. I basically means knowing your code's blind spots. But they are blind spots because you don't notice them. Catch 22.
I took a great class just on testing & debugging. We had partner assignments for code that wasn't super complicated. You would write your code, test it yourself & once you thought it was good, give it to your partner for testing.
when you got you partner's code, your goal was to break it. The instructor had automated tests. You didn't want to green light the code only to have the instructor catch something you missed.
From both sides it was a humbling & enlightening experience.
I gave myself a pass on the first return from my partner. Small, silly mistake, I though. No problem, now I got this. Oh. Another one huh? Okay okay. Fixed. Didn't even take a minute. Bullet proof now though. Even caught one I saw in your code & you didn't log in mine. Take that. Ah. Yes. No, I see it, thanks. I'll need to get back to you on that...
A good rule of thumb is "what's something that the code/documentation didn't specifically address, but is probably not wanted." Also, any edge case values.
It takes practice. The good news is your already ahead of those who avoid critical feedback about their code & want to improve.
 
3:05 AM
@Pikalek I think this is what I need to practice trying to see.
As you said its hard to see your own blind spots. Did you find it was easier to find in other people's code?
And thanks for all your input. I'm always up for critical feedback. If I ever want to get seriously good at this I will need every bit of it.
 
I used to. I don't spend much time in other people's code these days, so I can't say if it's still true or not. Having had a job that included testing code against known expectations helped a ton.
You're welcome to the feedback. Usually disclaimer - I'm just some cog on the internet. I sort of know what worked for me & can usually remember stuff from many years in school, but I'm also capable of mistakes & sometimes best practices evolve beyond what I'm aware of. I try to make it worth people's time though.
I'm dropping out for tonight. Good luck with your tests. It gets better :)
 
@Pikalek g'night. Thanks
 
 
4 hours later…
nwp
7:39 AM
@bruglesco You should replace that with a public member variable.
@bruglesco Consider using catch2 instead.
 
nwp
8:10 AM
@bruglesco Types are checked at compile time, so it would simply not compile.
 
 
3 hours later…
11:26 AM
@nwp unless you are creating instances dynamically at runtime. With input from a user or data file. (Yes the same thing to do would be to check and sanitize your input.)
@nwp really? I didn't expect that. Doesn't that defeat encapsulation?
@nwp I'll check it out.
 
nwp
@bruglesco What encapsulation? Primitive getters and setters don't have any.
@bruglesco Well, the types are still all known at compile time. You can do things like std::variant<int, std::string> that sorta model a dynamic type, but checks done by explicit constructors are still done at compile time and you have to do dynamic checks manually.
 
With the release of Avengers: Endgame, I'd like to remind everyone you can disable the Hot Network Questions list in your user preferences. It's the fourth checkbox on that page, the one in the “Sidebar” section. This will hopefully minimise your chance of spoilers coming in the form of HNQ titles.
 
nwp
"Since Thanatos was defeated by the Hulk in the final fight, was Earth ever in danger?"
(I'm pretty sure those are Avenger characters)
 
yep that sounds legit to me
 
nwp
11:42 AM
Strange that disabling hot network questions makes Recent Tags and Recent Badges appear in its place.
Who thought this is a good idea? Or is it intended as punishment?
 
@nwp I think it's a Chaos Monkey thing: whenever HNQ is unavailable they display something else in its place. Happens to be that. Since HNQ is reliably available nowadays I imagine nobody realised it looks kinda bad. :)
 
 
2 hours later…
1:57 PM
Woa I didn't know SE used a Chaos Monkey. I only knew about NFLX using it.
I still want specific blacklist of HNQ
I love HNQ, except for TV and Movies. I hate those guys.
it's not that fucking hard to use spoiler-free titles.
 
I dunno - how hard is it to have question titles with actual questions? I'd argue the bar for figuring out 'if sentence X is a question or not' is much lower than figuring out 'if alluded fact Y about movie Z is a spoiler'.
 
nwp
@Almo Your self-censorship offends me.
 
@Almo Then you might want to get 1k rep on the site and go edit the titles; or post something about it on their meta?
 
@Almo I don't know if SE has the Chaos Monkey testing software. At the time their Chaos Monkey was very much more real: some service unavailability just kept happening, they couldn't solve it for ages, so they just started developing to make sure everything would be fine even when it happened.
@AlexandreVaillancourt well, then you have to be willing to wade into the spoilers
 
@AlexandreVaillancourt Maybe is some countries. But here in 'Merica the answer is to build self healing echo chambers so we can filter 'reality' to show only the truths we hold dear. cough facebook cough
 
2:04 PM
@doppelgreener That's a point.
 
For what it's worth SFF and M&TV do work to remove spoilers from their titles, but some are going to hit HNQ before that happens.
 
@Pikalek Yeah, I know, it's easier that way :/
 
@Pikalek I think that's a different thing from “I don't want to read movie spoilers” :P
 
@doppelgreener My point is that norms of most any kind can be difficult to maintain.
But I do concede they are different.
 
@AlexandreVaillancourt By then it's too late.
 
2:12 PM
@Almo Yeah
 
I don't want to learn things about shows I have not seen in order to edit spoiler titles.
If I see one that looks like a Harry Potter spoiler, I will edit it since I don't really care about those.
The movie Split had a spoiler in it. :/
fortunately it's for a movie I've seen.
The Deadpool 2 posters had a spoiler on it. That was rude
 
nwp
They added spoiler tags on discord which is pretty nice.
If stackoverflow behaved like a small company instead of a giant corporation they could allow spoiler removal for movies.se hot network questions be reflected immediately or add a filter.
 
nwp
2:38 PM
@nwp Thanos, not Thanatos.
 
@nwp I guess if there is a meta post about it, and enough traction, they could add that as a feature.
 
nwp
I have not followed stackoverflow for years now. What has changed besides the question wizard?
Oh, and I guess the teams side bar at one point
 
I think they have added a "remove this question from HNQ" for mods or something like that, don't remember the blog/meta post about it..
 
2:53 PM
@nwp I think [that's the joke.gif]
 
nwp
Hilariously incompetent.
I need to find some game to play. If only I wasn't too cheap to spend money.
What is the frequency of steam sales? Depends on the producer and impossible to predict or like every couple of months for most titles?
 
@nwp Whatever frequency your wallet would be comfortable with, then a bit more frequent than that.
 
nwp
I thought they were global and not dependent on my wallet.
 
It's very precisely calculated to depend on multiple peoples' wallets. Yours got factored into the calculations, you're mentioned right here in the white paper.
 
@AlexandreVaillancourt There is a meta about it.
the consensus is "too much work to filter certain sites. just turn off HNQ"
which to me is stupid
 
4:00 PM
Oh, okay :/
 
 
1 hour later…
5:24 PM
:(
My meta answer explaining this has 20 upvotes, I think
I'll be on the live stream soon
 
Nervous?
I'm tuned in, but I won't have any questions as I don't play the game.
 
a bit nervous
not too bad, it's a subject I know well
 
Yeah, it's said that nervousness can help better perform :)
 
Kay
Did that Dead By Daylight stream alraedy happen ? I only remember it being on a thursday
 
not yet
it's in about 30 min
 
Kay
5:35 PM
Alright, im gonna tune in! Generally I don't really understand Dead by Daylight but I am still interested in what decisions where made in the design. Which actively avoided made or in hindsight were a mistake
 
:)
 
6:29 PM
I did not expect that many live viewers!
 
6:55 PM
popular game ;)
 
Yeah, looks like it! It must be a great and fun challenge to work on such a game!
 
7:10 PM
it is
plus it's hardcore multiplayer competitive, my favorite
 
7:27 PM
Must be hard for you to go to work every day, haha :P
 
7:46 PM
hehe :)
Just watched the segment with my stuff, and damn like 10% of the chat on the sidebar was about my coral-painted nails. :D
 
 
3 hours later…
10:27 PM
:p this thing goes so fast, I wonder how those mods do to monitor everything..!
 
Hello
 

« first day (3185 days earlier)      last day (1825 days later) »