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, http://flycoder.blogspot.com.

* 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 http://flycoder.blogspot.com, I am putting your link on my site! http://codejustin.com"