Friday, November 1, 2013

Don't Ask, Don't Get—Professional advice.

Computer programmers, by nature of their job, need to tend towards being very candid in opinions and factual knowledge, as well as critical and honest when it comes to facts. As a result of the kind of work we do, we typically take written word very literally and very seriously.

But that doesn't always work in the professional world. For example, when it comes to job postings. When it comes to being a professional, there is one lesson that's sat with me always, since my dad first told it to me:
Don't ask, don't get.
Of course, his other favorite quote was from a Rolling Stones song, but let's not go there for now. For now, I'll discuss the lesson, then exposit my recent professional progress, and then discuss how it relates to this very valuable lesson.

Wednesday, October 9, 2013

See beyond the ideas—Professional advice

The University (with those capital letters) provides a wonderful environment in which students can learn complex concepts, and even receive fantastic training for a professional career. There's a great reason most decent employment opportunities tend require a college degree, and sometimes higher even than that.

But, if you're looking to make yourself a professional,  it's very important to be mindful of the fact that the university's primary functional output is university professors. That is, the most successful university students tend to be those who fixate on abstract problems, rather than the practical application of those abstract problems. Of course, the former is necessary to be a good university professor, and the latter is necessary to be a good professional.

In this article, I go through a few epitomic examples of how The University might leave an aspiring professional feeling, frustrated, erroneously inadequate, and wanting more.

Tuesday, October 1, 2013

Advanced Enums in OOP: Subclass Chooser

Working on my Acamedia project I stumbled across a basic yet, to a newer programmer, more advanced issue: How should one delegate the task of choosing which child class is most appropriate?

My file Storage.java represents an abstract superclass for an Acamedia user's cabinet, or the cabinet's folders. Both the cabinet and the folders must be able to take a new file and create an "Item" out of it. But how does one select from the many supported filetypes, and their corresponding Item subclasses?

In this post I walk you through the methods used for solving this problem: MIME content type probing, and a Java-based enumeration.

Check this out!

Monday, September 16, 2013

Coding Zen: Sticking to the fundamentals

Because my Eclipse project didn't print the exception,
I set a breakpoint and stepped into the problem to find
something resembling a stack trace.
In my previous post, I described the 'bane of Java programmers,' the ClassNotFoundException. I also outlined its most basic causes, and gave a brief outline of my case.

This post, however, will cover the longer story of my debugging. The intent is to show that debugging can often be a tricky process, and that it's very important to rule out all of the basics first. I knew the projects own files were not somehow improperly imported into the project, and my classpath files all seemed right, which led me (to my downfall) to assume that the problem must be very complex.

I decided also to build upon the previous Coding Zen lesson with a new one, which we will find is tantamount to finding the solution in the more exceptional debugging cases:
The amateur studies advanced techniques; the master practices the fundamentals.

Wednesday, September 11, 2013

Coding Zen: Debugging by understanding

The wise programmer does not seek to find the solution, but to understand the problem.
It's been two months today, since I initialized Blog codeCrave = new Blog();, and since then I've encountered a number of interesting problems with my code. Many of them I've omitted posting about, because of the lovely tool known as Stack Exchange, and its more-commonly-used Stack Overflow. This lovely site has (very appropriately) datified the many problems one might encounter when working on making a computer or web application of any kind.

Shamelessly borrowed from Java EE Support Patterns blog
But in many ways, it serves to weaken the mind. By delegating our problem-solving skills to the crowd-sourced Stack*, we risk denying ourselves adequate development of our own problem-solving skills.

Consider the ClassNotFoundException that is often called the "bane of Java programmers," so much so that there's an entire web service dedicated to helping you debug a ClassNotFoundException. Does that seem excessive?

It's not. Because this problem can be a doozie.

Mindful of the above heuristic, I'm going to walk through the ClassNotFoundException: what it is, what can cause it, and how to solve it. I will go through my particular solution.

The Diamond Problem: C++

When you allow for inheritance of multiple parents in a programming language, you get a whole slew of messy issues that you don't have to deal with when programming in more simplified languages like Java. Simplified languages take care of a lot of background details for the programmer (a trait that has its own tradeoffs).

How many eyes would Bee have?
Let's say you have three levels of classes: Animal, Winged and Legged, and then Bee. As you might know, bees have both wings and legs, which means that, in C++, your Bee class would inherit from both Winged and Legged. Do you see the problem?

Both of those classes inherit from Animal! In your memory allocation, should C++ store room for two instances of Animal's variables, or just one? This is called the "Diamond Problem."

Tuesday, September 3, 2013

Making bite-size issues to tackle

This issue may prove to be divisive, but it seems worth discussing from the viewpoint of a newblood programmer and a potential employer alike.

When using GitHub "Issues," there are two common uses: public users viewing the repository can submit bugs, problems, or desired features, as general or specific as they'd like; the other use is for repo owners to give tasks to one another. This post focuses on how best to utilize the latter for maximum productivity, in a way that still gets work done.

The trick is to make your issues as bite-size and manageable as possible.

Thursday, August 29, 2013

The banality of the "CS" degree

I recently mentioned a Portland Code School meeting I attended, at CorSource in downtown Portland, to a friend of mine. It started an interesting conversation.

Here's some context: Portland Code School is a crash-course, 12-week program where students work about 90 hours per week to rapidly learn web app coding, expand their portfolios (by deploying web apps onto Heroku), and try to enter the workforce as a junior developer. Top students are regularly recruited by area companies.

The meeting I went to included a presentation of PCS grad projects, a panel discussion, and a presentation from TAO president Skip Newberry

Talking about this program, and my experience at the meeting, sparked a whole conversation about industry habits and how junior developers are educated and hired.

Wednesday, August 14, 2013

Coding Zen: The Knife and the Banana

There is a knife which cuts a banana. With every slice, the last piece falls into place, and the next piece always sticks to the knife.
When you finish cutting the banana, what do you do with the last piece? 
You take the last piece off as part of the destructor of your Knife Cutting. Obviously.

Keep reading to see an example at work...

Tuesday, July 23, 2013

In school? Meet with your professors often.

I had a meeting with my instructor for Programming Systems, where my project partner castlez and I discussed our project with him: a Dungeons and Dragons app. castlez and I have been working at this project for a few weeks now, but haven't made huge leaps of progress (side project, in any case), and we were hoping to get some advice about general workflow, source-code management, object orientation and cohesion, and design tools.

What we got out of it was great advice that is going to help us keep motivated to work on this project: use CRC cards to design, code as late as possible, take on working roles that suit you best, and keep coding!

Wednesday, July 17, 2013

Getting to Commit to Git

I'm going to assume that if you're here, you have both a current version of Eclipse (Kepler!) and a GitHub account. But I'm also going to assume you haven't really done this before. I sure hadn't, and I had a few headaches. Let's begin the adventure...

Thursday, July 11, 2013

Advanced Enums in OOP: Commands Made Easy

The idea of an enum is pretty easy: essentially to give a variable which has a fixed number of options. Common examples include a playing card's value, or its suit, or a genre of a movie.

But enums serve a greater purpose in OOP, especially in Java: creating advanced structures for multiple, nearly identical classes, in a consolidated way.

The perks of OOP

One of the biggest problems with procedural programming, and really with languages that are not object-oriented, is the huge amount of overhead created when working on a large scale. Indeed, object-oriented programming is almost entirely for the purpose of huge scalability.

Let's take an example...

Hello, World

I am enrolled in a number of classes as I earn a minor in computer science, and plan on extracting as much value as possible from them. One way of doing that is teaching. Since I learn most effectively when I process for teaching, I am going to use this blog as a medium for doing just that.

In subsequent posts you will see sample code uploaded, typically generated or received in class, with an explanation of its function, build and purpose. I also plan on discussing concepts that reach above coding, such as object-oriented programming techniques.

Let's see how it goes...