Recently a coworker asked what he should do to pass an
int into a method,
change it, and then get the changed variable after the method ends. Apparently simply returning it was not an option! I suggested wrapping
the variable in an
Object with a getter and setter. Another coworker suggested
creating a single element int array containing the value.
A while back I read an article about how static typing does not prevent bugs being added to software. The article is appropriately named: The broken promise of static typing. The author conducted research by generating and comparing ‘bug density’ scores for GitHub repositories. The bug density score was determined by getting the average number of issues labelled ‘bug’ per repository. The results showed that there were not any less bugs in statically typed languages vs dynamically typed languages. The author concludes on the results:
When building GUI’s, the interface needs a way to listen and respond to events. Events are triggered when the user interacts with the GUI, such as pressing buttons and inserting text. One of these types of events in Java Swing is the ActionEvent. A commonly used component that generates a ActionEvent is a JButton, which is simply a button that produces an event when pressed. This article serves to explain three different ways an ActionListener can be added to a component.
Long time no post! I thought I would give an update on how I’m spending my (rapidly decreasing) holidays.
Hello and welcome to the first blog post. This blog will be covering programming topics such as personal projects, online projects and things learnt from my Computer Science course.