Changes 9/15/14
Ruby:
- Read Kevin's email, which talked about problems with a variable being modified in separate threads
- This can cause problems, because one thread may find its information about the variable out of date.
- For example, if one thread stored a list's length in a variable, and another thread removed all elements from the list, then the original thread's length variable would become out of date.
- This example's failure is easy to fix though, and I'm not sure what the best way to discover the faults in what I've written
Java:
- Learned about Javadoc, assertions, and inheritance
- Javadocs allow you to show other developers what the different variables in your methods do. When someone enters a method with a Javadoc into their IDE, it will pop up with your explanation of what the variables do and what it returns
- Assertions are a way to test your code, but you need to set a compiler flag to have them do anything, and I don't know how to set that
- For example, assert x > 0; will throw an exception if the flag is set and x is less than or equal to 0
Showing other developer's what how to use code you've written using Javadoc is called "documenting your API", and is really important to do well on any programming tools you develop that you want others to be able to use.
ReplyDeleteOn the Ruby side, you are exploring things that are usually covered in an operating systems class in your senior year of college or 1st year of grad school. Nice to see you looking into them now.