Home→Forums→MonoBrick EV3 Firmware→Brick-Simulator?→Reply To: Brick-Simulator?

Martin Wagner
Hi Anders,
I have spent some time in different implementations of the buttons.cs, … and I need your opinion:
1. Interface with EV3- and Simu-Implementation
+ object oriented,
– a lot of changes, high coding effort, EV3 version contains simu code and data objects for binding of WPF elements
2. Global Boolean with If … else … endif
+ simple
– EV3 version contains simu code, overview over e.g. all EV3 codes only via ‘Find all references’
3. Compilation symbol with #If … #else … #endif
+ simple, clean code for each version
– overview over e.g. all EV3 codes only via ‘Find all references’
I would prefer the third way because you see the differences directly in the context of the surrounding functional code. I think this is more important than the overview of all e.g. simu code in one spot, but the code is more difficult to read.
What do you recommend? What fits best to your programming style and is better for code maintenance?
Thanks for any comments,
Martin
P.S.: Sample of how I should do it would be the best.
Follow