# I want to write myself a simple program in Windows

**URL:** <https://boards.straightdope.com/t/i-want-to-write-myself-a-simple-program-in-windows/523884>\
**Category:** In My Humble Opinion\
**Created:** [January 6, 2010, 11:00am UTC](https://boards.straightdope.com/t/i-want-to-write-myself-a-simple-program-in-windows/523884 "2010-01-06T11:00:12Z")\
**Posts on this page:** 9\
**Page:** 2

<div class="post-metadata">

**Author:** ![Ruminator](https://avatars.discourse-cdn.com/v4/letter/r/b9bd4f/32.png) [@Ruminator](https://boards.straightdope.com/u/Ruminator)\
**Post date:** [January 10, 2010, 4:56pm UTC](https://boards.straightdope.com/t/i-want-to-write-myself-a-simple-program-in-windows/523884/21 "2010-01-10T16:56:09Z")

</div>

> [@Napier](#):
>
> What I am really saying doesn’t exist is a programming environment that can deliver something executable in Windows, and that is simple enough that the problems of devising and specifying an algorithm to solve a problem are the primary things the programmer will work on.

But the ability to program your own algorithms wasn’t exactly true during the monochrome 1980s MSDOS days either. To make EXEs, you had to buy a compiler… either MS Quick Basic, MS Quick C or Professional C, or Borland Turbo Pascal, etc. The only thing “free” was BAT files or running DEBUG at the command line and entering assembly instructions by hand.

> [@](#):
>
> You’re not going to find CD’s crammed with hundreds of tiny Windows programs for calculating obscure numerical things, the way various professionals and hobbyists did under DOS in the '80s.

The idea of tiny programs is still there but it’s just in a different form: thousands of websites with javascript. There are websites to calculate the capacity of DVDs, or mortgage amortization, astronomy, etc. The paradigm of distribution has simply shifted. Instead of CDs or floppies, it’s personal websites with javascript.

> [@](#):
>
> I happen to often use SAS (a statistics system with a pretty complete language) for this kind of thing, because I learned it so well more than 20 years ago, but I can only use those solutions on a box with an active SAS license, and I practically cannot share my solutions with people here who don’t happen to use that particular environment.

The free alternative to SAS is [R Statistics](http://en.wikipedia.org/wiki/R_(programming_language)).

> [@](#):
>
> The idea that you would sit down at the kitchen table with a Z-90 driven CPM machine, which has a version of BASIC in ROM, and figure out how to make a map of what the distance and bearing angle is to all the world’s cities, because you’re a HAM operator and want the result for yourself - that idea seems to be gone.

I think javascript fulfills this type of hobby problem solving very easily. With Windows 7, another free scripting environment builtin is [PowerShell](http://en.wikipedia.org/wiki/Powershell).

---

<div class="post-metadata">

**Author:** ![beowulff](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/beowulff/32/542_2.png) [@beowulff](https://boards.straightdope.com/u/beowulff)\
**Post date:** [January 10, 2010, 5:20pm UTC](https://boards.straightdope.com/t/i-want-to-write-myself-a-simple-program-in-windows/523884/22 "2010-01-10T17:20:38Z")

</div>

It’s not free, but: [RealBasic](http://www.realsoftware.com/realbasic/).

It’s an awesome rapid-prototyping or one-off tool, and it can create cross-platform (OS X, Linux, Windoze) applications.

Of course, OS X has a very full-featured development system available for free - [Xcode](http://developer.apple.com/tools/xcode/), and command-line compliers built-in. But, this probably doesn’t help with your Windows issue.

---

<div class="post-metadata">

**Author:** ![Napier](https://avatars.discourse-cdn.com/v4/letter/n/ce73a5/32.png) [@Napier](https://boards.straightdope.com/u/Napier)\
**Post date:** [January 10, 2010, 7:51pm UTC](https://boards.straightdope.com/t/i-want-to-write-myself-a-simple-program-in-windows/523884/23 "2010-01-10T19:51:19Z")

</div>

> [@Ruminator](#):
>
> But the ability to program your own algorithms wasn’t exactly true during the monochrome 1980s MSDOS days either. To make EXEs, you had to buy a compiler… either MS Quick Basic, MS Quick C or Professional C, or Borland Turbo Pascal, etc. The only thing “free” was BAT files or running DEBUG at the command line and entering assembly instructions by hand.

This is confusing two points. It is one thing to have to pay for something like Quick C to be able to write programs. It is another for anyone who wants to use your program to also have to pay for a special environment that can run it, or for you to have to pay for such a special environment for each of your dozen miscellaneous computers on which you might want to run it (if it’s licensed per box). The difference is practically the difference between being able to write for “Windows” as opposed to being able to write for users of a specific package.

---

<div class="post-metadata">

**Author:** ![Napier](https://avatars.discourse-cdn.com/v4/letter/n/ce73a5/32.png) [@Napier](https://boards.straightdope.com/u/Napier)\
**Post date:** [January 10, 2010, 7:54pm UTC](https://boards.straightdope.com/t/i-want-to-write-myself-a-simple-program-in-windows/523884/24 "2010-01-10T19:54:56Z")

</div>

> [@Ruminator](#):
>
> […]The idea of tiny programs is still there but it’s just in a different form: thousands of websites with javascript. There are websites to calculate the capacity of DVDs, or mortgage amortization, astronomy, etc. The paradigm of distribution has simply shifted. Instead of CDs or floppies, it’s personal websites with javascript.  
> […]  
> I think javascript fulfills this type of hobby problem solving very easily. With Windows 7, another free scripting environment builtin is [PowerShell](http://en.wikipedia.org/wiki/Powershell).

OK, at this point I am thinking I’m wrong, and I need to learn about javascript (and perhaps others). I hope this has been relevant to the OP and not a derailment, but, folks certainly seem to be understanding what I meant but pointing out counterexamples. Thanks!

---

<div class="post-metadata">

**Author:** ![Napier](https://avatars.discourse-cdn.com/v4/letter/n/ce73a5/32.png) [@Napier](https://boards.straightdope.com/u/Napier)\
**Post date:** [January 10, 2010, 7:59pm UTC](https://boards.straightdope.com/t/i-want-to-write-myself-a-simple-program-in-windows/523884/25 "2010-01-10T19:59:11Z")

</div>

> [@Athena](#):
>
> Just to demonstrate how easy this is to do in HTML & Javascript, here’s an example of various math operations done one a couple user-input variables. Copy & paste it to your favorite text editor, save as an .html file, and open in your browser. No downloads, compilers, dev environments or anything needed, beyond a text editor.

So it is. Athena, you’ve taught me something useful. This might have been my most productive moment all week.

Thanks, everybody!

---

<div class="post-metadata">

**Author:** ![Athena](https://avatars.discourse-cdn.com/v4/letter/a/35a633/32.png) [@Athena](https://boards.straightdope.com/u/Athena)\
**Post date:** [January 10, 2010, 8:52pm UTC](https://boards.straightdope.com/t/i-want-to-write-myself-a-simple-program-in-windows/523884/26 "2010-01-10T20:52:04Z")

</div>

> [@Napier](#):
>
> So it is. Athena, you’ve taught me something useful. This might have been my most productive moment all week.
> 
> Thanks, everybody!

Well shucks… and here I was thinking that posting code was far too geekish for this thread!

[QUOTE=Napier]  
This is confusing two points. It is one thing to have to pay for something like Quick C to be able to write programs. It is another for anyone who wants to use your program to also have to pay for a special environment that can run it, or for you to have to pay for such a special environment for each of your dozen miscellaneous computers on which you might want to run it (if it’s licensed per box). The difference is practically the difference between being able to write for “Windows” as opposed to being able to write for users of a specific package.  
[/QUOTE]

Nope, that’s not the case for just about every programming environment out there. If you have to pay for them, you only pay for the development environment, not the runtime environment. That’s almost universally something you give away free, or, in the case of most Windows-based Microsoft tools, built into the OS.

EXE files sometimes can be run without anything else. Most often nowadays for Windows at least, they need a few extra .dll files. The most common ones come with newer Windows versions; older versions may require a download, but it’s a free download, and once you have them, you don’t need to re-download them every time you get a new file that needs them.

I’ve never seen a dev environment except maybe VERY specialized ones that require a license just to run a program written for them.

**Napier** , reading between the lines, I think some of the reason you’re a bit confused about the newer programming languages/environments is the bit shift from procedural programming to event-driven and OO programming that happened about 15 years ago.

Procedural programming is what you’re used to. You type out a program, and when you execute it, it starts at the first line (or the first line of the “main” function) and goes from there.

Nowadays, things are almost universally event-driven. Meaning, code reacts to user events. Programs are built around objects - like a window can be an object. You can tell the program to do something when the window is first displayed, or when a user presses a button, or moves a scroll bar.

It’s a different way of thinking, but it’s not particularly harder once you get your head around it. But it’s definitely confusing at first.

(and for all you techies - this post is definitely a very general post. Yes, I’m sure you can find a dozen things that you can take exception to or make a point about. I’m just talking in generalities, not trying to explain the whole programming world right now in this thread.)

---

<div class="post-metadata">

**Author:** ![UncleRojelio](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/unclerojelio/32/3160_2.png) [@UncleRojelio](https://boards.straightdope.com/u/UncleRojelio)\
**Post date:** [January 10, 2010, 9:05pm UTC](https://boards.straightdope.com/t/i-want-to-write-myself-a-simple-program-in-windows/523884/27 "2010-01-10T21:05:05Z")

</div>

Just for completeness, if you are thinking of going the browser route, try [PHP](http://php.net/index.php).

[QUOTE=Beowolf]  
Of course, OS X has a very full-featured development system available for free - Xcode, and command-line compliers built-in. But, this probably doesn’t help with your Windows issue.  
[/QUOTE]  
Also for completeness, AppleScript is a fantastic way to write quick, one-off apps.

---

<div class="post-metadata">

**Author:** ![Recliner](https://avatars.discourse-cdn.com/v4/letter/r/a88e57/32.png) [@Recliner](https://boards.straightdope.com/u/Recliner)\
**Post date:** [January 11, 2010, 12:53am UTC](https://boards.straightdope.com/t/i-want-to-write-myself-a-simple-program-in-windows/523884/28 "2010-01-11T00:53:33Z")

</div>

> [@Athena](#):
>
> Really? MS has its issues, definitely, but its developer tools have always been top-notch. Even the die-hard Linux junkies I know have high opinions of Visual Studio.

Definitely going to second this. I’ve used a ton of IDEs (integrated development environments), and Visual Studio is simply the best out there. As stated above, Microsoft currently makes C# (and a number of others) available in free versions, which, while not tiny in size, aren’t likely to fill up your drive.

For something quick-and-dirty, the aforementioned Javascript method is quite workable, but its going to require you to learn both JS and some HTML (in order to create a front-end).

I’m a huge fan of Flash, especially for quickie things, but its not for everyone. However, the ability to “draw” out a UI and then use Actionscript (very similar to Javascript) makes it something of an all-in-one for Web-based applications.

---

<div class="post-metadata">

**Author:** ![Napier](https://avatars.discourse-cdn.com/v4/letter/n/ce73a5/32.png) [@Napier](https://boards.straightdope.com/u/Napier)\
**Post date:** [January 11, 2010, 5:20pm UTC](https://boards.straightdope.com/t/i-want-to-write-myself-a-simple-program-in-windows/523884/29 "2010-01-11T17:20:38Z")

</div>

> [@Athena](#):
>
> Nope, that’s not the case for just about every programming environment out there. If you have to pay for them, you only pay for the development environment, not the runtime environment. That’s almost universally something you give away free, or, in the case of most Windows-based Microsoft tools, built into the OS.
> 
> […]
> 
> I’ve never seen a dev environment except maybe VERY specialized ones that require a license just to run a program written for them.
> 
> **Napier** , reading between the lines, I think some of the reason you’re a bit confused about the newer programming languages/environments is the bit shift from procedural programming to event-driven and OO programming that happened about 15 years ago.

About paying for the runtime - I mean, if I write a program in SAS, or Mathematica, or FlexPDE, you have to have the application to run my program. These don’t compile to executables. Even environments like LabVIEW that now give away the runtime for free haven’t made any promises that the runtime will always be free. The environments I am describing might more often be thought of as applications than as programming environments, but they are still used entirely by writing programs. Even writing mathematically oriented things in C#, I found it expedient to buy the IMSL numerical library for things like its iterative solver, but then have to deal with licensing issues to distribute what I wrote.

I did do, by the way, the step from procedural to OO with C# (and a little Java and C++). And to event-driven with C# and, if you include it as programming, LabVIEW. About C#, I do have to say the OO approach seems very smart. But it is smart in a logical sort of way, which is clear when you read examples about a shopping cart on a web site being an object. All the time with the shopping carts. For programs where the math is a bigger deal than the logic of the interface, such as in the extreme a program that reads a file of numbers and generates another file with numbers, with a user interface that has a single button labeled “Run”, it doesn’t seem like OO necessarily matters.

[Previous page](https://boards.straightdope.com/t/i-want-to-write-myself-a-simple-program-in-windows/523884.md?page=1)
