View Single Post
  #7   Spotlight this post!  
Unread 20-03-2013, 16:24
JesseK's Avatar
JesseK JesseK is online now
Expert Flybot Crasher
FRC #1885 (ILITE)
Team Role: Mentor
 
Join Date: Mar 2007
Rookie Year: 2005
Location: Reston, VA
Posts: 3,684
JesseK has a reputation beyond reputeJesseK has a reputation beyond reputeJesseK has a reputation beyond reputeJesseK has a reputation beyond reputeJesseK has a reputation beyond reputeJesseK has a reputation beyond reputeJesseK has a reputation beyond reputeJesseK has a reputation beyond reputeJesseK has a reputation beyond reputeJesseK has a reputation beyond reputeJesseK has a reputation beyond repute
Re: What's the difference between robotInit() and constructor in SimpleRobot?

In the software industry, things like init() and postInit() are used to remove circular dependencies. This is often the case during display startup -- the data that drives the display can't be displayed until the data processors are up. So one would register a listener in the data processors, and that listener would call display.postInit().

There's also an issue in Java where overwritten functions still call the parent's implementation in the parent's constructor while constructing the child object. That's why, if you call an internal method from a constructor that method should be private or final. Here's some more info. An outside class which then call the robotInit() method fixes this issue.

The language isn't specified, so that's the best I got
__________________

Drive Coach, 1885 (2007-present)
CAD Library Updated 5/1/16 - 2016 Curie/Carver Industrial Design Winner
GitHub
Reply With Quote