Wednesday, July 9, 2008

Update: Daily Exercises

So, yesterday was the end of my first full week trying out my new routine of math, programming, and guitar each day. I felt it was a good introductory week to help me get used to the effort and time required to do such a thing, and I learned a lot about what changes I'll need to make in order to be successful with this process.

I stuck to my plan about 4 days out of the 7. It was a bit of a bad week to start this, as it fell over a holiday weekend, and 2 of the days in the 7 I had softball games (one of which I was injured in). Nonetheless, it was simply an introduction into what it would be like, and successful in that regard.

My guitar playing has improved dramatically. Not to say that I was bad, but I'm able to play some things now after only 7 days than I really ever imagined I'd be able to. As for programming, I found myself solving some complex problems of which recently I found rather stubborn. The Math was probably the hardest thing to sit down and do, and I failed in this department more than any other. However, when I did sit down and work some problems, each day they became easier.

I guess the main things I learned are:
  • It's hard work to do a routine like this with 3 different things. Usually people have a focus on one thing, and that's easy.
  • Tracking progress is essential. I didn't do any sort of that this past week and I don't feel like I can measure what I've accomplished in much of a concrete way. With guitar it's easier because I can set a goal to learn a song or a part of a song, and then do it. The other areas will require some structure.
  • It works.
I'll update this again at some point, at the longest I'll wait until a full month, but I may update it before then. I encourage you to try this out, whether it's with 1 thing, 3 things, or as many as you think you can handle, although I wouldn't push it much past 3 or the point of diminishing returns will surely kick in unless you don't have any other daily responsibilities. I work 2 jobs, so it's a time management exercise as well to fit all this stuff in!

Good luck.

Tuesday, July 1, 2008

Something has to change

This encompasses more than just programming, but it's the best place for it to go and I didn't feel like creating a new blog section...

I have been pretty busy lately, or that is to say "I've always got a lot to do, but usually don't accomplish what I should due to lack of structure and being worn out."

So, in that light, I came up with a plan to improve my skills in the areas of which I require them: Programming, Math, and Music.

Every day I will do the following:
  • Write code - I tend to do this anyways, but it's easy to do a lot of work for a 3 days and then take a day off. Nope, not anymore.
  • Do Math - I'm not great at Math, but my shortcoming in it is only due to lack of general effort toward the subject. Each day I will work some Math problems, as I need to be ready for a placement test anyways, I also need to sharpen my skills and keep them sharp for my future career.
  • Practice guitar - Practicing guitar is one of the most horrible things ever. Note I said "practice" and not "play". It's hard to force yourself to do exercises, but unless you do, you get into a rut and you never progress.
After one week of doing this, I'll post an update and let you know how it's worked out. All 3 of these areas are very closely related in terms of brain function, so while only doing one of them each day would greatly improve that area, doing all 3 should have a greater effect. The idea behind this is that you can't simply work on these things for 8 hours in one day, and then not do anything for the next 3. It's about the constant repetition of the activity day after day that will bring results. It improves memory, coordination, muscle memory, etc... I'll also make it a point to sit down and read something (other than e-mail...) each day. I don't particularly need help in this area, but reading often improves coordination (line skipping and such), concentration, vocabulary, and all sorts of other things worthy of improving.

I think not only will this routine improve the areas of which I'm targeting, but that it will also improve my overall productivity in life as I'll be on a more driven and focused path throughout my day, and I'll be more inclined to get something done rather than just chill out.

Until next time...

Friday, June 6, 2008

10 Great Features In Netbeans IDE 6.1

Netbeans is an excellent IDE from Sun Microsystems. It is written in Java and runs on all major platforms. With the latest 6.1 release, Netbeans has really stepped up its game and can now compete with some of the market leaders for integrated development environments. For more information about Netbeans, visit

Below is a list of 10 really helpful (...and cool) features in Netbeans 6.1. My examples are illustrated using a C++ project, but almost all of them apply across the board to the other languages that Netbeans 6.1 supports:

1. Code Bookmarks - This feature allows you to bookmark individual lines of code for easy browsing later.

2. Build Platform - When working with a C/C++ project, you can select which platform you'd like to build the executable for.

3. Code Completion - If you've used Visual Studio, then you've seen this type of thing before. While coding, you can pause (or use Ctrl+Space) and a code completion dialog will pop-up. This works for standard library items as well as items specific to user-created classes.

4. Code Formatting - Netbeans 6.1 gives you the ability to customize every possible code formatting option you can think of. Each case is separated into a group, and then each item in that group is a check-box. Changes are reflected in real-time via a preview pane to the right which is populated with example code. Once you make changes to these settings, Netbeans automatically accounts for them while you're coding. Very cool.

5. Single File Compile - Tired of building your entire project when all you want to do is make sure that the file you've just changed compiles cleanly? Netbeans 6.1 offers the "Compile File" option to do just that.

6. Diff - Diff is a very powerful tool for tracking changes between 2 different versions of a file. It isn't source control, it's simply a tool to contrast 2 versions of the same file, and it's commonly used when writing software patches. Netbeans 6.1 gives you the ability to run a Diff on a file right inside of the IDE.

7. Favorites - Netbeans 6.1 allows you to add files from your project to a list of Favorites. This is extremely helpful in large code bases.

8. Symbol Tracking - While viewing a source file, simply right-click on a symbol and you have the option to track various things such as the definition/declaration of the symbol, its source/header file, all occurrences of the symbol in the current file/entire project, and more. Again, very helpful in large code bases.

9. Include Directories - When developing a C/C++ project, Netbeans 6.1 makes it easy to add additional include directories to it's search path.

10. Local History - This is one of the coolest features I've seen in a while. Just think source control, except it's stored internally and it's graphical.

Hopefully this list has gotten you excited about Netbeans 6.1. If not, read it again! :)

This review was submitted for the Sun Microsystems Student Reviews Contest. You can get more information about this contest here:

Friday, April 18, 2008

Netbeans: Why It Matters

The topic comes up all the time: "Which IDE to you use?"

It doesn't matter which programming language is being discussed or the scope of the project, developers always want to know what the "other guy" is using. I tend to do all of my development in C/C++ and it probably comes as no surprise to others using Netbeans for C/C++ the shock and resistance I receive when I tell people this.

I'm a Linux guy. Up until last year, I had never written a lick of code under any platform other than Linux. When I was eventually "forced" to write some C++ under Windows, I felt like a foreign exchange student with no sponsor. I had absolutely no idea what was going on. I almost started to believe I didn't know how to program anymore. Where was gcc? How do I run this thing? How in the hell do I use Visual Studio? In walks Netbeans, the one thing I can always count on in my software development. That is, aside from the knowledge I've already garnered.

The fact that Netbeans offers a full-fledged IDE that runs on multiple platforms is enough in itself. The fact that it has support for every language you could ever want (or need) to write code in is nearly unprecedented. The fact that it does all of this better than any IDE I've ever seen is teetering on goofy. The fact that it's open source is down right nuts.

I, like many developers, am forced to write code in a number of different languages for a number of different platforms. It's frustrating enough having to remember the nuances of all of these different languages. You do something one way in Java, another in C++, a new way in Ruby... but that's not the worst part. Chances are, unless you are really just using an editor as opposed to an IDE, you have to write this code with a different development tool. Isn't the idea behind an IDE to make the whole development process easier? What's easy about juggling different programming languages along with different development environments? In walks Netbeans.

Netbeans provides developers with a consistent look and feel across all of its supported languages. This allows developers to use Netbeans for all of their tasks without missing a beat. There is no learning curve. If you've written Java code in Netbeans, congratulations, you can now use Netbeans to develop software in any other language. I think people overlook the benefits of this, mainly because it's not a very common luxury. The old school of thought between developers, namely C/C++ developers, is that you use a text editor on Linux, and Visual Studio on Windows. For a lot of people, that's a deal breaker. I can't say I blame them: Visual Studio is usually a nightmare to use for anyone coming from the purist environment that is Linux/UNIX C/C++ development. In walks Netbeans. You're a Linux C/C++ developer coming over to Windows for a project? No sweat, just install Netbeans, install the C/C++ development tools (compiler, make system, etc...), and get right back to work. The effect this has on productivity is astounding. Not only can you get right to work, but all the experience you gain while working on this project under Windows can be directly translated back to Linux, or whatever your native environment is because the IDE's interface is the same, because the IDE is the same!

I talk a lot about C/C++. Guilty. Every other language is on a "need to use" basis with me. However, I've done a lot of work in Java, some work in Ruby, and recently my first ever experience with JavaScript. Let's focus on JavaScript since that's a pretty old school language. The JavaScript project I was working on involved some proprietary Microsoft technologies. Given that, I was basically forced to use Visual Studio. Luckily the new version isn't so bad, but I still wasn't pleased. I was out of my element, and I had to worry about more than just the code I was writing. That's a bad thing. In walks Netbeans. In the 6.1 Beta, JavaScript support was added. Eurkea! I said. The nature of the project was such that I could write the JavaScript code separate from those other proprietary technologies I mentioned, so I installed the beta and got to work. Not only was the learning curve involved with Visual Studio cut out of the mix, but the fact that I had the reference documentation built in to Netbeans was instrumental in my rapid development iterations with this project having never written any JavaScript in my life!

The IDE war will never be settled. Maybe that's for the best, to each his own. However, the bottom line is Netbeans makes you a better developer. It helps you do your job, and it helps you do your job well. The fact that it covers the major elements of all of the languages it supports is second to none. Break your code down by classes? Done. Attach an in-depth profiler? Cake. Debugger? You betcha'. Source control? Look ma', no hands.

If you've never tried Netbeans, I strongly encourage you to do so. It's alright, you don't have to tell anyone that you're using Netbeans. You can lock yourself away, keep all the lights off, cover your face if you must, but just try it. Once you put all the hype aside, you'll realize just how invaluable a tool like Netbeans is. And then you'll wonder why you weren't using it years ago.


This blog entry was submitted for the Netbeans 6.1 Beta Blogging Contest. For more entries, check out the contest page here:

Friday, March 14, 2008

All I need to know I learned in... the library?

I was fortunate enough to attend a school for a year that had an amazing library. Not just for computer science, but for everything, from what I've heard. Clearly, since I'm a software guy, I only cared about their collection of computer science books, and they certainly didn't disappoint.

If you could find it on O'reilly, you could find it in this library. After I went there for the first time, I was hooked. Never in my life had I viewed going to the library as an exciting experience. I wanted to go to the library. I'd spend 90 minutes browsing the shelves.

Then, for reasons we won't go into, I transferred schools. I ended up at a pretty decent community college for a year while I was transitioning, and I was deeply saddened by what I found in that library. So, what's my point?

Those books are there for a reason, and they are free. Take advantage of them.

Computer science is one of only about a handful of professions that is pretty "take-home". Maybe that isn't true for everyone, but the vast majority of people in this line of work, namely programming, take their work home with them. It's not necessarily because they are work-a-holics, but simply because they love doing what they do. Their brains don't allow them to just "turn it off" and leave some programming issue for the office. They enjoy solving problems. Unfortunately, sometimes people's jobs depend on them taking their work home with them, but we won't get into that. In fact, this paragraph needs to be it's own entry, so I digress...

Basically what I'm saying is that you can't be the best programmer that you'd like to be by relying on your college courses to teach you what you need to know. I may not be done with school yet, but I'm not exactly naive on this matter. Your college classes teach you very little about what being a programmer means. In part, it's not their fault. They have to keep things at a general level to allow for a vast number of technologies that the students may have to work with. Still though, you have got to put in the work outside the class room. I don't think I need to belabor this point too much as if you've made it through at least 2.5 years of a CS/SE degree, you truly do love what you are doing. Also though, you will be expected to continue to learn when you graduate. You'll have to use a language at work that you may hate, or may not know at all. You'l have to learn API's you've never even heard of, etc... but you can't give that as an excuse to your boss. There will be some degree of toleration for your lack of experience in a particular area, of course, but when it comes down to it, if you want to keep your job and do well at it (which in-turn means you'll enjoy it a hell of a lot more), you've got to put some effort in "off the clock". I'm not saying you have to ssh in, vnc, whatever...and start writing your work code from home, but you will have to crack a book (or 5 as I find myself doing) and soak up some knowledge.

Take advantage of your schools library instead of taking it for granted. You'll be surprised how much you enjoy reading. Not a bad place to meet girls either, especially when you are carrying around fancy sounding programming books...

There's more to coding than...well.... coding.

Learning how to write software is really a tiny piece of what it means to be a programmer. Let's be honest, writing code is actually pretty easy to do. You spend a few years learning how the basic logic structures work, the looping, function calls, return values, blah blah blah. After that, the most work you put in is studying some new API or learning the nuances of some new language. All in all though, it's not terribly hard to do.

Unfortunately, there's a lot more to it than that. The book series "Effective C++" by Scott Meyers (I've provided links at the end of this entry to all of the items I rave about, so no need to fire up Google) really opened me up to this notion. It was the first book I had read about programming that didn't teach you how to write code, but how to write proper code. Actually, not just proper code, but great code. It was such a breath of fresh air to pick up a book about programming and not have to see the same step-by-step teaching process. Books like this (you should have already gone and checked it out from your library by now...if not, stop reading and go. now. I'm waiting.) focus on things that too many programmers neglect: writing proper, efficient code that does exactly what you intend it to do, and does so very nicely.

But again, that's just another piece of the puzzle. I've been browsing some programming blogs recently and I came across this one: There is some really great content in there and I encourage you to check it out. The relevance for this discussion is that the author is a big proponent of agile development and test driven development. If you aren't familiar with those concepts, I hear Google works quite well. The basic run down of agile development is that it's a production mechanism of sorts that stresses quick iteration of software based on client feedback (whether the clients are other programmers working on other features or your actual end-users depending on the type of project you have). A main element of agile development tends to be a team oriented approach that involves things like XP (2 programmers working side-by-side on the same piece of code).

For an example of how well these things can work, check out this entry in the above mentioned blog: You'll be amazed at how much work gets accomplished with this method.

Test driven development follows with the iterative theme in that you essentially reverse the coding process. How? With the use of a unit testing framework, you write your tests before you write your code. Clearly, the test should fail. Then, you write just enough code to make that simple test pass. The key word there is simple. The tests you design should be very small and simple to implement. The author of that blog suggests between 1-2 minutes to design the test, and not much more than 15 to implement the code to pass the test. "Test Driven Development" by Kent Beck seems to be a godsend book on this design methodology. I just picked it up from the library yesterday and it's very helpful in outlining the process, go get it!

These are just 2 examples of design methodologies in software engineering, but there are a ton of other ones. Some work better for certain things, but the point is that this stuff matters. It's vital in a professional software development environment. Without things like this, nothing would get done, and even if it did, the result would be awful. I encourage you to start learning about this stuff while you are still in school, because chances are you won't have too much meaningful class time devoted to things like this. All of it can only serve to make you a better programmer.

This is where the distinction between "Computer Science" and "Software Engineering" comes in. Software engineering is devoted to stuff like this. It's all about the design, the planning, the process. Computer science tends to be focused on the implementation alone. The curriculum in colleges today leaves much to be desired in my book. How can you send CS majors out into the work field with very little knowledge of software engineering principals? To me, they go hand in hand. You can't write any sort of decent code without a design or a planning process. What about a roadmap or schedule for the project? You can't just "wing it" and expect any worthwhile results to come out the other end. Some people think all of this "management" should be the responsibility of the projects "manager". Maybe so, but I don't think it's black and white. The project manager can't write your test cases for you. The project manager (in the sense that most people think of him/her in) can't set realistic and useful code milestones for you. As a programmer, you can't get to where you need/want to be unless you know where that place is before you start.

I encourage you to read as many blogs by professional developers as you can. These people are wise beyond my years, so I could go on and on, but you're better off hearing it out of their mouths (or fingers...) than having me repeat to you what I've learned from them. The "Games From Within" blog above is really outstanding. I learned more about software engineering in a few hours than I have in 3 years of college. In addition, look for some language-specific blogs by some seasoned vets as well. These blogs tend to focus on many similar topics that the "Effective C++" series does. That is to say, the "how to do it right" as opposed to just the "how to do it". I found this site the other day and it has a wealth of information from blogs by over a dozen different professionals, to regular articles:

Good luck, and remember: learning how to program is just the first small step in being a software developer.

Resources You Need To Check Out

Websites / Weblogs

Monday, March 10, 2008

There's room for everyone

One of my biggest problems to date has been that I get discouraged when I look at what's already been accomplished in this field. When you are sitting down to work on a trivial idea you've come up with, it's easy to stop and say "Wow, do you have any idea how complex the GCC compiler is? What the hell am I doing with this simple program?!" It's an easy trap to fall into, but a deadly one.

We can't all be John Carmack, Bill Gates, Linus Torvalds, etc etc etc... but that doesn't mean we should find a new profession. Implementing those trivial ideas are essential for growing as a developer, and if you don't go through that process you'll never get to where you want to be. John Carmack didn't roll out of bed one day and write a 3D game engine. He had years of programming experience. Granted, he's a very intelligent man when it comes to math and science, regardless of his programming abilities, but again, he's one of the many exceptions. Most people simply aren't that gifted. However, if programming is the field you want to be in, you can work hard enough at any area of it and become proficient.

The only remedy I've found for this issue is that when you have an idea for a piece of software you'd like to create, don't "Google it". Most ideas that most of us have will be based off of some piece of software that is already in use. Going to Google to check out some of those applications is only going to worsen this issue. I like to get off of my computer, grab a pen and paper and start designing the system "offline". It's actually a lot more productive than sitting in front of your monitor, and you can't get discouraged if you pretend that nobody has ever made this piece of software before.

Going back to the trivial nature of some of the programs we may write... Just as programming books start you off simple before branching into pointers, objects, templates, data structures, etc... you should be doing that with your code. Now, this tends to happen naturally anyways since you can't well write code involving things you don't yet know how to do, but I know I've certainly tried. Not to say that it's always a bad thing to test new waters, but you shouldn't really make a habit of doing something until you understand it. A book progresses rather quickly, but your projects should progress much more slowly in terms of the complexity of the underlying software. This is paralleled by the fact that you cannot simply read a programming book front to back as if it were a novel, it must be an interactive experience in which you are typing the code from the book, doing the examples, doing the projects, etc... The more time you spend building the complexity of your projects up, the better off you'll be in the long run because you'll have an expert-level understanding of everything you've done, which will then make the transition into the really advanced stuff easier.

A great way to do this is to develop your software idea just like a mainstream piece of software. Have iterative releases of your application, adding new features and refactoring code along the way. Make a habit of creating a "TODO" list after each release so that you have specific points to focus on. Ideally you'd have setup some sort of road map at the outset of the project, so you should already have some direction in this regard. Set stern, but reasonable deadlines for your releases, manage a blog documenting the process, invite others to use your applications (friends are fine, as long as they will give honest feedback), etc... Doing all of these things will keep you excited about your project, focused on your project, and you'll absorb a lot more of the techniques than if you just fleshed out your initial idea and say "Meh, that's cool I guess...".

Hope this helps.

Tuesday, March 4, 2008

College Courses

When I transferred to my current school last year, I heard a big buzz about a change in the department from C++ to Java. At my previous school (a very, very good one), Java was the focus of the curriculum. We did a lot of advanced things with Java, and although I don't use Java as my primary language, I learned a lot about programming. C++ was used to teach pointers primarily, but some of the OOP concepts were also presented of course. Now, the difference between that school and the one I'm at now is that this school is on semesters instead of quarters. At my old school, you could ideally finish all of your Java courses in your first year of school, thus opening the door for more specialized courses that didn't force you to use a certain language. The main issue of this post is to discuss the programming curriculum that I think should be in place in most schools, but isn't.

Below is a basic outline of the flow of programming courses that I would prefer be offered:

  1. C - Focus on basic programming logic, functions, recursion, arrays, and introduce structs.
  2. C++ - Pointers and memory management, heavy focus on OOP from novice to expert topics. I would choose to wait until now to deal with memory management because a lot of bad habits get formed when you do this stuff in C without knowing what you're doing.
  3. Java - Heavy focus on interfaces/abstract classes. The most confusing things to most people in Java is having to extend the standard library, override functions, etc...
  4. C# - With this language coming into popularity, it's a must have.
So, what's my logic here? I believe in starting from the ground up in order to establish good habits and strong skills. I began teaching myself C++ when I was in 8th grade. By the time I was forced into taking a Java class, I had no problem whatsoever picking it up. Take the inverse of that. Nearly everyone I've talked to that started programming in Java has struggled in C++ and/or despised it. Why? Java hides too many details from you that become your responsibility in C++. Basically, if you can code in C++, you can code in anything. I don't think you can honestly say that about Java. This is of course a general statement, this isn't to say that there aren't plenty of intelligent people out there that can program in any language, because of course there are. In fact, any programmer worth his weight can, and should be able to program in any language. The point though is that when you are teaching the material, it would be more beneficial to start with C/C++ and then simply learn the nuances of Java from there. The beauty of the above outline is that it allows you to move on to more specific topics such as data structures, GUI, threading, etc... and by the time you get there, you are armed with knowledge of 4 programming languages. The current trend seems to be to teach a particular course with a particular language in order to kill two birds with one stone. I'm not a big fan of this. I think someone is far better off coming into a data structures course with intimate knowledge of at least 2 programming languages as opposed to being expected to develop that knowledge of a language while at the same time mastering data structures. In addition to the above diagram, I think a school should offer at least 2 scripting languages and require one for a degree. Python, Ruby, Perl all come to mind.

My main concern is that a lot of kids will graduate from school with zero ability to program in anything other than Java. That's more of a reality than you may think, especially when C++ is essentially being removed from the curriculum of some schools. The bottom line on this is that C++ is widely used, and that isn't going to change. In fact, in some areas of Computer Science, namely Game Programming (console/PC), C++ is king.

More and more I'm finding kids in my CS courses that have never done a lick of programming work before coming to college. The market is always good for Computer Science, so they decide to pursue it as a career. These are one of groups of people that I have in mind when I say you can't go from Java and learn any language. The popular argument against this is that C/C++ is too complicated for these people. Maybe so, but I don't agree with that if the course is taught properly. Secondly, think of it as a "weed-out". It seems the popular choice for a "weed-out" course at a number of schools is discrete math. While I understand the concepts presented are important, I don't view them as things that are specific to this course. I think you garner all of the logic you need to in your programming courses/experiences. Secondly, I don't think this course serves as any sort of useful primer for a data structures course, and at a lot of schools that is how they have the pre-reqs set up. The only logical reason to do that is to "weed-out" kids that may not be cut out for this line of work. I think a more useful test would be teaching C/C++ as a first language as opposed to Java. After all, if you can't design and write solid code, you won't have a job very long. Anyone can sit down and work out logic puzzles.

Just my two cents.

Monday, March 3, 2008

Why put a go-kart engine in a Camaro?

I was browsing some projects on Sourceforge yesterday and I came across a basic game of Checkers. I believe they were using GTK and maybe SDL as well. All of the source files were C++. Now, SDL works natively in C++, but as far as I know, you'd need to use GTKMM in order to write GTK code in C++. Nevertheless...

This person usesd absolutely NO features of C++ in his code. It was all straight-C. I really don't understand this at all. Why incur the extra overhead of the standard C++ libraries and then not use them? Secondly, why use C if you don't need to? When I say that, I'm referring to the need to do a lot of low-level memory manipulation, in-line assembly, and other things of the like. Of course, any of that stuff can be done in C++, but usually C is preferred. This application had none of that in it. It was just a bunch of structs, char*'s, and SDL/GTK library calls.

My stance on this particular instance is to just use C++ instead of simply changing the file extension to ".c". std::string is a lifesaver, and the C-style structs just get clumsy and very limited after a while, especially in a game. Those 2 things alone would have made the game more extensible, easier to maintain, and a lot easier to understand.

Just my two cents.