News for hackers. Stuff that matters.
Re:So You Think You Can Program an Elevator by est on Wednesday January 13, 2016 @12:43AM (#10892513)
Somehow I find this API counter-intuitive and painful to use.

- Why currentFloor() is a function not a property?

- Why both goingUpIndicator() and goingDownIndicator() instead of .direction property?

- Why name destinationDirection() instead of currentDirection?

- Why only floor_button_pressed but no in-door button press event?

I gave up.

Re:So You Think You Can Program an Elevator by emonidi on Wednesday January 13, 2016 @03:31PM (#10897248)
1. Because maybe the author wanted to keep the property hidden and only expose a getter function and hide the setter? 2. Same reason. They are being set internally. A sane programmer would not give you the power to do that because its a product of internal calculations. 3. Naming of method/function and variables is the second hardest thing in programming :) 4. The callback of on.('floor_button_pressed') gives you an floorNumber argument which is more than sufficient. What event in real life would you describe with on('in-droor-button-press') ?
Re:So You Think You Can Program an Elevator by digi_owl on Wednesday January 13, 2016 @03:40AM (#10893053)
What i found the most annoying was that it had both a save and a apply button.

Hilariously i missed the apply button on the first try, and wondered why it was still only moving between 0 and 1 after adding a few lines.

The site design could do with a tuneup as well. The actual page seems to only fit on widescreen, while the docs page becomes painful to read on same.