01:00:02  <emilbayes>yoshuawuyts: I've noticed that you sprinkle assertions into your code quite liberally, and I've started doing the same but I really don't know how to feel about it. To me it feels like mixing tests and proper source code, but on the other hand I like the signal effect that it has, and the added sense of security
01:00:50  <emilbayes>yoshuawuyts: What do you reckon?
02:04:22  <jfhbrook>emilbayes, I think asserting things about your arguments is a good idea
02:04:45  <jfhbrook>but using them in place of tests sounds awkward
02:05:02  <jfhbrook>maybe make assertions on the output of something complex though? like I'd want assertions in a numerical method
02:07:09  <emilbayes>jfhbrook: Yes, so far I've been asserting input of functions and output of "internal" functions. So far I'm just thinking that everything user facing should probably return errors, while everything else is fine with assertions. Is that how it's done usually?
02:08:13  <jfhbrook>I mean, asserts are just a mechanism for creating and throwing errors
02:08:24  <jfhbrook>the question is whether you want to show your users a stack trace or not
02:10:40  <emilbayes>jfhbrook: Oh yeah, I don't think I've thought this through
02:19:09  <jfhbrook>heh
02:19:17  <jfhbrook>I mean, I haven't either, having never red yoshua's code
02:41:01  * contrahaxjoined
03:04:52  * phatedquit (Remote host closed the connection)
04:30:30  * phatedjoined
04:36:00  * phatedquit (Ping timeout: 276 seconds)
04:58:58  * contrahaxquit (Quit: Sleeping)
06:18:46  * phatedjoined
06:23:09  * phatedquit (Ping timeout: 250 seconds)
07:05:28  * phatedjoined
07:09:31  * phatedquit (Ping timeout: 240 seconds)
08:16:56  * fotoveritequit (Quit: fotoverite)
08:29:06  * creationix_joined
10:27:43  * thealphanerdquit (Quit: farewell for now)
10:28:14  * thealphanerdjoined
10:52:26  <yoshuawuyts>emilbayes: to me using assert is about failing fast and early
10:52:55  <yoshuawuyts>emilbayes: if at any point something breaks I want to know about it, rather than having it accidentally slip into a next tick or something and becoming increasingly hard to debug
10:53:20  <yoshuawuyts>emilbayes: in Node using "if" statements is quite cheap; function calls too - so not too fussed about the perf overhead
10:54:32  <yoshuawuyts>emilbayes: in the browser there's always the option to use "-g unassertify" when bundling for production and save a few bytes
10:54:51  <yoshuawuyts>emilbayes: does that make sense?
10:55:06  <emilbayes>yoshuawuyts:
10:55:25  <emilbayes>yoshuawuyts: Yes! And the rationale about failing fast is what appealed to me
10:55:44  <emilbayes>yoshuawuyts: I knew about unassertify, which is actually what made me consider assertions
10:56:30  <emilbayes>yoshuawuyts: But I just find I end up using it for type checking, and if that's all it does for me, maybe I should look at some of the other solutions in that space
10:57:29  <yoshuawuyts>emilbayes: you might be interested in https://github.com/gcanti/tcomb
10:58:18  <yoshuawuyts>the type assertions there are quite interesting I find
10:58:27  <yoshuawuyts>though scope is a bit too wide for my taste
10:59:28  <emilbayes>yoshuawuyts: My thoughts as well just browsing quickly
10:59:46  <emilbayes>yoshuawuyts: Seems like a ecosystem / kitchen sink
11:01:35  <emilbayes>yoshuawuyts: but 3kb seems cheap in that respect
11:02:50  <yoshuawuyts>emilbayes: I never came around to it, but I suspect implementing the type mechanism + a transform to strip it out for production shouldn't be too big of a challenge
11:06:03  <emilbayes>yoshuawuyts: Yeah, deassertify seems to use a really simple mechanism for that
11:08:13  <emilbayes>s/deassertify/unassertify/
11:24:29  <yoshuawuyts>C:
14:30:56  * pfallenopquit (Max SendQ exceeded)
14:31:11  * darvonquit (Max SendQ exceeded)
14:31:39  * mappumquit (Max SendQ exceeded)
14:31:44  * kanzurequit (Max SendQ exceeded)
14:31:46  * darvonjoined
14:31:47  * pfallenopjoined
14:32:18  * pfallenopquit (Max SendQ exceeded)
14:32:23  * darvonquit (Max SendQ exceeded)
14:32:54  * kanzurejoined
14:34:37  * mappumjoined
14:36:44  * darvonjoined
14:36:47  * pfallenopjoined
14:43:28  * fotoveritejoined
14:51:01  * ekristenquit (Quit: ekristen)
15:09:32  * ekristenjoined
15:43:08  * contrahaxjoined
16:32:26  * toddselfjoined
16:45:50  * nicolagrecoquit (Ping timeout: 250 seconds)
16:46:57  * nicolagrecojoined
17:31:18  * shamajoined
17:43:54  * contraha_joined
17:47:34  * contrahaxquit (Ping timeout: 240 seconds)
18:01:02  * contraha_quit (Quit: Sleeping)
18:53:36  * contrahaxjoined
19:58:32  * ralphtheninjaquit (Quit: leaving)
20:36:14  * phatedjoined
21:43:53  * contrahaxquit (Quit: Sleeping)
23:36:08  * phatedquit (Remote host closed the connection)