Deprecated: Array and string offset access syntax with curly braces is deprecated in /homepages/21/d38531796/htdocs/jose/smfforum/Sources/Subs.php on line 3825
Fred's Tutorial #ALL: Discussion Thread

IT-Consultant: Frederick J. Harris > Fred's API (Application Programming Interface) Tutorials

Fred's Tutorial #ALL: Discussion Thread

(1/2) > >>

Edwin Knoppert:
1) Most BASIC languages don't support local variable scoping like c does {..}
Therefore a common 'mistake' is to assume the windowproc is poorly constructed due to this 'impact'
If a switch() is combined with {} for each case, local variables and so can be used fine.

2) Using a static in the windowprocedure *will* bite you soon or later.
If this topic supposed to be a lesson of some kind i can surely recommend you not to use globals and statics for your examples.
I know people who can not judge these issues and from my own experiance, poor code remains to be used even if i know better.
just to lazy to improve or just waiting until it explodes or something like that :)

Marc Van Cauwenberghe:

I am really intrigued by your statement 1). I have missed using local variables. Could you explain this please (maybe in an other topic)


Paul Breen:
I don't know if I am posting in the right place but. . .

I am curious about why you moved from MFC to powerbasic because I am studying MFC to go the other way! I am thinking of using MFC in the "main" program and use powerbasic through dll's


Frederick J. Harris:
Hi Paul!

     I've always disliked MFC.  I still do a lot of C & C++ programming but I use my own libraries.  The reasons I dislike MFC are the hugh bloated programs that result, and the architecture (document view) that is imposes on one.  If you don't care about the size of the resulting programs, can live with wizard generated code, and like the MFC Document/View architecture, I'd say use it.  Here just recently my organization received a large MFC program that was recently released, so I know folks are still using MFC.

     In terms of 'ends and means', I guess I'd say the 'means' are as important or even more important to me than the 'ends'.  If I had to choose between producing a simpler application of which I could say I fully understood every line of code, and a more complex one containing auto-generated code some of which might even be over my head, I'd usually choose the simpler one, and hope that while producing it I'd learn something new.  To me the primary beauty of C++ is that it allows you to use some truely interesting features to build up larger code 'objects'.  So I guess I like to keep re-inventing the wheel.  As I said...a matter of ends vs means.

     I guess in my formative years as a coder there was no internet where one could go for help.  I always worked alone and never had access to anyone to whom I could go for help.  I developed a mentality where I had to figure out everything for myself.  Therefore, I tended to stick with more basic and fundamental coding styles that were not several abstraction layers above the 'base', as it were.  That is probably part of the appeal of sdk api style coding.  Once you understand the fundamentals, its really pretty simple.  That's about the best I can do for an answer! 


Paul Breen:
I read that mfc was a "thin" wrapper on the win32 so I thought the programs would have little bloat.
(sigh) :'(
I have hopes for freebasic now, just loaded the latest version with FreeBASIC editor and so far I am impressed, it looks like vc++ 6.0 ide. Don't use FBIde, it is a different animal. I hope phoenix will adopt this compiler in time. Looks like a new release every 3-4 months and it is much improved since I first looked at it over a year ago. I have given up on PowerBasic adopting oop, they don't even see the need for projects.


[0] Message Index

[#] Next page

Go to full version