|
Valeyard posted:Now that you say this, in the python project imbworking on just now, Indont think I've seen many uses of if-then-else, it's all just really crazy inheritance and extreme OOIsm (that makes it hard to understand the flow of what's happening to virgin eyes) the more i lean about oo dogma the more i realize that i never really liked oo design. objects are cool and useful, but everything having to be an object in java was really annoying.
|
# ? May 23, 2016 19:06 |
|
|
# ? May 25, 2024 17:51 |
|
HoboMan posted:the more i lean about oo dogma the more i realize that i never really liked oo design. I love OOP, but the way most books/classes teach OOP is really bad. Typified by the thread title.
|
# ? May 23, 2016 19:16 |
|
Inheritance is pretty bad, and you should avoid it.
|
# ? May 23, 2016 19:17 |
|
JawnV6 posted:if-else chains are a sequence of conditional checks and jumps. they're executed in order and a lengthy has worse runtime than a switch. LOC is irrelevant many, many things are legal in verilog, and i would not count that as a selling point
|
# ? May 23, 2016 19:26 |
|
Finster Dexter posted:Inheritance is pretty bad, and you should avoid it. interfaces, on the other hand, are good
|
# ? May 23, 2016 19:26 |
|
my unit test passes 93% of the time. what the gently caress
|
# ? May 23, 2016 19:36 |
|
Bloody posted:my unit test passes 93% of the time. what the gently caress what's it doing?
|
# ? May 23, 2016 19:46 |
|
interacting with a piece of hardware to update the state of some hardware connected to that hardware then reading back the state of that hardware to see if it matches what was set there are A Lot of possible failure points in this path and a lot of room for heisenbugs
|
# ? May 23, 2016 19:48 |
|
lol you can use the Watcom debugger on a dos program running in Dosbox through a serial port emulator
|
# ? May 23, 2016 19:57 |
|
Bloody posted:interacting with a piece of hardware to update the state of some hardware connected to that hardware then reading back the state of that hardware to see if it matches what was set i was under the impression that a test that actually talks to hardware is not a unit test
|
# ? May 23, 2016 20:01 |
|
call it w/e you want its an automated test
|
# ? May 23, 2016 20:03 |
|
i'm not advocating writing a 40-line chain of if-then-else-else-else or whatever, but this guy is pathological to the point that he will not write the word "if", even when the thing he's doing is literallycode:
code:
|
# ? May 23, 2016 20:14 |
|
LeftistMuslimObama posted:i'm not advocating writing a 40-line chain of if-then-else-else-else or whatever, but this guy is pathological to the point that he will not write the word "if", even when the thing he's doing is literally case Foo of "foo" -> foo; _ -> bar end. seems legit
|
# ? May 23, 2016 20:17 |
|
raminasi posted:i was under the impression that a test that actually talks to hardware is not a unit test i interned at a company that made pci cards & poo poo for embedded PCs. my job was to run the tests on each software release, which involved manually hooking up loopback cables to the card's IO pins and running the sample programs to make sure the driver worked properly. given the choice of paying an actual programmer to write some kind of virtual hardware layer that could automate that part, or just having the intern do it, they went with the latter
|
# ? May 23, 2016 20:34 |
lo and behold bad computre toucher thread, i dont know what unit tests specificaly are. shame me, but also link something to read, python if its oddly specific
|
|
# ? May 23, 2016 20:34 |
|
kalstrams posted:lo and behold bad computre toucher thread, i dont know what unit tests specificaly are. shame me, but also link something to read, python if its oddly specific bam http://pythontesting.net/books/python-testing-ebook/
|
# ? May 23, 2016 20:36 |
gamecube scores critical hit on chome! chome is leaking pdf file e: oh they actually want money, time to investigate cinci zoo sniper fucked around with this message at 20:40 on May 23, 2016 |
|
# ? May 23, 2016 20:37 |
|
LeftistMuslimObama posted:he will still do that as a while loop, or a crazy one-case switch statement with a default case as the else, etc. in code that will very clearly never be revised in a way that would require extensibility of the conditional. it's crazy. i got single case switches up the rear end over here, most of them don't even have defaults either. the switch is strange but fine i guess. those while loops on the other hand are completely insane. coding dogma in action.
|
# ? May 23, 2016 20:38 |
|
good news i have successfully built tests that verify that my comms backpressure definitely works
|
# ? May 23, 2016 20:39 |
|
Bloody posted:good news i have successfully built tests that verify that my comms backpressure definitely works i too fart at the office
|
# ? May 23, 2016 20:45 |
kalstrams posted:gamecube scores critical hit on chome! chome is leaking pdf file
|
|
# ? May 23, 2016 20:45 |
|
would this work in C/C++ and related languages? I occasionally do this in .net instead of an if/elseif, when it allows for a clearer visual alignment:code:
|
# ? May 23, 2016 20:52 |
|
NihilCredo posted:would this work in C/C++ and related languages? I occasionally do this in .net instead of an if/elseif, when it allows for a clearer visual alignment: stop that
|
# ? May 23, 2016 21:13 |
|
oh, ok. treating a null as a string in javascript yields "null". i was dumb to expect otherwise
|
# ? May 23, 2016 21:17 |
|
HoboMan posted:oh, ok. treating a null as a string in javascript yields "null". i was dumb to expect otherwise Actually, yes.
|
# ? May 23, 2016 21:27 |
|
HoboMan posted:oh, ok. treating a null as a string in javascript yields "null". i was dumb to expect otherwise this happens in Java too
|
# ? May 23, 2016 21:28 |
|
its actually kind of useful sometimes
|
# ? May 23, 2016 21:37 |
|
Bloody posted:many, many things are legal in verilog, and i would not count that as a selling point Bloody posted:good news i have successfully built tests that verify that my comms backpressure definitely works LeftistMuslimObama posted:i'm not advocating writing a 40-line chain of if-then-else-else-else or whatever, but this guy is pathological to the point that he will not write the word "if", even when the thing he's doing is literally uh... "return after while"? honestly there's some really bad parts of the C spec if something looks like an infinite loop
|
# ? May 23, 2016 21:46 |
|
i did proper test-first tdd on the last project i worked on and it was slower to write but quicker to refactor, and the suite of tests ended up being better than what i usually come up with, thanks uncle bob thuncle bob
|
# ? May 23, 2016 21:48 |
|
JawnV6 posted:there are a lot more instances of "if this thing is hot, nothing else matters" and it makes those easier to write. like expanding a hamming code can be done in a single casex I built up a gigantic packet (>1 megabyte - big enough to overflow every fifo outside of the PC) of operations that would cause delays and attempted to transmit the entire packet at once. the FPGA is counting the number of packets it's processing and the software is counting the number it's sending (and also timing the whole thing). the rx and tx numbers match and the whole transmission took multiple minutes, while a same-size transmission of no-op data took a second
|
# ? May 23, 2016 21:51 |
|
i meant backpressure implementation, not test case there's a really good feeling running a test and seeing it go green the first time tho
|
# ? May 23, 2016 21:59 |
|
oh lol the block talking to the USB hardware monitors the fifo's almost full flag and stops pulling data out of the usb hardware when it trips. the usb hardware + driver apparently handle this correctly (which matches the documentation but now is actually tested) so all is well.
|
# ? May 23, 2016 22:13 |
|
JawnV6 posted:there's a really good feeling running a test and seeing it go green the first time tho i actually get worried when that happens, because maybe i wrote the test wrong
|
# ? May 23, 2016 22:14 |
|
raminasi posted:i actually get worried when that happens, because maybe i wrote the test wrong i commited a test a couple weeks back, got a review comment a couple days later like "this test doesnt have any assertions lol" looks like I had been looking at the coverage for themethod, saw that it passed and ocver the method, went away and did something else, then forgot and just committed it, fail
|
# ? May 23, 2016 22:19 |
|
NihilCredo posted:would this work in C/C++ and related languages? I occasionally do this in .net instead of an if/elseif, when it allows for a clearer visual alignment: no, the cases have to be constant integral expressions
|
# ? May 23, 2016 22:35 |
|
Valeyard posted:i commited a test a couple weeks back, got a review comment a couple days later like you verified that the method doesn't throw an exception!
|
# ? May 23, 2016 22:36 |
|
GameCube posted:i'm so freaking poor that i got myself a library card last week. i should do that. the library is only a block out of the way from my daily commute so it's not like it'd be difficult to just swing by, but i haven't actually gone inside it since high school
|
# ? May 23, 2016 22:48 |
|
working on my C++ dos toy thing. i have some routines set up to draw lines... I'm trying to feed an array of points into a general polygon drawing routine but pointers are driving me nuts as usualcode:
code:
|
# ? May 24, 2016 00:47 |
|
you're passing an array of points to something wanting a pointer to an array of points
|
# ? May 24, 2016 01:00 |
|
|
# ? May 25, 2024 17:51 |
|
NihilCredo posted:would this work in C/C++ and related languages? I occasionally do this in .net instead of an if/elseif, when it allows for a clearer visual alignment: this is not legal c/c++, no
|
# ? May 24, 2016 01:03 |