Saturday, May 23, 2009

IDE's, Please...

When I got my internship for the summer, I began using Microsoft's Visual Studio pretty heavily. Before this I had had some experience with Dev-C++, but mostly I had just dealt with Eclipse. I found Eclipse to be useful, but it was a little hard to learn. Of course, it is open source, which makes it attractive to many programmers. I hear a rumor Visual Studio may also become open source, and will be available on Linux; I don't know where to even begin there. IDE's can be of great help, I know that I use VS for debugging, finding references, going to definitions, and the good ol' Intellisense every day. Basically, if you are working on a large project, an IDE is a must. I've posted some links below on some forum conversations about IDE's, feel free to take a look.



Friday, May 15, 2009

Programming, or Just Hacking?

The business world can be a rough place for a developer. It seems client demands, under-staffing, and deadlines can make the most elegant and clean programmer a little dirty. Or a lot dirty.

While the simplest solution is often the best, their is a big line between doing something the simple, inventive way and programming a shoddy hack that will probably cause crashes later. Modularity is a wonderful thing, but often you don't have the time to make a nice friendly interface or too because you are assigned four things at once and you have to get them done and wrapped into the new version of your software. You always have to evaluate how much time you are saving in the short run, and how much time you are losing in the long run. Two weeks of development followed by months or arduous support debugging is quite the nightmare. Often you also have to think ahead of your employer, odds are they will want functionality in your software that it may or may not be designed for. Modularity can greatly aid when adding plugins.

The question after you have to ask before you start coding your solution is: AM I A PROGRAMMER, OR A HACKER? WELL ARE YA PUNK???

Saturday, May 9, 2009

pass the variable, please

One property that has tremendous bearing on any programming language is how variables are passed. There are generally two methods, passing by reference and passing by value.

Passing by reference takes the memory location of the variable or pointer and passes that into the function that takes the parameter. In short, this means that any work or changes done to the object or primitive is changed for good.

The other method is passing by value. This copies the reference to the object or variable and passes it in to the function. This allows for manipulation with the data from the variable or object without changing the actual contents of the data.

Both of these methods are valuable, and in my opinion the languages that can do both (like C#) are especially useful. In fact, this is one of the differences between Java and C#, Java only passes by value, C# allows passing by reference (through the ref keyword.) Without being able to pass by reference, Java becomes a more strongly-typed langauge, you have to go further to manipulate actual data. However, this also makes a simple program like swapping two string variables inordinately complicated compared to languages that pass by reference.

Knowing which technique the language you are using implements is of primary importance, failure to recognize whether a language passes by reference or by value will cause hours of frustration in seemingly inexplicable errors and unexpected return values.

Saturday, May 2, 2009

Scripting Languages

One enigmatic question that I find people often have a hard time giving a straight answer to is "What is the difference between a 'normal' programming language, such as C++, and a scripting language." This question leads to a lot of backpedalling and out spews a lot of general non-specific answers.

The term 'Scripting Language' refers to one of two different things. The specific definition refers to a programming language that controls software. An example of this would be QuakeC, which allows writing scripts for the popular fps game, Quake. Another example would be ASP, which works on the server side to dynamically generate web pages.

The generic term 'Scripting Language' refers to any language, whether used for specific applications or for general purposes, which is interpreted instead of compiled. An example of this general definition would be Python or Ruby.

"Aaah, now I get it." But what exactly is the difference between a language being compiled and a language being interpreted. An interpreted language is one that instead of compiled, is 'interpreted' and run at the same time. Essentially an interpreter is a dynamic compiler. it interprets each line of code in your program into machine code and then runs it at the moment. This contrasts to a language that must be compiled into machine code all at once and then run.

While an interpreted language runs slower, the syntax is often more powerful, interpreted languages allow for things such as implicit typing, which means you don't have to declare the types of your variables, and that you can change them on the fly. Programs or 'Scripts' often take a lot less time to write then if they were written in an a compiled language.

As a last note, I prefer the stricter definition of "Scripting Language", and generally so do programmers who use languages such as Python. If you have any expert knowledge of interpreted languages, please share below.

Friday, May 1, 2009

Answering Justin's Questions

This is a comment I put on a post at Justin's blog.

"This should be interesting, since this week was my first week as a programming intern.

* What do you do on a daily basis at your programming job?

Right now I am training a lot. There are several programs and over 250,000 lines of code that I shall be working to some extent with. The programs I need to know pretty well, the code only in sections (since it is just a summer internship.) Expect to spend months training and catching up on the project when you first get hired.

* How much time do you spend programming?

As a programmer you work with code constantly.

* What other tasks do you do besides programming?

You may also have to work with GUI components, more along the lines of graphic artist stuff, you also may have to take support calls.

* How long is your lunch break?

I eat at my desk, no one really bothers you, generally you have about an hour.

* Do people socialize or does everyone keep to themselves?

You chat throughout the day, only in short intervals tho, or at meetings, obviously you are there to work on your assigned tasks, not to socialize.

* How many people do you work with?

There is one guy who is training me who I guess I work with. There are several guys who have also trained with and are near my cubicle. I would say around 8 different people are working on different areas of the project I have a part of.

* What kind of development are you in (web, software, games, ect…)?

Meteorological software.

* What programming languages do you use the most?

Python scripting and C#.

* How long have you been programming?

about 3 years, but I have spent a lot of hours in those three years on it.

* Do you have sword fights while your code is compiling?

for 250,000 lines of code it compiles like running a program.

* Do you get to take breaks when you’re frustrated with code?

Yeah, you can switch to something else. Realistically people take smoke breaks every hour so if you need to you can take a walk or something, obviously you can't just veg out the whole day. There are other programmers you can bring in if you need to ask a question.

* Does your boss respect your job?

Yeah, generally management will never let you get as much time as you want or make the code clean the way you want it. Often you might feel frustrated because you have to hack something together instead of doing it the right way.

* Do you ever wish you were somewhere else?

I enjoy it a lot. Eight hours is a long time to be staring at a screen, tho. Still, if it is easy to focus on the project and the work.

* How much time do you spend surfing the web?

at work, a few minutes at lunch. A lot outside of work, mostly because of my blog,

* Is programming just like you thought it would be like before you started working in the field?

Yeah, I was a little naive about how much management wants to push the timetable and hack something together instead of writing something that is more stable and will be easier to modify.
Essentially, non-programmers generally are asking for things that may or may not be reasonable, and compromises have to be made on both sides.

Hope this helped, visit my blog at, I am putting your link on my site!"