Best way ot code your hello world as a beginner.

Started by Dogim, November 21, 2010, 06:53:06 PM

Previous topic - Next topic

Dogim

Hello to all.
I was wondering after messing around with a few examples codes on the net, how should i, as a beginner code my hello world ?
why i ask ?
http://www.godevtool.com/GoasmHelp/HelloWorld2
This example code kept me busy for a few hours,and it was very knowledgeable, i felt that i got closer to the debugger and debugging, and understood a lot of what was going on under the hood, because i changed the WNDCLASS structure for WNDCLASSEX structure, and this is where all hell broke loose.
Many problems. ::)
I found myself debugging, searching MSDN, and managing to get things up and working.
Both codes still give an ERROR_INVALID_WINDOW_HANDLE at the end though, haven't figure that one out yet.
But shouldn't i be coding in this style, without Donkeys Header files , and without automatic frames and local directives etc etc ??
i know that this make the code more readable, but to tell you the truth, i still have some troubles figuring out thos .IF and ELSE conditional statements.
i post a sample of what i have managed to do with the hello code so far.( using header files and invoke)
Ill be back in a few hours or so, so i can't reply at the moment.
but some feedback is welcome  :toothy



Vortex

Hi Dogim,

QuoteBut shouldn't i be coding in this style, without Donkeys Header files , and without automatic frames and local directives etc etc ??

You should use Donkey's header files and the high level constructs offered by Goasm. Header files are created to make programming easier. Finding manually the numerical values of constants and equates can be a very tiresome work and this task is prone to errors. Using header files avoids a lot of headaches.

Dogim

Quote from: Vortex on November 21, 2010, 07:09:04 PM
Hi Dogim,

QuoteBut shouldn't i be coding in this style, without Donkeys Header files , and without automatic frames and local directives etc etc ??

You should use Donkey's header files and the high level constructs offered by Goasm. Header files are created to make programming easier. Finding manually the numerical values of constants and equates can be a very tiresome work and this task is prone to errors. Using header files avoids a lot of headaches.
Thanks Vortex, it was indeed tiresome work, so a beginner should stick with the headers to make his or her life easy  :U

donkey

Hi Dogim,

You also have to remember that many of the examples you will find for GoAsm are for earlier versions. GoAsm is a very dynamic work in progress, in fact even the header project is to a certain extent version specific since library support was only added a few years back and the #dynamiclinkfile is a fairly recent addition also. So some examples may not make use of certain features simply because they were not available at the time it was written. My advice is to use very tool at your disposal to make programming easier, the header files will save you a lot of time, not really time learning to use GoAsm but time in looking up equates and structure definitions that might take a bite out of you programming time.

Also please remember that the header project itself is a fairly recent addition to the tools available to the GoAsm programmer and though it is specifically targeted to GoAsm, it is not part of the package that Jeremy supports and so he may not make use of the headers in his examples.

Edgar
"Ahhh, what an awful dream. Ones and zeroes everywhere...[shudder] and I thought I saw a two." -- Bender
"It was just a dream, Bender. There's no such thing as two". -- Fry
-- Futurama

Donkey's Stable

Dogim

Quote from: donkey on November 22, 2010, 01:59:41 AM
Hi Dogim,

You also have to remember that many of the examples you will find for GoAsm are for earlier versions. GoAsm is a very dynamic work in progress, in fact even the header project is to a certain extent version specific since library support was only added a few years back and the #dynamiclinkfile is a fairly recent addition also. So some examples may not make use of certain features simply because they were not available at the time it was written. My advice is to use very tool at your disposal to make programming easier, the header files will save you a lot of time, not really time learning to use GoAsm but time in looking up equates and structure definitions that might take a bite out of you programming time.

Also please remember that the header project itself is a fairly recent addition to the tools available to the GoAsm programmer and though it is specifically targeted to GoAsm, it is not part of the package that Jeremy supports and so he may not make use of the headers in his examples.

Edgar
Thanks for the advise Donkey. :U