Re: Windows Procedural Programming



Snooze wrote:

> I want to begin developing Windows applications, but I don't have any
> experience with OOP or Windows programming; only procedural programming.
> Is it possible to develop Windows applications using only a procedural
> programming language such as C or Pascal rather than an OOP language?

This question touches a wide variety of topics.

Firstly, by "windows application", you mean windows and buttons and such. If
so, the window will have an event handling function, where you provide
responses for inputs. This function _is_ Object Oriented, because each
window responds differently to the same kinds of inputs. That's the
_meaning_ of OO, where different behaviors hide behind the same interface.
But Win32 SDK is primitive and generic, so you must call _zillions_ of
functions to build this OO system.

Next, many OO languages provide libraries that wrap the Win32 SDK windows
and provide window objects. Those transfer the native Win32 polymorphism
into methods convenient for that language.

Next, the languages that have kept up with the Win32 SDK functions are
_typically_ the OO languages that have the most critical mass and
developers. Hence, even if you don't learn OO, you should learn Win32 using
a modern system, not one that forces you to _procedurally_ call all the
low-level Win32 SDK functions that _simulate_ polymorphism.

In summary, the best way to avoid learning OO the hard way is to get the
most advanced language possible, with a library that _minimizes_ exposure to
Win32. For example, if you download and install Ruby from ...

http://rubyforge.org/projects/rubyinstaller/

....it comes with a library called Tk which is very very easy to program. To
create a complete window with a button on it, all you need are these few
lines of code:

require 'tk'

TkButton.new(nil) {
text "Hello Ruby world!"
}.pack()

Tk.mainloop()

Those lines may look disconcerting. You may wonder what a mysterious
construction like "}.pack()" does. Learning Windows programming with this
simple language & system is much much easier than learning the raw Win32 SDK
that Tk so elegantly hides!

--
Phlip
http://www.c2.com/cgi/wiki?ZeekLand


.


Quantcast