44

Programmatically. (alt. programmically)

I've never used it, but I see it in questions a lot, i.e. "How to programmatically determine [insert task here]". Firefox immediately tells me that neither of these two words are real (at least, it doesn't recognize them). I've also never seen them used anywhere but here.

1) What does it mean to do/determine something "programmatically"?

2) Why do so many people ask how to do/determine something "programmatically"? Isn't it assumed that, if you're asking how to do something on a programming help board, you're asking how to do it "programmatically"?

3) Why is it that I've never seen the word "programmatically" anywhere else?

1
  • The reason SO users explicitly say "programmatically" is to reaffirm that they're asking "programming code" questions and not "IT-style" questions, which is something Jeff Atwood kind of complained about in one of the early SO podcasts.
    – willc2
    Feb 17, 2009 at 3:40

17 Answers 17

66

Doing something programatically generally means that you can do it using source code, rather than via direct user interaction or a macro.

For example, consider the problem of resizing columns to fit in Excel.

You could do it manually by double clicking between the columns, but that requires user interaction.

You could use the excel macro recorder, but that is fairly complicated.

Or, you could use VBA to write code that would do it.

I doubt it's actually in the dictionary.

3
  • 1
    Agreed. This is like when you ask about changing a file's attributes programmatically in Windows -- yeah, you can right-click on the file and go to Properties, but you can do it through code, too, which is the distinction given by the word.
    – Cloudy
    Feb 11, 2009 at 5:27
  • 2
    Hey, macros are code too, you know. +1 anyway.
    – paxdiablo
    Feb 11, 2009 at 5:33
  • 2
    I meant the old style Excel macros before they let you see the underlying VBA. Do you remember that thing? Hilarious.
    – Uri
    Feb 11, 2009 at 16:17
18

Programmatically is a real word. From another random dictionary: Compact OED online.

8
  • 9
    Call me old fashioned, but being in online dictionary X doesn't necessarily make something a real English word.
    – Chris Lutz
    Feb 11, 2009 at 5:30
  • 1
    Yeah, I use ask.com as my deity when it comes to defining words. Who needs the OED? I also bypass Brittanica in favor of Wikipedia. Pfft! :-)
    – paxdiablo
    Feb 11, 2009 at 5:32
  • 4
    Chris Lutz: how about an online dictionary from Oxford? askoxford.com/concise_oed/programmatic?view=uk Feb 11, 2009 at 5:47
  • 2
    Not to pile on, but it's in the built-in Dictionary on Mac OS. English is a living language 8)
    – willc2
    Feb 17, 2009 at 3:33
  • 11
    @chris lutz - you're old fashioned. nowadays, being in printed dictionary X just confirms that the word was in the language at the time the book was printed. the fact that the word EXISTS and that it has a generally agreed upon usage and definition means that it is, in fact, a word. as willc2 said, english (along with every spoken language) is alive and constantly adapting.
    – Jason
    Apr 21, 2010 at 22:52
9

In .NET, "programmatically" generally means doing something in code rather than in a template, markup, configuration, or xml.

For instance, in an ASP.NET page you can add a textbox in the ASPX markup:

<asp:TextBox runat="server" />

Or you can add the control programmatically in the ASPX.cs codebehind:

this.Controls.Add(new TextBox());

Similarly, you can change configuration manually by editing the xml in the App.config file, or you can write code that will modify the configuration programmatically.

6

http://www.merriam-webster.com/dictionary/programmatically

"Programatically" is an adverb. It is descriptive of the verb. In this case, it means that something will be done by a program and not by a manual, human operation.

5
  1. To execute code that does it. Previously having written the code is implied.
  2. Probably in most cases it's something that's relatively easy for a human to do, with the challenge being automating it. The assumption you describe may or may not apply.
  3. I have no idea. I've seen it many times and in many circumstances. Incidentally, I categorically deny the idea that a word has to be on somebody's list somewhere to be a 'real word', especially when it's a clear construction from well-known roots, as in the case of 'programmatically'.
2

1) What does it mean to do/determine something "programmatically"?

I assume from your second question that the answer to this is already known to you ;) .*

2) Why do so many people ask how to do/determine something "programmatically"? Isn't it assumed that, if you're asking how to do something on a programming help board, you're asking how to do it "programmatically"?

Yes, but no harm comes from using the word!

3) Why is it that I've never seen the word "programmatically" anywhere else?

You're not looking hard enough! http://www.google.com/search?q=programmatically

1
  1. To accomplish it with a program / in code. Example: eating a sandwich programmaticly would mean you write a program that eats a sandwich.
  2. I agree.
1

I think people (myself included) use the term 'programmatically' to refer to a function performed in source code (eg C#), as distinct from something done declaratively(eg XAML).

1
  1. doing something programmatically is doing something by executing program code
  2. do not ASSUME. It makes an A** of U and ME :) the thing is, many people can ask questions that are not programming-related (e.g. "how do i overwrite a read-only file in linux?")
  3. Usually it is clear by the context if things are done programmatically or not. Therefore the word is often redundant and not used. In here, people want to make sure they are understood, and their question is not answered in a wrong way ("how do i programmatically overwrite a read-only file in linux?" will provoke a different kind of answer than the one in 2.)
1

The way I use "programatically" or sometimes "proceedurally" is best described using the following code:

int[] arr = new int[] { 1, 2, 3, 4, 5 };

to do the same thing programatically would be:

int[] arr = new int[5];
for (int i = 1; i < 6; i++)
  arr[i] = i + 1;

Now while a very limited example, what would you rather type if the array was hundreds or thousands of elements. In real-world situations, there are usually pros and cons as to which is best to use at a time, but for complicated operations, generally things are more efficient if they're done "programatically".

Perhaps a better example of this is the value of alt Pi. You could simply input the number 3.141592653589793238, but it would be very difficult to type it in if you needed alt Pi it accurate to 100 decimal places. You would instead use a function, perhaps something like alt function.

** Reference wikipedia http://en.wikipedia.org/wiki/Pi*

1
  • It depends on how "efficiency" is measured. For example, if you chisel a big array in code instead of filling it programmatically, it is immediately available and does not have to be created first.
    – foraidt
    Feb 11, 2009 at 9:02
1

In the case of iPhone development, programatically basically means not using Interface Builder.

0

As others have said, it means asking for a solution for a particular problem in the form of code. This is particularly relevant in the modern era where GUIs are everywhere and operating systems are big, sprawling things with innumerable functions. It may be incredibly easy to find out a particular piece of information or perform a certain action manually as a human but how to do so as code is less obvious and requires research.

For example, consider how to delete a file and move it to the recycle bin in windows. Manually, this is trivial, select the file in explorer and hit delete. Or drag the file to the recycle bin. In code it's not remotely intuitive how you perform this action.

0

Developers usually try to state the question as precisely as possible. They try to state the environment, the language, whatever else they already know. The more precise is the question the more precise hopefully is the answer. But when they can't state anything (like they just want to know if there is an API call to do something) they just ask how to do it programmatically.

0

I mostly use the word in the context davogenes and ash explain it.

However I'd like to add that in this case, a synonym would be "dynamically" because you can add control elements at run-time and not already at design-time.

0

For me its the difference between working in the designer or in code (runtime).

You can do a lots of things in designmode, set a datasource to a datagrid and layout the columns and set colors and a lot of other things without do a single line of code. If I want to know how to do it in code instead of setting it in the design mode I would ask how to do it "programatically".

My 5 cents.

Not the answer you're looking for? Browse other questions tagged or ask your own question.