indeed
i enforce in the morning (CET) she does the nights, works out pretty well

    2 months later

    Originally posted by sid

    a.) YES, there are tabs. it just makes it a lot easier to indent. once i am finished with a project i tend to let a multiple-file text replacer run over it and replace tabs with 4 spaces each.

    A handy little BASH script I use.

    for file in $(find . -regex ".*\.php")
    do
    sed "s/[a tab]/[4 spaces]/g" $file > buff
    mv buff $file
    done
    

    obviously, replace [a tab] with a tab and [4 spaces] with four spaces.

    However I haven't needed to use this much since I added this little piece to my .vimrc

    map <F10> : %s/\t/    /g<CR>
    

    all I have to do know is whack F10 and all the tabs are magically transformed into four spaces 😃
    HTH someone
    Bubble

      9 months later

      alright, who's been bumping this puppy?

        I voted only AFTER it had been bumped. I'm innocent!

        As for my coding style:

        1. "Ternary" if it is simply creating a variable to a maximum of two structures:
        $var = ($a ? $a : ($b ? $b : $c));
        1. "One line per condition" if it's simple:
        if($var) {..}
        elseif($bar) {..}
        else {..}
        1. "Java Style"

        BTW. I too am consoled by the fact that weedpacket agonized over a 14 line "solution" that could be done in 1 line.

          My style varies depending on my mood.

          Which is probably not the best way to go about coding really..

            ThIs WeEk I hAvE bEeN mOsTlY cOdInG iN aLtErNaTiNg CaSe.

              1337 code doesn't work too well....

              echo imp70d3(', ', $array);
              # PHP Fatal error:  Call to undefined function:  imp70d3()
                4 months later

                Hey this is PHP we can do anything...

                function omgTehEliteFunction()
                {
                	$vow = array (
                		4 => 'a',
                		3 => 'e',
                		1 => 'i',
                		0 => 'o',
                		'\\/.' => 'u'
                	);
                	$args = func_get_args();
                	$funcname = $args[0];
                	array_shift($args);
                	for( $a = 0, $b = strlen( $funcname ); $a < $b; $a++ )
                	{
                		if( isset( $vow[$funcname[$a]] ))
                		{
                			$funcname[$a] = $vow[$funcname[$a]];
                		}
                	}
                	return call_user_func_array( $funcname, $args );
                }
                $array = array( 1,2,3 );
                echo omgTehEliteFunction( '1mpl0d3', ', ', $array);
                

                This could be the next Programming Challenge 😃

                  Originally posted by Shrike
                  This could be the next Programming Challenge 😃

                  Implement this perhaps?

                    3 months later
                    Elizabeth wrote:

                    Alright, whos the culprit?

                    huh?

                      nvm, someone musta voted 😛 forgot about that bug

                        I wanna know who voted on this poll, bumping it from the 3-month sleep it had nicely found itself in. 🙂

                          /me patiently waits for JPnyc to tell us how to expire existing polls, now that we have this new-fangled edition of vBulletin...

                            I use mainly C-style, but every now and then I'll fluctuate between some shorthand (like if there's only one thing an if statement will do if true, I wont enclose it in brackets, just newline).

                            Example:

                            
                            if ($a > $b)
                                 echo "A is greater than B";
                            else
                            {
                                 echo "A is less than B";
                                 mail("logankriete@gmail.com", "Startling revelation!", "A is less than B!!!!!");
                            }
                            

                            But there's more to it than control structures - like output. Some people use echo, some people use print. And even there, some people do echo("Hello"); or echo ("Hello"); (with space between echo and string); some people do echo "Hello";, some people only use paranthesis when echoing soley a variable: echo ($var); echo "Hello";. Some people like print, but that's even more of a debate 😃

                            Edit: I just looked at the first post's date...what happened to make this post "come alive" again? Who posted something after it "lost it's steam" a few months ago?

                              kburger wrote:

                              Guilty.

                              kburger - you get brownie points for standing up and accepting responsibility. 🙂 Consider yourself off the hook 🙂

                              I always kinda liked this poll anyway.

                                Oh so it was kburger...all right then.

                                Maybe some mod should close it?

                                  Not sure how, with this upgraded version- the old version had that option, but with this one I'm not seeing it.

                                    Somehow JPnyc closed my thread 🙂