|
Shaggar posted:my code is loaded w/ if(thing!=null && thing.<the real test goes here>) same
|
# ? Mar 12, 2014 21:03 |
|
|
# ? Jun 13, 2024 06:42 |
|
Bloody posted:why would you want that? i love abusing short-circuit AND/OR i don't mean using it when short-circuit && would be more appropriate but i can think of at least one instance in the last year when i would've used boolean & if i'd known about it
|
# ? Mar 12, 2014 21:19 |
|
tbh i cant think of any situations where I'd want it to not short circuit that don't involve horrible clever code state changing
|
# ? Mar 12, 2014 21:32 |
|
wrong thread
|
# ? Mar 12, 2014 21:34 |
|
Shaggar posted:tbh i cant think of any situations where I'd want it to not short circuit that don't involve horrible clever code state changing do thing on this server, do thing on that server, report ANDed result
|
# ? Mar 12, 2014 22:05 |
|
Shaggar posted:my code is loaded w/ if(thing!=null && thing.<the real test goes here>) defaulting to nullable types is one of the very few things i dislike about java
|
# ? Mar 13, 2014 01:48 |
|
Shaggar posted:my code is loaded w/ if(thing!=null && thing.<the real test goes here>) i like thing.try(:test) i want thing.andand.test (andand would return the object itself on a non-nil object, and on nil return an object that swallows method calls and returns nil)
|
# ? Mar 13, 2014 01:53 |
|
Kevin Mitnick P.E. posted:do thing on this server, do thing on that server, report ANDed result yeah, ok, but that's just ANDing two values together, not using it for a test. edit: unless you're being "clever" and doing something like code:
|
# ? Mar 13, 2014 02:41 |
|
Cocoa Crispies posted:i like thing.try(:test) c# is getting this as .? Notorious b.s.d. posted:defaulting to nullable types is one of the very few things i dislike about java i prefer to be charitable and think this is something gosling et al didn't have time to deal with for java 1.0 scala would be much more appealing to me if it was stronger wrt null elimination
|
# ? Mar 13, 2014 02:53 |
|
nullable types rule everything around me (and i hate them)
|
# ? Mar 13, 2014 03:31 |
|
Kevin Mitnick P.E. posted:i prefer to be charitable and think this is something gosling et al didn't have time to deal with for java 1.0 everyone makes mistakes. java was a really excellent attempt at not making any. Kevin Mitnick P.E. posted:scala would be much more appealing to me if it was stronger wrt null elimination scala's best feature, java interop, sometimes depends on replicating java's mistakes what scala does right is making option types, map/filter, pattern matching the obvious/easy ways to handle nulls. i almost never have an actual null check in my code because nulls just aren't relevant
|
# ? Mar 13, 2014 03:35 |
|
||=
|
# ? Mar 13, 2014 03:54 |
|
what does this stubby penis syntax DO?
|
# ? Mar 13, 2014 03:57 |
|
Morkai posted:what does this stubby penis syntax DO? welcome to operator overloading
|
# ? Mar 13, 2014 03:59 |
|
Morkai posted:what does this stubby penis syntax DO? what doesn't it???
|
# ? Mar 13, 2014 04:00 |
|
Notorious b.s.d. posted:welcome to operator overloading it sounds dangerous. i hope you know what you're doing with that thing.
|
# ? Mar 13, 2014 04:02 |
|
Notorious b.s.d. posted:everyone makes mistakes. java was a really excellent attempt at not making any. i want the java interop and i want the non-nullable types
|
# ? Mar 13, 2014 04:02 |
|
Kevin Mitnick P.E. posted:i want the java interop and i want the non-nullable types you can't have everything you greedy prick.
|
# ? Mar 13, 2014 04:13 |
|
Morkai posted:what does this stubby penis syntax DO? Notorious b.s.d. posted:welcome to operator overloading it's not overloading in ruby it's basically lvalue = rvalue unless lvalue or assign rvalue to lvalue unless lvalue already has a non-falsey value
|
# ? Mar 13, 2014 04:27 |
|
Morkai posted:you can't have everything you greedy prick. if the scala guy is so smart how about he proves it by doing what i want
|
# ? Mar 13, 2014 04:45 |
|
i just wanted to let oyu all know that git is poo poo mercurial seemed less confusing and just as capable.
|
# ? Mar 13, 2014 06:13 |
|
guys i think i have distilled computers into their one true form and it is the union of 420 and 219. for reelz
|
# ? Mar 13, 2014 08:59 |
|
you can do everything with those numbers. everything you want.
|
# ? Mar 13, 2014 10:15 |
|
420+219+21.9+(2.19*4.20)-4.20 = ~666 hail approximately satan
|
# ? Mar 15, 2014 00:22 |
i should just flat out refuse to work for a place that doesn't practice TDD. but try saying that 3 months into a job hunt i should just get away from the .net / java world. Coffee Jones fucked around with this message at 01:03 on Mar 15, 2014 |
|
# ? Mar 15, 2014 00:58 |
|
Coffee Jones posted:i should just flat out refuse to work for a place that doesn't practice TDD. be the change you want to see in the world moving a reluctant team towards tdd is that intangible they call "leadership"
|
# ? Mar 15, 2014 04:36 |
|
not to mention 90% of the idiots who brag about tdd/bdd/ddd are startup shidiots doing none of the above, they just want young bucks who love buzzwords
|
# ? Mar 15, 2014 04:37 |
|
Notorious b.s.d. posted:defaulting to nullable types is one of the very few things i dislike about java We have a thing in our build system at work that actually does nullness checking and sometimes it's a pita because it's not that smart but jfc is it better than dealing with nulls everywhere. now if only the teams we integrate with would actually mark their poo poo @Nullable Cocoa Crispies posted:it's not overloading in ruby l += r ≡ l = l + r l ||= r ≡ l = l || r makes sense to me
|
# ? Mar 15, 2014 04:52 |
|
Notorious b.s.d. posted:not to mention 90% of the idiots who brag about tdd/bdd/ddd are startup shidiots doing none of the above, they just want young bucks who love buzzwords it's certainly possible my opinion of TDD could be changed if I saw it in practice but it really seems like it could only work in a project that is either trivial, waterfall-style overspecced, or luxuriously overfunded. heck even the concept of high levels of strict Unit™ testing doesn't seem to pay any dividends as opposed to the more general notions of automatable "unit" tests, most of which will be integration tests, and continuous integration
|
# ? Mar 15, 2014 05:50 |
|
I divide testing into acceptance tests, and everything else. Acceptance teats express intent: I was trying to write a program that would fulfill these criteria. Everything else either smoke tests my code or attempts to exercise the code to recreate a bug that has since been fixed, so that I don't fix the same bug twice. People have write long books about these topics but this is my two cents. I don't understand the need for vast catalogs of jargon on this one
|
# ? Mar 15, 2014 06:23 |
|
Police Academy III posted:
l ||= r isn't exactly equivalent to l || l = r nor to l = l || r. http://www.rubyinside.com/what-rubys-double-pipe-or-equals-really-does-5488.html
|
# ? Mar 15, 2014 06:25 |
|
Notorious b.s.d. posted:I divide testing into acceptance tests, and everything else. i've only been programming 'seriously' for two years now, but testing is by far the most confusing issue i've dealt with. it's so easy to overtest, and it's also easy to undertest. unit testing involves writing mocks for all external interfaces and objects and so you'll sit there writing tests and then realize 'wait this is really not testing anything' because you've mocked something to the point that all you're testing is whether or not calling one method will eventually call another method. it's extremely frustrating and when i try to add full testing coverage to projects it quadruples the time involved. on the other hand, when i just add some integration tests to make sure things do roughly what they're supposed to, it helps out a lot. anyhow my point is that i'm bad at testing and trying to get good at testing has been harder and more ongoing than any other programming thing i've tried to learn.
|
# ? Mar 15, 2014 06:32 |
|
USSMICHELLEBACHMAN I agree with your post, it takes experience and serious peer review to learn what methods make sense to test.
|
# ? Mar 15, 2014 06:38 |
|
what's a unit test other than if (functionCall(input) != expectedOutput){ system.kill(); return false; die; exit(1); } I don't think i've ever worked in a TDD environment
|
# ? Mar 15, 2014 07:05 |
|
MeruFM posted:what's a unit test other than if that function call calls external systems that you don't necessarily control you're supposed to mock those systems otherwise it's an integration test. i mean, testing a single thing is simple. the hard part is deciding what interfaces need to be tested, what inputs need to be tested, and what you should expect from those inputs. then it's refactoring all those tests so that they're elegant and concise or else ur code smells and stack overflow is going to laugh at you.
|
# ? Mar 15, 2014 07:13 |
|
|
# ? Mar 15, 2014 08:17 |
|
Notorious b.s.d. posted:I divide testing into acceptance tests, and everything else. yeah I think we basically agree good point on writing a Unit™ test when you fix a bug, that is definitely valuable and I do that USSMICHELLEBACHMAN posted:
this is a great point too! I particularly like that literally nobody ever says the first half but it's so true in every project I've worked on that strived objectivelessly for some particular metric of >XX% lines covered by unit test
|
# ? Mar 15, 2014 08:49 |
|
writing a test every time i fix a bug is one of the few things that makes sense to me otherwise i've kind of approached it like 'ok i'm testing something manually, i might as well test it automatically' and then every time i think of something new to test manually, i write an automatic test for it. which is how i approached testing when i started but then i started reading about testing and it got much more complicated
|
# ? Mar 15, 2014 08:52 |
|
today i wanted a function that would not terminate and return to the main state machine for thirty seconds until its asynchronous task was completed, so i for (int i = 0; i < 30; i++) { //start important task //and update it with new data periodically until it finishes delay(1000); } yaaaaaaaaaaaaay
|
# ? Mar 15, 2014 09:06 |
|
|
# ? Jun 13, 2024 06:42 |
|
Notorious b.s.d. posted:I divide testing into acceptance tests, and everything else. I want to work in a company where management writes acceptance tests and I code to them for a ridiculous amount of money.
|
# ? Mar 15, 2014 11:55 |