Results 1 to 9 of 9

Thread: Is it me?

  1. #1
    Super Member Red_Oddity's Avatar
    Join Date
    Feb 2003
    Location
    A thousand years from here
    Posts
    3,352

    Is it me?

    Okay, so i finally taken the time this week to get through my C++ lesson book i bought a year ago, and i'm finally starting to make sense out of the SDK and C and C++ in general (especially concerning the use and function of pointers and their relation to arrays, variables and memory.)
    Atleast my eyes don't glaze over anymore when i take a peek at the source codes of the samples that come with the SDK.

    What i did notice though (and please correct me if i'm wrong, i'm learning, so nothing is set in stone yet in my memory) is that the source codes that come with the SDK are a complete mess and go pretty much against the way the book does it (not really code wise, but consistency and structure wise)

    The book learns me to declare all variables that have to go in the global scope at the start of your c(++) code or in you header file, but for some reason, the source that comes with the SDK samples, say, hotvideo, declares variables and pointer that are obviously global scope, all over the place throughout the script in between functions.

    Am i reading the source right? because it is really really annoying trying to read the code this way, i find myself scrolling like a nuttball through all the source codes trying to learn what is going on.
    I have no special talents. I am only passionately curious. - Albert Einstein
    visit my company site : House of Secrets
    visit my personal site : svenneve.com

  2. #2
    Super Member Red_Oddity's Avatar
    Join Date
    Feb 2003
    Location
    A thousand years from here
    Posts
    3,352
    Also, i'm just at chapter 6 of 17, but so far the SDK is already making alot more sense to me than it did a week ago...

    So bear with me when my lack of coding knowledge compared to a real programmer sounds like Telletubby dialog to a Stanford graduate.
    I have no special talents. I am only passionately curious. - Albert Einstein
    visit my company site : House of Secrets
    visit my personal site : svenneve.com

  3. #3
    which book did you buy?..

    mlon
    lw_chanlum [free shader and node x32] <HERE!>
    lw_chanlum [advanced node x32, x64, ub and osx] <HERE!>

  4. #4
    Registered User adamredwoods's Avatar
    Join Date
    Jul 2006
    Location
    San Francisco, CA
    Posts
    2,030
    Code:
    The book learns me to declare all variables that have to go in the global scope at the start of your c(++) code or in you header file, but for some reason, the source that comes with the SDK samples, say, hotvideo, declares variables and pointer that are obviously global scope, all over the place throughout the script in between functions.
    Depends whose code you look at. Check out inertia.c in the layout samples. It keeps it's globals relatively in order.
    // To draw is to think and discover.

  5. #5
    Super Member Red_Oddity's Avatar
    Join Date
    Feb 2003
    Location
    A thousand years from here
    Posts
    3,352
    Hey mlon, hoe gaat ie?

    i bought C++ by Steven Holzner, by publisher Grand Cru, not a bad book to brush up on your programming, it has a good order in which it walks you through a lot that is possible with C and C++ (besides the C++ code it teaches you, it also gives you alot of code and explanation in the C alternatives)

    Anyhoo, it's certainly not the definative answer to learning C++, but i think it is a good start (thank god it goes a lot further than most of the C++ books i read, the ones that teach you the 'hello world' code and then just dump you right into pieces of C++ code that make no sense without a lot of prior knowledge to C.)

    The book also misses some things, like why the heck some things won't compile (for example, it wouldn't compile an example script that used sqrt()...took me some time to figure out that, first #include <cmath> was missing in the example code, and second that sqrt needs double for input, something the writer missed to change in his code. So i had to change the struct or static_cast the sqrt input to double)


    Anyhoo...let me wish you guys happy newyear in advance (4.5 hours to go)
    I have no special talents. I am only passionately curious. - Albert Einstein
    visit my company site : House of Secrets
    visit my personal site : svenneve.com

  6. #6
    Super Member Red_Oddity's Avatar
    Join Date
    Feb 2003
    Location
    A thousand years from here
    Posts
    3,352
    And offcourse the book should be 'C++ Grand Cru' from publisher Easy Computing (original publisher is The Coriliosis Group LLC).
    I have no special talents. I am only passionately curious. - Albert Einstein
    visit my company site : House of Secrets
    visit my personal site : svenneve.com

  7. #7
    Ze Engineer connerh's Avatar
    Join Date
    Jul 2005
    Location
    Charleston, SC
    Posts
    419
    I often have felt that the provided sources leave a bit to be desired for a beginner programmer. It doesn't feel that it's laid out as cleanly as it could be, but on the other hand it's much better than a lot of tutorial source code you'll find laying around elsewhere (meaning for any language in general).

  8. #8
    Super Member Red_Oddity's Avatar
    Join Date
    Feb 2003
    Location
    A thousand years from here
    Posts
    3,352
    True, but it still takes longer than it really should, but then again, SDKs probably are not written with the beginning programmer in mind.
    My guess is that when you are a decent enough programmer you can read the code well enough to see what is going on, and once you have done a couple of plugins it all becomes second nature...i also could be SO wrong on this one
    I have no special talents. I am only passionately curious. - Albert Einstein
    visit my company site : House of Secrets
    visit my personal site : svenneve.com

  9. #9
    How Old? Really? Aww Heck colkai's Avatar
    Join Date
    Feb 2003
    Location
    Staffordshire
    Posts
    7,804
    Quote Originally Posted by Red_Oddity
    My guess is that when you are a decent enough programmer you can read the code well enough to see what is going on, and once you have done a couple of plugins it all becomes second nature...i also could be SO wrong on this one
    You just may well be.
    I've been coding for over 27 years and I still flinch when I see badly laid out code and yup, some of the SDK examples are very poor.

    The rest of it (syntax / functions etc) does start to become second nature, as with everything else, the more experience and exposure you have in a specific language, the more you look past the basics and technical.

    Been a very long time since I looked at the SDK, but my day job has me doing C++ at present so it may be a very good time for me to get back into it too!
    Too old to die young.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •