Re: In regards to my giving up on programming?

  • From: Dave <davidct1209@xxxxxxxxx>
  • To: programmingblind@xxxxxxxxxxxxx
  • Date: Fri, 2 Jul 2010 21:07:15 -0700

It's really a chicken and egg problem; on one hand, you want to learn
something meaningful such as how the very complex way Windows renders
on-screen widgets works.  On the other hand, you need to learn the
basics of programming.

Imo, win32 isn't difficult if you take things one step at a time;
instead of having

...
int main (void) {
  return 0;
}

you have something like:

WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
               LPSTR lpCmdLine, int nCmdShow)
{
// ... setup windows class (WNDCLASSEX) structure and show the window ...
// Message loop
    MSG msg;
    while (GetMessage(&msg, NULL, 0, 0))
    {
        TranslateMessage(&msg);
        DispatchMessage(&msg);
    }

    return (int) msg.wParam;
}

And a Windows callback procedure:

LRESULT CALLBACK WndProcedure(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
{
    switch(Msg)
    {
    case WM_DESTROY:
        PostQuitMessage(WM_QUIT);
        break;
    default:
        return DefWindowProc(hWnd, Msg, wParam, lParam);
    }
    return 0;
}


As a beginner, you won't and shouldn't expect to understand any of
this, but I could easily explain at a high level what's occuring here.
 It also has the benefit of motivating you to learn what each little
segment of the program means with the end-goal always in mind.  (yes,
including pointers, struct's, functional pointers, and even message
passing).

The problem with winforms and even MFC is that it "hides" and
abstracts away almost all of this and does it on your behalf.  That's
fine as long as nothing goes wrong, which is rare if you write
software for any amount of time.  I'd be the first to advise you to
hit the basic programming books, but don't think that you can't start
reading into the topics that you're really interested in.

- David

On 7/2/10, Tyler Littlefield <tyler@xxxxxxxxxxxxx> wrote:
> Um, I hate to rain on your parade, but you need to understand c/c++ before
> you just dive in and start writing windows apps. Win32 isn't no walk in the
> park. Lots of pointers, structs and all sorts of weird things that you don't
> just teach yourself very easily.
>               Thanks,
> Tyler Littlefield
>       http://tds-solutions.net
>       Twitter: sorressean
>
> On Jul 2, 2010, at 7:10 PM, Dave wrote:
>
>> Hi Jes,
>>
>> I don't think many folks really build genuine Windows app's anymore.
>> The simple fact of it is that UI code is not very interesting once you
>> have seen it and understand it.  That's why Microsoft built .Net to
>> handle much of what programmers had to do before.  If you want to get
>> down into the guts of how Windows app's work, you should not be
>> looking at introductory C++ books, but instead at Windows programming
>> books.  In fact, "Windows Programming" by Charles Petzold is probably
>> the de-facto book on windows programming via win32.  Win32 (which is
>> in C of all things) is the foundation of much of what you use today in
>> Microsoft Windows (proper).  Winforms (.Net), MFC (C++), COM, and
>> related Windows-centric technologies all eventually call down to win32
>> and the wnd-proc message loop system.
>>
>> Hth,
>> David
>>
>> On 7/2/10, Joseph Lee <joseph.lee22590@xxxxxxxxx> wrote:
>>> Hi,
>>> I see your point.
>>> A bit of history...
>>> In the old days, people used to communicate with a computer via command
>>> line
>>> interface, or CLI. As the name suggests, this means reading what's
>>> displayed
>>> on screen (the text) and typing text commands for input. Later for
>>> simplicity and for user friendliness, people switched to GUI or Graphical
>>> User Inteface. Although it may seem easy now to write programs from
>>> user's
>>> perspective, it became harder for programmers, especially when it comes
>>> to
>>> controls and text formatting and other graphical stuff.
>>> The console method is here in order to teach how a program would actually
>>> look like, in my opinion. Then after getting used to it, you'll be ready
>>> to
>>> move onto graphics things with basics in mind.
>>> C++ language is not only used to write Windows programs. It is used
>>> virtually in almost all operating systems and computer systems - from
>>> writing tiny test programs to even writing part of a program that manages
>>> this list. Even many operating systems (not all of them) such as part of
>>> Windows, was written in C++.
>>> Hope this helps.
>>> Cheers,
>>> Joseph
>>>
>>> -----Original Message-----
>>> From: programmingblind-bounce@xxxxxxxxxxxxx
>>> [mailto:programmingblind-bounce@xxxxxxxxxxxxx] On Behalf Of Jes
>>> Sent: Friday, July 02, 2010 4:49 PM
>>> To: programmingblind@xxxxxxxxxxxxx
>>> Cc: blindprogramming@xxxxxxxxxxxxx
>>> Subject: In regards to my giving up on programming?
>>>
>>> Ken wrote:
>>> "You can get up and running much faster on a language like, python, or  c
>>> and
>>> actually see results.  Results is what matters when you start out
>>> coding"...
>>>
>>> I couldn't agree more with that. The IDE is a lazy man's way to begin to
>>> program. To me, any text book or college material which gives you a
>>> prepackaged formula, claiming to teach you something isn't really doing
>>> you
>>> any good and shouldn't even be used by the college. As an example, the
>>> book
>>> I am using is "An Introduction to Programming with C plus plus, by Diane
>>> Zak." Thank goodness they used programming, not coding. They only show
>>> you
>>> the code you need to copy and paste into your IDE, which, in this case,
>>> is
>>> Visual Studio. I like the way the book introduces new concepts of the C
>>> plus
>>> plus language to you, but they fail to really get down into the dirt with
>>> all of it. For example, they tell you what an algorithm is, and they tell
>>> you the various procedures to start writing a program; 1, analyzing a
>>> problem, 2, planning an algorithm, 3, desk-checking your algorithm, etc.
>>> Basically, it just feels like I'm copying and pasting in a bunch of code,
>>> into an IDE so I can pass a course. Furthermore, when we finally have no
>>> errors in the code, the .exe opens up in a command prompt. They don't
>>> even
>>> help us build real genuine Windows apps, it's all console applications.
>>> I've
>>> always associated C plus plus with genuine Windows gui application
>>> development. What's wrong with this picture?
>>> Jes, the proud man.
>>>
>>> __________
>>> View the list's information and change your settings at
>>> //www.freelists.org/list/programmingblind
>>>
>>> No virus found in this incoming message.
>>> Checked by AVG - www.avg.com
>>> Version: 8.5.439 / Virus Database: 271.1.1/2976 - Release Date: 07/02/10
>>> 06:35:00
>>>
>>> __________
>>> View the list's information and change your settings at
>>> //www.freelists.org/list/programmingblind
>>>
>>>
>> __________
>> View the list's information and change your settings at
>> //www.freelists.org/list/programmingblind
>>
>
> __________
> View the list's information and change your settings at
> //www.freelists.org/list/programmingblind
>
>
__________
View the list's information and change your settings at 
//www.freelists.org/list/programmingblind

Other related posts: