Monthly Archives: January 2015

Experience OSS Licenses

Open source software is meant to be cannibalized by developers other than the original authors for potential improvements to the code published.  However, this good intention could threaten the livelihood of the author in legal terms.  In order to protect oneself, or to receive credit where is due, author of the software could utilize one of many open source licenses.

There are many three main types of OSS licenses: MIT License, Apache License, and GPL (v2 or v3).  MIT License allows other developers to freely use the source code as they wish as long as the author is credited and is not legally liable.  Apache License is very similar to the MIT License, however, it grants legal obligation to the developers by the means of granting patent rights from authors to external developers.  GPL License binds external developers to release their own derivative work under the same license, thus promoting continuous improvements to the code base.

If I were to publish an open source software, I would probably pick the GPL v2 license as it encourages other developers to improve the source code in a way or another.  Additionally, the software stays open source even though derivative work based off of original source code is developed.  Personally, I believe in open source projects and we as software engineers should promote the open source movement.

How to Ask Questions the Smart Way

People ask questions everyday.  Questions are asked in many forms.  However, there is a “smart” way to ask questions and not so “smart” way to ask questions.  How to Ask Questions the Smart Way describes the way one should ask a question if they want to receive positive feedback when seeking for help.

The following two examples demonstrate what is a “smart” question and what is not a “smart” question.

Example 1:

This question can be found here, where the poster asked:

Give your buttons some behavior. change the foreground color of the Button that was clicked. Choose at random among Color.RED, Color.BLUE, Color.YELLOW, etc. To change the color of the Button, call setTextColor on the Button that is passed to the event handler. However, note that although Button has a setTextColor method, View (the parent class of Button) does not. So, you have to cast the View to Button before calling setTextColor.

This question is not a “smart” question in many ways.  As some of the commenters speculate, it seems the poster has just copied and pasted a portion of assignment onto Stack Overflow.  The poster was expecting someone to do their own assignment for them rather than seeking for guidance or showing any sort of effort that was put into this particular problem.  Additionally, the poster did not even state what the problem was, as demonstrated by the following comments:

What you want to ask ??

College assignment?

It is clear that no effort was put into the question, resulting in negative feedback from the online community.

Example 2:

This question can be found here, where the poster asked:

Given a software system written in Java consisting of three layers, A -> B -> C, i.e. layer A uses layer B and B uses layer C.

I want to make sure that a class of one layer only has access only to classes of the same layer or its direct dependency, i.e. B should be able to access C but not A. Also A should be able to access B but not C.

Is there an easy way to enforce such a restriction? Ideally I want eclipse to complain at once if one tries to access a class of the wrong layer.

The software currently uses maven. Therefore I tried to put A, B, and C into different maven modules and to declare dependencies properly. This works fine to prevent B to access A, but does not prevent A to access C.

Next I tried to exclude C from the dependency to B. This now also prevents access from A to C. However now I am no longer able to use copy-dependencies to collect all transitive dependencies needed for run time.

Is there a good way that allows me a clean separation of layers, but also allows me to collect all needed runtime dependencies?

This is a good example of how to ask questions in “smart” ways.  The poster described their problems, steps taken to mitigate the issue, and how they went about it.  As seen in the post, this particular question was well-received and garnered several responses.  The poster demonstrated their prior attempts to resolve the issue, thus showing the willingness to learn.

If you could demonstrate your willingness to learn, online community will respond positively and try to guide you to answer.  It shows that professionals are willing to help people who are willing to help themselves.  Ask specific questions.  Show your willingness to learn.  Show that you put in effort into the question.  You may not always get the answer you were looking for but the online community will be more willing to help you out.

Experiencing the Three Prime Directives of Software Engineering

Overview

is an open source Android library that provides developers the ability to easily create application sliding menu like the one found across Android applications published by Google.  This library is free to use for either commercial or private use given that the project is cited and license is included in the application.

Prime Directive #1: The system successfully accomplishes a useful task

The SlidingMenu satisfies the first prime directive of the software engineering.  This Android library allows developers to create sliding menus, inspired by applications such as Facebook and YouTube.  Sliding menu is intuitive in a user experience sense that end-users do not have to scroll the entire application to look for options they are seeking for.  Some of the popular Android applications such as Linkedin, 9GAG, Foursquare, and Rdio utilizes this library for their services.  Therefore, the first prime directive is satisfied.

Prime Directive #2: An external user can successfully install and use the system

Installation instruction can be found in README.  All that is needed is to import the SlidingMenu library then add it to project as one of the dependencies.  The README file also provides instructions on how to integrate into an existing project easily.  Therefore, the second prime directive is satisfied.

Image from SlidingMenu DemosPrime Directive #3: An external developer can successfully understand and enhance the system

The library does not contain extensive documentation to provide explanation for other developers to easily contribute to the project.  Only form of explanation of code was done through the comments within the code.  However, the project can be forked allowing other developers to enhance it for their own purposes.  As a result, the third prime directive is conditionally satisfied because external developers can successfully understand and enhance the project but with no documentation to aid the process.