views:

46

answers:

2

Background: Eldridge asked me to explain what the difference is between the difference phases of time when it comes to writing and deploying code.

He wants to know:

  • 1) what is the difference between: 1) design time; 2) compile time; 3) run-time?
  • 2) what are specific examples of things a programmer would not be able to hard-wire into his code and not know until run-time?
  • 3) are scripting languages with many run-time "tricks" better (other than personal preference reasons) for people who need more 'run-time' flexibility?

Question:

Although I have answers for Eldrige based on my own programming views, it seemed like a good idea to get different perspectives, so as not to give a "biased" answer. ... So, what unbiased answer can you give to explain these things (assuming whatever language[s]).

+2  A: 

Okay, since no one else has tried, I'll take a crack at this.

Design time is the time spent creating the source files. Code in text files, form definitions, etc.

Compile time is the time spent in the various phases of compilation. Preprocessing, lexing/parsing, AST creation and optimization, code generation, and linking.

Run time is the time spent from when the executable is loaded until the memory used for the text pages is freed.

A programmer can hardwire anything they like, but it makes little sense for some things:

  • User's home directoy
  • Location of external database resources
  • Expected hardware configuration of the machine running the executable
  • etc.

Both static and dynamic languages (I personally hate the description "scripting languages") have a place in computing. There is nothing a dynamic language can do that a static language can't; the only difference is in the amount of code it takes to implement the functionality.

Ignacio Vazquez-Abrams
Good answer, though I think "Design time" should be split into "Planning time" and "Development time". Planning time being the phase before writing code when you plan the architecture, API, and major features.
Pace
@Pace: You are fundamentally correct, but this is stackoverflow.com, not overbudget.com, so I kept my answer programming-oriented.
Ignacio Vazquez-Abrams
+1  A: 

Design-time - I would say is when you use automated tools and graphic designers to generate your source code. Stuff like valid values for a control's property can be determined at 'design-time'

Compile-Time - Is things that can be determined by the compiler at compile-time, e.g. the compiler can determine that the following expression will always contain the constant value of '86400'.

const int SecsInDay = 60 * 60 * 24; 

Run-Time - are for things that can only be determined while the program is running (e.g. by the VM). This includes any user input, dynamic configuration settings, etc.

Scripting languages are more flexible at creating mutating logic as it can by-pass compilation and create new behaviour based on input and logic at run-time, e.g. Java Script's eval() statement can execute any arbitrary javascript inputted by a user or returned via a webservice, etc.

mythz