d2jsp
Log InRegister
d2jsp Forums > Off-Topic > Computers & IT > Programming & Development > Help Me Code Better
Prev1234
Add Reply New Topic New Poll
Member
Posts: 1,995
Joined: Jun 28 2006
Gold: 7.41
Mar 5 2014 05:38pm
Quote (SCVonSteroids @ Mar 5 2014 06:04pm)
Yeah the handler is mostly for it's nice little postDelayed() function, but I understand what you're saying here. I think it would've been overkill to give everything it's own thread, this runs pretty smoothly, even on this shitty emulator O_o


No, I understand that. In the spirit of the thread though, you wanted advice on how to make you code better, not advice on making things work. Making things work is simple. Making things work elegantly is a different story.

Which is why I will reiterate, whether it is overkill or not, instead of having a single handler for the game you should really modulate the work and give each piece it's own handler. Simon should have a handler, the UI should have a handler, and the player should have a handler. Designing it this way allows for easy extensibility in the future when you want to add more features that will ultimately require multi-threading support.

Go Back To Programming & Development Topic List
Prev1234
Add Reply New Topic New Poll