StackOverflow is a website where people ask questions about programming.

Obviously every question is about programming, and not cooking.

Why do people put the word 'programmatically' in question titles, then?

This might seem like a silly point, but it really gets on my nerves seeing that word.

  • 17
    "Obviously every question is about programming, and not cooking." Oh how I wish that assumption was true. – gnostradamus Apr 5 '10 at 17:10
  • 1
    What upsets you from that word? the redundancy or the fact it doesn't exists( FF underlines it every time I write it :P ) ? English is not my first language and probably that's why it is "transparent" for me and I don't see what's wrong with it. – OscarRyz Apr 5 '10 at 19:45
  • 2
    Wow. just wow. Because there is a difference between doing something manually and doing the same thing programmatically. I say move this question to SO and see what happens. I am guessing that OP is not a programmer. – Sky Sanders Apr 5 '10 at 20:01
  • Maybe you could write a greasemonkey script that programmatically removes that word from every SO page you visit ;-) – Andy E Apr 5 '10 at 23:53
  • 4
    You raise an interesting tangential question: Where should I ask programmatic cooking questions? (If I crack an egg onto my CPU, will it cook more evenly calculating the trillionth digit of pi, or by using a simple while (true) {}? Or should I just give up & cook it the way god intended, on my graphics card while playing video games?) – Alconja Apr 6 '10 at 0:59
  • Actually it's an interesting point. We've appropriated the word "programmatically" to mean "via code" (as opposed to some kind of Interface Builder or doing it manually or something), but that's not actually an accepted use of the word in English. – Dan Rosenstark Feb 3 '15 at 19:13

Programmatically speaking, because they don't realize it is superfluous.
The questions on SO implicitly inherit that property :)

On the other hand, "non programmatically" should explicitly be mentioned.

  • 8
    On the other hand, "non programmatically" should explicitly be not asked. – perbert Apr 5 '10 at 17:57
  • @json, well, they've been asked and will be asked again and again. – Nick Dandoulakis Apr 5 '10 at 18:12
  • And they'll get closed again and again. – perbert Apr 5 '10 at 18:19
  • goto @json; // I know, "Go To considered harmful" – Nick Dandoulakis Apr 5 '10 at 18:29

Q. How can I tell if there is paper in the printer?

A. Open the tray and look inside.

Q. No, how can I tell in a program. You know, programatically?

A. Oh, why didn't you say? No idea. Sorry.

  • 5
    That's a silly question... you print a test page and see if the printer comes back with a NO_PAPER_IN_TRAY error/exception. – Tyler Carter Apr 5 '10 at 16:51
  • 15
    That's not a very green solution. Also, what happens if doing that made you print the last page? – MPelletier Apr 5 '10 at 16:53
  • 13
    @MPelletier: Edge case, can be ignored until v1.1, which you can charge for. – Phoshi Apr 5 '10 at 17:02
  • 3
    @Phoshi: I like your business acumen, but for the programming side of it, that testing for a condition which is arguably undesired brings you closer to that condition, just doesn't satisfy me. – MPelletier Apr 5 '10 at 17:14
  • 4
    @MPelletier: No different from testing for how much free RAM you have - you'll have to store the result somewhere! Admittedly it's a little worse than that, but still! – Phoshi Apr 5 '10 at 17:22
  • 1
    @MPelletier, we can answer this not programmatically, but physically: that's due to Schroedinger principle. – P Shved Apr 5 '10 at 17:33
  • 8
    @Pavel, I guess you are talking about Schrödinger's umlaut, which simultaneously does and doesn't exist until somebody writes his name. – perbert Apr 5 '10 at 18:01
  • @MPelletier What is green? I only know Black, White, and the shades in between.... – Tyler Carter Apr 5 '10 at 18:11
  • @Phoshi: You're right, testing how much free RAM would use up RAM. But that would at least be freed, eventually. Still maddening that the answer can be tacked with "... and now you have even less!" – MPelletier Apr 5 '10 at 18:14
  • @Chacha102: Green is the new grey. Sometimes. – MPelletier Apr 5 '10 at 18:15
  • Congrats on the gold badge with only 300 rep. That's rare, dude. Or Dudette... dunno. Whatever. – Randolpho Apr 6 '10 at 14:16
  • 3
    @MPelletier Actually it is a very green solution. Young fast growing trees remove the most carbon from the atmosphere. We cut them down and make paper which we use to print test pages and then throw away (do not recycle) so even more young fast growing trees will remove even more carbon from the atmosphere. Lather, rinse, repeat. This is how to solve global warming programatically. – Donald Byrd Apr 12 '10 at 18:13


Q: How do I shut down Windows programtically?

A: Just use ExitWindowsEx.

Q: How do I shut down Windows?

A: (moved to SuperUser)

  • 4
    +1 for the punchline :) – Pëkka Apr 5 '10 at 17:22

"Programmatically" can make things a lot more complicated.

Q: How to change xyz.ini so that the flibber gorgles at a maximum of 50kbps?

A: Change gorgle_kbps to 50.

Q: How to change xyz.ini so that the flibber gorgles at a maximum of 50kbps programmatically?

A: Good question! Hmm. You would have to find out which xyz.ini the service is using, make sure your program has read and write rights on it, make sure your program has the rights to stop the service, quit with a meaningful message if it doesn't (don't forget logging!), stop the service, parse the file, locate the gorgle_kbps setting (maybe using a number of regular expressions, or by splitting the whole file into its options, taking into account comment lines), change the value, write it back, and then somehow restart the service. For that, you will need root privileges if you're on xöczyk 2.5. It's not possible at all in zargx > 3.5 because processes can't access the ini file at all there .... etc. etc.

  • 9
    +1, I've always wondered how I could limit the gorgle rate – Phoshi Apr 5 '10 at 17:03
  • 1
    @Phoshi, that's easy. Just change gorgle_kbps to the limit you want :-) – Nathan Fellman Jun 17 '10 at 9:52

There is a difference between "programmatically" and "declaritively", and both fall under the "programming" umbrella, so it's best to state which explicitly. Case in point: here are two things that do the same thing. One does so programmatically in C#, the other does so declaritively in XAML.


<StackPanel Height="30" HorizontalAlignment="Center" VerticalAlignment="Center">
    <Button Margin="3" VerticalAlignment="Center" Click="button_Click">Go</Button>


var panel = new StackPanel();
panel.HorizontalAlignment = HorizontalAlignment.Center;
panel.VerticalAlignment = VerticalAlignment.Center;
panel.Height = 30.0;
var button = new Button();
button.Margin = new Thickness(3.0);
button.VerticalAlignment = VerticalAlignment.Center;
button.Click += new RoutedEventHandler(button_Click);
var buttonContent = new TextBlock();
buttonContent.Text = "Go";
button.Content = buttonContent;

Stuff like this is why stating "programmatically" can be important.


Trust me, I feel for you. It irritates me too, but it is very often unavoidable.

The point is, though, that many problems can be fixed not-programmatically. If you need to sort a list, there are dozens of sorting algorithms, or you could suggest putting it in Excel and using its sort function.

A lot of problems can have many solutions, and often (though not as ridiculous as my example), an elegant solution can be to not write new code, but to use something that already exists. And sometimes, in apprehension of such answers ("Yes, but FooBarSoft alreary does that so well"), posters feel obliged to add "programmatically", however irksome it might be.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .