Jump to content

ShadowMage

Members
  • Posts

    3,476
  • Joined

  • Last visited

Posts posted by ShadowMage

  1. Not a bad example. You can see an immediate issue that might trap the unsuspecting developer. Let's add some statements prior to that mess:c=0;d=0;for(;;e++)if(g)a=b?c++&f:--d;What are the values of c and d when the ternary is first evaluated?(1) c == 0; d == 0(2) c == 1; d == -1(3) c == 0; d == -1(4) c == 1; d == 0
    Wow! I don't even know where to begin to try and understand what that's doing. :)
  2. 3) Also, he suggests these shorthand methods:
    instead of (foo != 0), use (foo)

    does that mean if foo has a value of anything (number, boolean, string) then you can just use (foo) and that resolves to true, if foo != 0?

    instead of (foo == 0) use (!foo)

    does this only apply when using numbers, or would this apply to false or an empty string as the value of foo? 4? :) ) Also, Douglas Crockford suggests against using ++ and -–. Would the appropriate alternative to say something like

    (for i = 0; i <= 10; i++)

    be

    (for i = 0; i <= 10; i+=1)?

    Thanks again for reading through this, I'm open to all your thoughts, comments, or suggestions. Does anyone have any recommendations on good books that better promote good coding practices, or good habits for developing code structure, scalability, employing DRY techniques, etc?Peace, have a good one! :)

    I can't say about 1 and 2 but for 3 and 3 (4) :) I have a few words.Personally I only use (foo) when I'm testing a boolean value. I think it's much easier to read and understand what exactly it is your conditionals are looking for.As for the ++ thing, I guess that would be a matter of personal opinion. To me it just looks messy to do this: (for i = 0; i <= 10; i+=1)I really don't think that one way is easier or more efficient. (If I'm wrong please correct me :) )
  3. I been bopping around these forums for a while now I think maybe it's time I introduce me.Full name: ...Alternative name(s): ...Birth date(dd/mm/yyyy): 1987Gender: MCountry of residance: USCity of residance: Curtiss, WIHeight: From the bottom of my feet to the top of my headWeight: Somewhere between 10 and 1000 lbs...Eyes: I have two.Hair: Still there, but thinning faster than I'd like...(especially for being in my 20s!!! :) )Smoking/Drinking/Drugs: On a cold day in *#&%Favourite Music: Everything but rap, metal, and opera (if you can call this stuff music...)Favourite Movies: Anything but musicalsInterest: Computers, video games, fishing, driving tractors and other such big farm equipment, paintballingPets: cats and a piranha (and about 35 cows... :) )Additional comments: If you haven't guessed I live on a farm. A dairy farm. I'm married, I have one beautiful daughter and another kid on the way.

  4. I use Code Genie 3.0 at work. I love it. It's just a text editor, but with coloration. The cool thing is that you can customize the color scheme of the syntax for the various languages. I'm not sure where to get it though. It's installed from our servers.

×
×
  • Create New...