Tuesday, March 1, 2011


Sometimes new students do not understand the difference between copying code (cheating) and working with others to complete a project (collaboration).  This post will try to define the difference between the two.

Many times to finish a project you my have to work in groups or with other students.  Cheating would be taking someones elses function or method, and copying it in whole.  An example of collaboration would be asking for help and fixing the code you already have to work properly.  You should make a good solid effort to write your own code before asking for help.

It may be tempting to Google an algorithm and use it in whole for your project.  Teachers tend to frown on this as you are not really learning how to write said algorithm.  An example would be a bubble sort.  You can find a bubble sort function for every language on the internet.  The goal of all programming classes is to teach you how things should work, therefore you should write your own code before consulting other peoples code.  If you do end up getting code from somewhere else, make sure you know how it works.  One thing we do not need is anymore copy paste coders entering the market.  These programmers will quickly be shed as they do not have the required problem solving skills.

Main point here is that if you just copy all of your code without writing your own, you will not be able to solve a problem when you get into the real programming world.  I know many students that cannot solve problems them selves, but are in high level programming classes.  Just because you have a degree in the field doesn't mean you are proficient in your degree field.

Happy programming!

Friday, February 25, 2011

myBlog[2].newPost("Coding to get the grade");

There are a few things most programming professors expect in the code that is handed in to them.  In my experience professors like code that is clean, well commented, and has no tab damage as well as anything that is required by the college, such as an honor pledge.  Obviously another thing professors like is code that compiles and does what is required for the assignment.

Writing well commented code is a must, especially when you get into programming in a team of programmers.  A general rule is that if it was at all hard for you to write, comment it.  I recently got a job developing in C#.  I came in on a project and there were no comments at all, for any of the code.  As such, it took me about twice as long to read though the code and try to understand it.  As far as school goes, I've had professors say they will not grade an assignment if there are no comments and that about 15% if your grade on said assignment was for good comments and clean code.

I've had one professor that would dock points for tab damage.  What is tab damage you ask?  Tab damage is when you use tabs instead of spaces to indent your code.  All text editors handle tabs differently.  Some of them will set a tab to be equal to 5 spaces, or 3 spaces, or 7 spaces etc.  Say you are writing code in a text editor where a tab is only 3 spaces, and your professor opens your code in a text editor where a tab is 7 spaces.  In your professors text editor your code will look terrible because of the giant indents.  A way to avoid this is to set a tab in your text editor to insert a give number of spaces instead of a tab character.  All text editors treat spaces the same, so no damage from tab characters.  Some professors care about this and some don’t.  Also most IDE’s will take care of this for you.

Honor Pledges.  Make sure they are there if your professor is requiring one.  These basically say “I didn’t steal this code in whole or in part”.  This keeps students from cheating on their assignments.  Worried about collaborating with other students or friends?  Usually the college will have a policy on this, and have an area in the honor pledge to put who you worked with.  There is nothing worse than working on an assignment and then getting a 0 because you forgot to include the honor pledge in your code.

Code that compiles is a must as well.  If you are having trouble, don’t be afraid to ask your professor to point you in the right direction.  They are there to help you.  Another thing to watch out for is if you comment your code once you are done (you should really be doing it as you code) make sure your code compiles and runs after you make comments.  Never know, you might have accidentally deleted a semi-colon, or forgot a /.

A lot of what I just talked about is dependent on your professor, and how strict they are, but if you plan on getting a job programming you should take hold of good programming practices.  As I’ve heard, write your code as if the person that will be reading it is a crazy psychopath that knows where you live.

Happy programming!

Thursday, February 24, 2011

myBlog[1].newPost("Some more tips for class and books");

@ PFT: Leaning basic programming is a pretty generic thing to ask.  I would say start out by buying an O'Reilly book in what ever language you would be interested in.  If you are more interested in web development/design I would recommend C# and ASP.NET my self since I deal with it daily, although I know php is also pretty powerful for web applications.
@THEFROG: I am currently a junior majoring in Computer Science.  I'd rather not say which college I go to, but we have a super computer in the top 75.

Back to school subjects.  For a programming class, you will probably not need the "required" book listed by the book store.  When I was a freshman I bought the Java book for $130 from the book store.  I opened it a total of 3 times.  Each time was to get the JDK from the disk because I didn't want to download it.  If you need to know anything about the Java API, then the well known saying in the computer world "Google is your friend" applies.  Also Oracle has the entire Java API on their website for reference.  Save the money, you probably don't need the book.  Buy the book, and then think you can sell it back to the book store for a decent price?  Maybe, but I have never seen it happen.  My book store tried to give me $15 for the $130 book in perfect condition.

Just another comment on college books.  The book store on campus is there to rip you off, go somewhere else to buy your books.  Amazon is a good place to start looking.  Also, wait to buy books until after the first class meeting.  A lot of times the professor will tell you on the first day if the book that the book store told you was required, is actually required.

One other place I would like to point people looking to learn more about programming to is DreamInCode.  It's a forum community specifically for programmers.  They have a pretty large collection of tutorials and snippets in many languages, as well as a pretty active community.

Wednesday, February 23, 2011

blogPosts myBlog[] = new blogPosts[int.MaxValue];

Well figured I would try this blogging thing.  This blog will mostly be a place to post some tips on programming from my student experience.  Lets start out with some IDE's.

My school starts all CS students out with Java.  At first I was just using notepad++ and  compiling by command line.  If you are starting out in Java, I highly recommend NetBeans.  It's free, and works great for Java development as well as handling C and C++..  Another option is to use Eclipse.  I personally like NetBeans, but its always good to try everything and see what works the best for you.

If you are doing anything .NET based (C#, VB.NET, Visual C++) I would recommend using Visual Studio 2010.  If you are a student, sign up for a dreamspark account.  You can get VS2010 for free as well as a ton of other professional level Microsoft products.

Well, that's all I really have for tonight, happy programming!