16
dmoa
6y

Small test at school testing our knowledge of javascript and the p5js library.

One of the aims was to make a small rectangle slowly move across.

I lost one mark because I didn't define a y variable for the rectangle, even though the y never changes.

*sigh*

Comments
  • 2
    The fuck
  • 4
    Always make things configurable if it's not way to much work doing a bit more work now will avoid more work in a few weeks when they suddenly want the y axis movement to. You will have to reread that code to see how to do it.
  • 1
    Avoid magic numbers at all cost
    Store them centrally, maybe a static class or some ConfigHelper if you language provides one
  • 0
    @Codex404 it was a one off test of knowlege
  • 0
    @dmoa sure, but its a good idea learning to do it like that as soon as possible.
Add Comment