Skip to main content
23 events
when toggle format what by license comment
Dec 13, 2017 at 15:26 history edited Snoop
edited tags
Dec 11, 2017 at 8:55 answer added Vadim Samokhin timeline score: 1
Mar 17, 2016 at 16:08 comment added Robert Harvey @StevieV: Sorry, AFK. Your new (now deleted) question is quite similar to this one, actually. The prima facie answer to your deleted question is "it's not wrong if that's what your software requirements demand." Except for the degree of ceremony, I didn't see anything at all wrong with the code you posted.
Mar 16, 2016 at 0:44 vote accept Snoop
Mar 15, 2016 at 20:52 history edited Snoop CC BY-SA 3.0
The question was phrased backwards.
Mar 15, 2016 at 11:39 history edited Snoop CC BY-SA 3.0
Didn't explain the part about receiving data well enough, trying to add a little more clarity.
Mar 15, 2016 at 10:58 history edited Snoop CC BY-SA 3.0
deleted 4 characters in body
Mar 15, 2016 at 10:08 comment added csiz @StevieV something like Data and SerializedData. Data is what the code sees and SerializedData is what gets sent through the network. Then make reverse data (or rather serialize/deserialize data) transform from one type to the other.
Mar 15, 2016 at 5:37 history tweeted twitter.com/StackProgrammer/status/709614571435257856
Mar 15, 2016 at 3:09 history edited Snoop CC BY-SA 3.0
Misspelled/Typo said "a" where "an" was meant to be.
Mar 15, 2016 at 1:51 answer added Ewan timeline score: -5
Mar 15, 2016 at 1:49 history edited Snoop CC BY-SA 3.0
How exactly is "ReverseData" called externally? Was not addressed.
Mar 15, 2016 at 1:37 comment added Snoop @jpmc26 The way that the problem is stated I would agree with you 100%. The only thing, is that the method must be called when we end up in the "data received" event-handler, in order to re-reverse the data (I know, weird). I believe I didn't add enough information into the question about that part. What do you mean separate data types?
Mar 15, 2016 at 1:30 comment added jpmc26 @StevieV I believe this only amplifies the concern Kaan raises. It sounds as thought you're exposing a method that changes the state of the object, and the state depends primarily on how many times the method is called. This makes for a nightmare in trying to keep track of what the object's state is throughout your code. It sounds to me more like you would benefit from separate data types from these conceptual states, so you can tell what it is in any given piece of code without having to worry about it.
Mar 14, 2016 at 21:48 answer added Joker_vD timeline score: 3
Mar 14, 2016 at 21:31 comment added Daniel T. The question still stands. What if those 8 bits are reversed twice before the transmission is scheduled? This feels like a huge hole in the public interface. Thinking about the public interface like I mention in my answer might help bring this problem to light.
Mar 14, 2016 at 20:41 answer added corsiKa timeline score: 9
Mar 14, 2016 at 19:31 comment added Snoop @Kaan These aren't the real names of my methods, but closely related. In fact "reverse data" only reverses 8 bits of the total word and is done when we receive and transmit.
Mar 14, 2016 at 19:28 comment added Kaan There is nothing wrong with calling a public method from its own. But, based on your method names, ReverseData() sounds to me a bit dangerous to be a public method if it does reverse the internal data. What if ReverseData() called outside of the object and then called again with the ScheduleTransmission().
Mar 14, 2016 at 18:34 history edited Snoop CC BY-SA 3.0
Wasn't specific about what class would be calling the method.
Mar 14, 2016 at 17:25 answer added Arseni Mourzenko timeline score: 20
Mar 14, 2016 at 17:21 answer added JimmyJames timeline score: 34
Mar 14, 2016 at 17:15 history asked Snoop CC BY-SA 3.0