My OLD Syntax

Started by
79 comments, last by 21st Century Moose 10 years, 5 months ago

IIRC they help greatly against Heisenbugs.

Advertisement

Are you certain about that?

"Most people think, great God will come from the sky, take away everything, and make everybody feel high" - Bob Marley

laugh.png

Touché!

Thats why having indentation patterns and blank (whitespace) padding stuff makes the actual visual recognition of the braces/parens/whatever lessimportant (even more so as you get older and 8hours staring at a computer screen starts making your eyballs disolve)

--------------------------------------------[size="1"]Ratings are Opinion, not Fact

Curly brace arguments. Keeping programmers busy since 1969. tongue.png

Besides, the only correct brace style is the one I use.

HA! Until the Director of Software Engineering enforces his own personally preferred ideology upon his subjects. Sadly, dx'ing indexes stuck with me. (idx, jdx, kdx)

I only code on mechanical keyboards. So addicted to them, I bought them for every high-use workstation at my business.


if (keyboard_check(vk_left)) {
     x -= 5;
                             }

* snort * <--- I can feel aforementioned Director of Software Engineering twitching already...


if 
(
      keyboard_check
      (
          vk_left
      )
) 
{
        x -= 5;              
}

* sigh * that makes ME twitch. :( The first time OOP was choked down my throat, that's how those people coded. And were paid. Well paid.

Also, what sane language that allows bool to int casting doesn't represent the bool as 1 or 0?

Probably PHP. It has buried me with it's too-easy casting before.

Great. Very nice, except we don't know what true and false are. This isn't mentioned anywhere within those 1,300 pages. For all we know, false could be 354357 and true could be 77342.

Two things I miss the most from PHP: === operator and all variables needing to start with $. The $ thing makes it easier for me to see my own variables in the other mess of logic. And the === identity is true only if value and type match. So you can do a ===0 or !==0 and not really worry about accidental 1/0 true false problems.

I'm coming back to C (and sadly C++) from my too many years of PHP hacking web apps for my business. The C++ is for embedded things and we don't get any MSVC help, so many of my code searches are about doing things the hard way, coding it by yourself, and not relying on a framework for a crutch.

Thanks for the lolz!

:D Chris, the FNG

I bet there are better languages than PHP where you could use $. Even gcc allows it as an Extension.

Ever read this? http://me.veekun.com/blog/2012/04/09/php-a-fractal-of-bad-design/ biggrin.png

That's awesome. :) And a great read. It reminds me of my expectations: php is a chainsaw to get the job done and I don't really expect much from it. I expect more from C and C++ and they demand more of my thought to work correctly. (so, I'm spoiled by php)

I really like that dude said to go learn python. Always have been meaning to. Seeing the reference and reading some led to my big chuckle for the day:

Go learn Lisp. I hear people who know everything really like Lisp.


Two things I miss the most from PHP: === operator and all variables needing to start with $. The $ thing makes it easier for me to see my own variables in the other mess of logic. And the === identity is true only if value and type match. So you can do a ===0 or !==0 and not really worry about accidental 1/0 true false problems.

By general rule, if a language has === and !==, that means somebody got the design of the language horribly wrong with == and != (I can see doing implicit casting with integers and/or floats, but as soon as any other type combinations are involved comparisons should always return false).

Also the $ thing has an advantage you didn't mention: they're guaranteed to not clash with keywords, because they never start with $. That's extremely useful in the long run, albeit it looks somewhat hackish. Shame PHP only does it for variables and not for all identifiers.

Don't pay much attention to "the hedgehog" in my nick, it's just because "Sik" was already taken =/ By the way, Sik is pronounced like seek, not like sick.

That's funny. I consider that a great style. Also this is the style at Microsoft, and Epic.

I only switched to having the opening curly brace on the same line because I wanted to be consistent with others on a team I was on. Overall I think putting it on the next line is the most flexible and doesn't require weird special cases like when you start indenting the parameters list.

Once I saw a random poll on a blog that had almost 2000 votes, it had like 10 different styles listed, Allman style was winning by 70% or so.

EDIT: Found it http://www.terminally-incoherent.com/blog/2009/04/10/the-only-correct-indent-style/

"I AM ZE EMPRAH OPENGL 3.3 THE CORE, I DEMAND FROM THEE ZE SHADERZ AND MATRIXEZ"

My journals: dustArtemis ECS framework and Making a Terrain Generator

This topic is closed to new replies.

Advertisement