php-general Digest 23 Sep 2012 13:33:44 -0000 Issue 7976

Topics (messages 319192 through 319207):

Need help to understand a code
        319192 by: Ashickur Rahman Noor
        319193 by: Stefan Wixfort
        319194 by: Maciek Sokolewicz
        319195 by: Ashley Sheridan
        319196 by: Ashickur Rahman Noor
        319197 by: Ashley Sheridan
        319198 by: Matijn Woudt
        319199 by: Samuel Lopes Grigolato
        319200 by: Ashley Sheridan
        319201 by: Maciek Sokolewicz
        319202 by: Samuel Lopes Grigolato
        319203 by: Ashley Sheridan
        319204 by: Samuel Lopes Grigolato

Day after Friday
        319205 by: Tedd Sperling
        319206 by: Paul M Foster
        319207 by: Tedd Sperling

Administrivia:

To subscribe to the digest, e-mail:
        php-general-digest-subscr...@lists.php.net

To unsubscribe from the digest, e-mail:
        php-general-digest-unsubscr...@lists.php.net

To post to the list, e-mail:
        php-gene...@lists.php.net


----------------------------------------------------------------------
--- Begin Message ---
Hi all

I need some help to understand a code. The code is like this

$result = mysql_query($sSQL) or die("err: " . mysql_error().$sSQL);
>     if($row = mysql_fetch_array($result))
>                         {
>       foreach($row as $key =>$value){ $$key=$value;}
>     }
>

I don't get the code from the foreach loop.
----------------------------------------------------------
Dedicated Linux Forum in Bangladesh <http://goo.gl/238Ck>
2048R/89C932E1 <http://goo.gl/TkP5U>
Coordinator - Public Relation Cell, FOSS Bangladesh
<http://fossbd.org/> && Mozilla
Reps <http://reps.mozilla.org>
01199151550, 01551151550

--- End Message ---
--- Begin Message ---
On 22.09.2012 12:34, Ashickur Rahman Noor wrote:
Hi all

I need some help to understand a code. The code is like this

$result = mysql_query($sSQL) or die("err: " . mysql_error().$sSQL);
     if($row = mysql_fetch_array($result))
                         {
       foreach($row as $key =>$value){ $$key=$value;}
     }


I don't get the code from the foreach loop.

I assume that you mean the meaning of "$$key = $value".
This is a variable variable[1]
This means if you have a key in your array named "dino" then you assign $dino the value of $value for the current row.

so: $key = 'dino', $value = 'saur'
=> $$key = $value => $$key = 'saur' => $dino = 'saur'

Hope this was somewhat helpful and understandable.

[1] http://php.net/manual/en/language.variables.variable.php


--- End Message ---
--- Begin Message ---
On 22-09-2012 12:34, Ashickur Rahman Noor wrote:
Hi all

I need some help to understand a code. The code is like this

$result = mysql_query($sSQL) or die("err: " . mysql_error().$sSQL);
     if($row = mysql_fetch_array($result))
                         {
       foreach($row as $key =>$value){ $$key=$value;}
     }


I don't get the code from the foreach loop.
It simply assigns all values from the array to variables, which have the name of the keys.

So basically what happens is:
$array = array('a'=>1, 'b'=>2, 'c'=>3);
foreach($array as $key=>$val) {
   $$key = $val;
}

will result in the creation of:
$a = 1;
$b = 2;
$c = 3;

$$foo means "I want a variable whose name is contained in the variable $foo". So if $foo has the value 'bar', then you'll actually be saying "I want a variable whose name is 'bar': $bar".

So:
$foo = 'bar';
$bar = 'this works!';

echo $$foo; // returns "this works!"



--- End Message ---
--- Begin Message ---
On Sat, 2012-09-22 at 13:13 +0200, Maciek Sokolewicz wrote:

> On 22-09-2012 12:34, Ashickur Rahman Noor wrote:
> > Hi all
> >
> > I need some help to understand a code. The code is like this
> >
> > $result = mysql_query($sSQL) or die("err: " . mysql_error().$sSQL);
> >>      if($row = mysql_fetch_array($result))
> >>                          {
> >>        foreach($row as $key =>$value){ $$key=$value;}
> >>      }
> >>
> >
> > I don't get the code from the foreach loop.
> It simply assigns all values from the array to variables, which have the 
> name of the keys.
> 
> So basically what happens is:
> $array = array('a'=>1, 'b'=>2, 'c'=>3);
> foreach($array as $key=>$val) {
>     $$key = $val;
> }
> 
> will result in the creation of:
> $a = 1;
> $b = 2;
> $c = 3;
> 
> $$foo means "I want a variable whose name is contained in the variable 
> $foo". So if $foo has the value 'bar', then you'll actually be saying "I 
> want a variable whose name is 'bar': $bar".
> 
> So:
> $foo = 'bar';
> $bar = 'this works!';
> 
> echo $$foo; // returns "this works!"
> 
> 
> 


Be careful with this though. I'm working on fixing some old code that
someone wrote. They used this technique to "update" their code when it
got moved to a server where register_globals was turned off.
-- 
Thanks,
Ash
http://www.ashleysheridan.co.uk



--- End Message ---
--- Begin Message ---
Hi Ashley

I am updating some one code. Thanks for the notify.

Thanks to all. Now I get that.
----------------------------------------------------------
Dedicated Linux Forum in Bangladesh <http://goo.gl/238Ck>
2048R/89C932E1 <http://goo.gl/TkP5U>
Coordinator - Public Relation Cell, FOSS Bangladesh
<http://fossbd.org/> && Mozilla
Reps <http://reps.mozilla.org>
01199151550, 01551151550

--- End Message ---
--- Begin Message ---
On Sat, 2012-09-22 at 17:43 +0600, Ashickur Rahman Noor wrote:

> Hi Ashley
> 
> I am updating some one code. Thanks for the notify.
> 
> Thanks to all. Now I get that.
> ----------------------------------------------------------
> Dedicated Linux Forum in Bangladesh <http://goo.gl/238Ck>
> 2048R/89C932E1 <http://goo.gl/TkP5U>
> Coordinator - Public Relation Cell, FOSS Bangladesh
> <http://fossbd.org/> && Mozilla
> Reps <http://reps.mozilla.org>
> 01199151550, 01551151550


It's probably fine doing that for your example, as the content coming
from the database will be content you expect, but be wary of using it on
any of the user-generated arrays like $_GET, or $_POST.

-- 
Thanks,
Ash
http://www.ashleysheridan.co.uk



--- End Message ---
--- Begin Message ---
Op 22 sep. 2012 13:47 schreef "Ashley Sheridan" <a...@ashleysheridan.co.uk>
het volgende:
>
> On Sat, 2012-09-22 at 17:43 +0600, Ashickur Rahman Noor wrote:
>
> > Hi Ashley
> >
> > I am updating some one code. Thanks for the notify.
> >
> > Thanks to all. Now I get that.
> > ----------------------------------------------------------
> > Dedicated Linux Forum in Bangladesh <http://goo.gl/238Ck>
> > 2048R/89C932E1 <http://goo.gl/TkP5U>
> > Coordinator - Public Relation Cell, FOSS Bangladesh
> > <http://fossbd.org/> && Mozilla
> > Reps <http://reps.mozilla.org>
> > 01199151550, 01551151550
>
>
> It's probably fine doing that for your example, as the content coming
> from the database will be content you expect, but be wary of using it on
> any of the user-generated arrays like $_GET, or $_POST.
>

And a few months/years later you decide to add a new column to your db
which has the same name as one of the variables you're already using and
the script starts acting very strange...
People should stop using bad coding habits like these..

- Matijn

--- End Message ---
--- Begin Message ---
+1 to bad maintainability of the code.

As a suggestion, one better solution could be something like:

[...]

class Entity {
   public $id;
   public $name;
}

[...]

$entity = new Entity();
foreach [...]
  $entity->$$key = $value;  

[...]

And, of course, never ever use "*" in SQL queries.

Samuel.

-----Mensagem original-----
De: Matijn Woudt [mailto:tijn...@gmail.com] 
Enviada em: sábado, 22 de setembro de 2012 11:02
Para: a...@ashleysheridan.co.uk
Cc: Ashickur Rahman Noor; PHP List
Assunto: Re: [PHP] Re: Need help to understand a code

Op 22 sep. 2012 13:47 schreef "Ashley Sheridan" <a...@ashleysheridan.co.uk> het 
volgende:
>
> On Sat, 2012-09-22 at 17:43 +0600, Ashickur Rahman Noor wrote:
>
> > Hi Ashley
> >
> > I am updating some one code. Thanks for the notify.
> >
> > Thanks to all. Now I get that.
> > ----------------------------------------------------------
> > Dedicated Linux Forum in Bangladesh <http://goo.gl/238Ck>
> > 2048R/89C932E1 <http://goo.gl/TkP5U> Coordinator - Public Relation 
> > Cell, FOSS Bangladesh <http://fossbd.org/> && Mozilla Reps 
> > <http://reps.mozilla.org> 01199151550, 01551151550
>
>
> It's probably fine doing that for your example, as the content coming 
> from the database will be content you expect, but be wary of using it 
> on any of the user-generated arrays like $_GET, or $_POST.
>

And a few months/years later you decide to add a new column to your db which 
has the same name as one of the variables you're already using and the script 
starts acting very strange...
People should stop using bad coding habits like these..

- Matijn


--- End Message ---
--- Begin Message ---

Samuel Lopes Grigolato <samuel.grigol...@gmail.com> wrote:

>+1 to bad maintainability of the code.
>
>As a suggestion, one better solution could be something like:
>
>[...]
>
>class Entity {
>   public $id;
>   public $name;
>}
>
>[...]
>
>$entity = new Entity();
>foreach [...]
>  $entity->$$key = $value;
>
>[...]
>
>And, of course, never ever use "*" in SQL queries.
>
>Samuel.
>
>-----Mensagem original-----
>De: Matijn Woudt [mailto:tijn...@gmail.com]
>Enviada em: sábado, 22 de setembro de 2012 11:02
>Para: a...@ashleysheridan.co.uk
>Cc: Ashickur Rahman Noor; PHP List
>Assunto: Re: [PHP] Re: Need help to understand a code
>
>Op 22 sep. 2012 13:47 schreef "Ashley Sheridan"
><a...@ashleysheridan.co.uk> het volgende:
>>
>> On Sat, 2012-09-22 at 17:43 +0600, Ashickur Rahman Noor wrote:
>>
>> > Hi Ashley
>> >
>> > I am updating some one code. Thanks for the notify.
>> >
>> > Thanks to all. Now I get that.
>> > ----------------------------------------------------------
>> > Dedicated Linux Forum in Bangladesh <http://goo.gl/238Ck>
>> > 2048R/89C932E1 <http://goo.gl/TkP5U> Coordinator - Public Relation
>> > Cell, FOSS Bangladesh <http://fossbd.org/> && Mozilla Reps
>> > <http://reps.mozilla.org> 01199151550, 01551151550
>>
>>
>> It's probably fine doing that for your example, as the content coming
>
>> from the database will be content you expect, but be wary of using it
>
>> on any of the user-generated arrays like $_GET, or $_POST.
>>
>
>And a few months/years later you decide to add a new column to your db
>which has the same name as one of the variables you're already using
>and the script starts acting very strange...
>People should stop using bad coding habits like these..
>
>- Matijn
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php

there's nothing wrong with using * in queries.

--
Sent from my Android phone with K-9 Mail. Please excuse my brevity.

--- End Message ---
--- Begin Message ---
On 22-09-2012 16:19, Samuel Lopes Grigolato wrote:
+1 to bad maintainability of the code.

As a suggestion, one better solution could be something like:

[...]

class Entity {
    public $id;
    public $name;
}

[...]

$entity = new Entity();
foreach [...]
   $entity->$$key = $value;

[...]

And, of course, never ever use "*" in SQL queries.

Samuel.


If you're doing it that way, just use mysqli and then mysqli_result's fetch_object with your Entity as the class. ie:
$result = $mysqli->query('some query');
$entity = $result->fetch_object('Entity');


--- End Message ---
--- Begin Message ---
I disagree with you Ashley, some arguments can be found here: 
http://sqlblog.com/blogs/aaron_bertrand/archive/2009/10/10/bad-habits-to-kick-using-select-omitting-the-column-list.aspx

Using explicit columns names in the select clause is, IMHO, at least a good 
documentation for what is being requested to the database layer.

+1 to Maciek's suggestion, had totally forgotten this one.

Cheers.

-----Mensagem original-----
De: Ashley Sheridan [mailto:a...@ashleysheridan.co.uk] 
Enviada em: sábado, 22 de setembro de 2012 11:52
Para: Samuel Lopes Grigolato; 'PHP List'
Assunto: Re: RES: [PHP] Re: Need help to understand a code



Samuel Lopes Grigolato <samuel.grigol...@gmail.com> wrote:

>+1 to bad maintainability of the code.
>
>As a suggestion, one better solution could be something like:
>
>[...]
>
>class Entity {
>   public $id;
>   public $name;
>}
>
>[...]
>
>$entity = new Entity();
>foreach [...]
>  $entity->$$key = $value;
>
>[...]
>
>And, of course, never ever use "*" in SQL queries.
>
>Samuel.
>
>-----Mensagem original-----
>De: Matijn Woudt [mailto:tijn...@gmail.com] Enviada em: sábado, 22 de 
>setembro de 2012 11:02
>Para: a...@ashleysheridan.co.uk
>Cc: Ashickur Rahman Noor; PHP List
>Assunto: Re: [PHP] Re: Need help to understand a code
>
>Op 22 sep. 2012 13:47 schreef "Ashley Sheridan"
><a...@ashleysheridan.co.uk> het volgende:
>>
>> On Sat, 2012-09-22 at 17:43 +0600, Ashickur Rahman Noor wrote:
>>
>> > Hi Ashley
>> >
>> > I am updating some one code. Thanks for the notify.
>> >
>> > Thanks to all. Now I get that.
>> > ----------------------------------------------------------
>> > Dedicated Linux Forum in Bangladesh <http://goo.gl/238Ck>
>> > 2048R/89C932E1 <http://goo.gl/TkP5U> Coordinator - Public Relation 
>> > Cell, FOSS Bangladesh <http://fossbd.org/> && Mozilla Reps 
>> > <http://reps.mozilla.org> 01199151550, 01551151550
>>
>>
>> It's probably fine doing that for your example, as the content coming
>
>> from the database will be content you expect, but be wary of using it
>
>> on any of the user-generated arrays like $_GET, or $_POST.
>>
>
>And a few months/years later you decide to add a new column to your db 
>which has the same name as one of the variables you're already using 
>and the script starts acting very strange...
>People should stop using bad coding habits like these..
>
>- Matijn
>
>
>--
>PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: 
>http://www.php.net/unsub.php

there's nothing wrong with using * in queries.

--
Sent from my Android phone with K-9 Mail. Please excuse my brevity.


--- End Message ---
--- Begin Message ---
On Sat, 2012-09-22 at 12:12 -0300, Samuel Lopes Grigolato wrote:

> I disagree with you Ashley, some arguments can be found here: 
> http://sqlblog.com/blogs/aaron_bertrand/archive/2009/10/10/bad-habits-to-kick-using-select-omitting-the-column-list.aspx
> 
> Using explicit columns names in the select clause is, IMHO, at least a good 
> documentation for what is being requested to the database layer.
> 
> +1 to Maciek's suggestion, had totally forgotten this one.
> 
> Cheers.
> 
> -----Mensagem original-----
> De: Ashley Sheridan [mailto:a...@ashleysheridan.co.uk] 
> Enviada em: sábado, 22 de setembro de 2012 11:52
> Para: Samuel Lopes Grigolato; 'PHP List'
> Assunto: Re: RES: [PHP] Re: Need help to understand a code
> 
> 
> 
> Samuel Lopes Grigolato <samuel.grigol...@gmail.com> wrote:
> 
> >+1 to bad maintainability of the code.
> >
> >As a suggestion, one better solution could be something like:
> >
> >[...]
> >
> >class Entity {
> >   public $id;
> >   public $name;
> >}
> >
> >[...]
> >
> >$entity = new Entity();
> >foreach [...]
> >  $entity->$$key = $value;
> >
> >[...]
> >
> >And, of course, never ever use "*" in SQL queries.
> >
> >Samuel.
> >
> >-----Mensagem original-----
> >De: Matijn Woudt [mailto:tijn...@gmail.com] Enviada em: sábado, 22 de 
> >setembro de 2012 11:02
> >Para: a...@ashleysheridan.co.uk
> >Cc: Ashickur Rahman Noor; PHP List
> >Assunto: Re: [PHP] Re: Need help to understand a code
> >
> >Op 22 sep. 2012 13:47 schreef "Ashley Sheridan"
> ><a...@ashleysheridan.co.uk> het volgende:
> >>
> >> On Sat, 2012-09-22 at 17:43 +0600, Ashickur Rahman Noor wrote:
> >>
> >> > Hi Ashley
> >> >
> >> > I am updating some one code. Thanks for the notify.
> >> >
> >> > Thanks to all. Now I get that.
> >> > ----------------------------------------------------------
> >> > Dedicated Linux Forum in Bangladesh <http://goo.gl/238Ck>
> >> > 2048R/89C932E1 <http://goo.gl/TkP5U> Coordinator - Public Relation 
> >> > Cell, FOSS Bangladesh <http://fossbd.org/> && Mozilla Reps 
> >> > <http://reps.mozilla.org> 01199151550, 01551151550
> >>
> >>
> >> It's probably fine doing that for your example, as the content coming
> >
> >> from the database will be content you expect, but be wary of using it
> >
> >> on any of the user-generated arrays like $_GET, or $_POST.
> >>
> >
> >And a few months/years later you decide to add a new column to your db 
> >which has the same name as one of the variables you're already using 
> >and the script starts acting very strange...
> >People should stop using bad coding habits like these..
> >
> >- Matijn
> >
> >
> >--
> >PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: 
> >http://www.php.net/unsub.php
> 
> there's nothing wrong with using * in queries.
> 
> --
> Sent from my Android phone with K-9 Mail. Please excuse my brevity.
> 


There are plenty of times that you need all fields from a table though.
I go by the rule that if I need less than two thirds of the fields of a
table, then I specify the fields I need, otherwise, it's easier to go
with *.

I've looked at the link you posted. The join issue is too broad. I use *
with joins, but avoid the conflicts by specifying the table name, still
going by the ⅔ rule above on a table by table basis. Of course, if there
are tables used in the join that are not necessary to the actual output,
I won't include them in the list, but I may do something like this:

SELECT a.a, a.b, a.c, b.*
FROM a
LEFT JOIN a on a.a = b.a

I would say that if you're in the position of writing the queries then
you should be aware of the database schema, so using the query as a form
of documentation shouldn't be a factor. Of course there are occasions
where the database is updated and breaks code, in which case specifying
all the field names would potentially avoid that, but procedures should
be in place which would at least make you aware of such updates to allow
you to plan for them.



-- 
Thanks,
Ash
http://www.ashleysheridan.co.uk



--- End Message ---
--- Begin Message ---
When I said that it’s a form of documentation, I was saying that I think it’s 
better to know everything the script is using from the tables right on the SQL 
command, without the need to inspect all the code, for example:

 

SELECT * FROM a;

$values = some_fetch_array_thing

[…] bunch of lines of code

echo $values[“column1”];

[…] another bunch of code

echo $values[“column2”];

 

In my opinion it’s is easier to forget that column2 is being utilized by this 
script, than if it was explicit in the SQL command. Of course, if the lifecycle 
of the array fetched from the resultset doesn’t spread too much, there isn’t 
any problem.

 

Besides that, I’ve got your points =). The “a.*” thing successfully beats the 
join problem.

 

One last point: “Of course there are occasions where the database is updated 
and breaks code, in which case specifying all the field names would potentially 
avoid that”, we should only declare in the SELECT clause fields we’re actually 
using along the script, and even if we go with the “*” way the code will broke 
eventually with schema changes.

 

Regards.

 

De: Ashley Sheridan [mailto:a...@ashleysheridan.co.uk] 
Enviada em: sábado, 22 de setembro de 2012 12:35
Para: Samuel Lopes Grigolato
Cc: 'PHP List'
Assunto: Re: RES: RES: [PHP] Re: Need help to understand a code

 

On Sat, 2012-09-22 at 12:12 -0300, Samuel Lopes Grigolato wrote: 

 
I disagree with you Ashley, some arguments can be found here: 
http://sqlblog.com/blogs/aaron_bertrand/archive/2009/10/10/bad-habits-to-kick-using-select-omitting-the-column-list.aspx
 
Using explicit columns names in the select clause is, IMHO, at least a good 
documentation for what is being requested to the database layer.
 
+1 to Maciek's suggestion, had totally forgotten this one.
 
Cheers.
 
-----Mensagem original-----
De: Ashley Sheridan [mailto:a...@ashleysheridan.co.uk] 
Enviada em: sábado, 22 de setembro de 2012 11:52
Para: Samuel Lopes Grigolato; 'PHP List'
Assunto: Re: RES: [PHP] Re: Need help to understand a code
 
 
 
Samuel Lopes Grigolato <samuel.grigol...@gmail.com> wrote:
 
>+1 to bad maintainability of the code.
> 
>As a suggestion, one better solution could be something like:
> 
>[...]
> 
>class Entity {
>   public $id;
>   public $name;
>}
> 
>[...]
> 
>$entity = new Entity();
>foreach [...]
>  $entity->$$key = $value;
> 
>[...]
> 
>And, of course, never ever use "*" in SQL queries.
> 
>Samuel.
> 
>-----Mensagem original-----
>De: Matijn Woudt [mailto:tijn...@gmail.com] Enviada em: sábado, 22 de 
>setembro de 2012 11:02
>Para: a...@ashleysheridan.co.uk
>Cc: Ashickur Rahman Noor; PHP List
>Assunto: Re: [PHP] Re: Need help to understand a code
> 
>Op 22 sep. 2012 13:47 schreef "Ashley Sheridan"
><a...@ashleysheridan.co.uk> het volgende:
>> 
>> On Sat, 2012-09-22 at 17:43 +0600, Ashickur Rahman Noor wrote:
>> 
>> > Hi Ashley
>> >
>> > I am updating some one code. Thanks for the notify.
>> >
>> > Thanks to all. Now I get that.
>> > ----------------------------------------------------------
>> > Dedicated Linux Forum in Bangladesh <http://goo.gl/238Ck>
>> > 2048R/89C932E1 <http://goo.gl/TkP5U> Coordinator - Public Relation 
>> > Cell, FOSS Bangladesh <http://fossbd.org/> && Mozilla Reps 
>> > <http://reps.mozilla.org> 01199151550, 01551151550
>> 
>> 
>> It's probably fine doing that for your example, as the content coming
> 
>> from the database will be content you expect, but be wary of using it
> 
>> on any of the user-generated arrays like $_GET, or $_POST.
>> 
> 
>And a few months/years later you decide to add a new column to your db 
>which has the same name as one of the variables you're already using 
>and the script starts acting very strange...
>People should stop using bad coding habits like these..
> 
>- Matijn
> 
> 
>--
>PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: 
>http://www.php.net/unsub.php
 
there's nothing wrong with using * in queries.
 
--
Sent from my Android phone with K-9 Mail. Please excuse my brevity.
 


There are plenty of times that you need all fields from a table though. I go by 
the rule that if I need less than two thirds of the fields of a table, then I 
specify the fields I need, otherwise, it's easier to go with *.

I've looked at the link you posted. The join issue is too broad. I use * with 
joins, but avoid the conflicts by specifying the table name, still going by the 
⅔ rule above on a table by table basis. Of course, if there are tables used in 
the join that are not necessary to the actual output, I won't include them in 
the list, but I may do something like this:

SELECT a.a, a.b, a.c, b.*
FROM a
LEFT JOIN a on a.a = b.a

I would say that if you're in the position of writing the queries then you 
should be aware of the database schema, so using the query as a form of 
documentation shouldn't be a factor. Of course there are occasions where the 
database is updated and breaks code, in which case specifying all the field 
names would potentially avoid that, but procedures should be in place which 
would at least make you aware of such updates to allow you to plan for them.





-- 
Thanks,
Ash
http://www.ashleysheridan.co.uk



 


--- End Message ---
--- Begin Message ---
Hi gang:

I know it's the Day after Friday, but I'm asking a off-topic question anyway -- 
sorry.

Normally, I teach a PHP class at the local college, but it got canceled (don't 
ask why) -- now I'm teaching Java.

So, can anyone recommend a Java list that is similar to this list?

Cheers,

tedd


_____________________
t...@sperling.com
http://sperling.com


--- End Message ---
--- Begin Message ---
On Sat, Sep 22, 2012 at 01:05:51PM -0400, Tedd Sperling wrote:

> Hi gang:
> 
> I know it's the Day after Friday, but I'm asking a off-topic question anyway 
> -- sorry.
> 
> Normally, I teach a PHP class at the local college, but it got canceled 
> (don't ask why) -- now I'm teaching Java.
> 
> So, can anyone recommend a Java list that is similar to this list?

Off off topic...

Who the hell cancels a PHP class? Do they not realize damn near the
whole internet runs on PHP? Wordpress, Drupal, Joomla, Facebook ad
nauseum, not to mention Symfony, CakePHP, Code Igniter, etc.
Administrators! Ach!

Paul

-- 
Paul M. Foster
http://noferblatz.com
http://quillandmouse.com

--- End Message ---
--- Begin Message ---
On Sep 22, 2012, at 3:59 PM, Paul M Foster <pa...@quillandmouse.com> wrote:
> On Sat, Sep 22, 2012 at 01:05:51PM -0400, Tedd Sperling wrote:
> 
>> Hi gang:
>> 
>> I know it's the Day after Friday, but I'm asking a off-topic question anyway 
>> -- sorry.
>> 
>> Normally, I teach a PHP class at the local college, but it got canceled 
>> (don't ask why) -- now I'm teaching Java.
>> 
>> So, can anyone recommend a Java list that is similar to this list?
> 
> Off off topic...
> 
> Who the hell cancels a PHP class? Do they not realize damn near the
> whole internet runs on PHP? Wordpress, Drupal, Joomla, Facebook ad
> nauseum, not to mention Symfony, CakePHP, Code Igniter, etc.
> Administrators! Ach!
> 
> Paul

Paul:

The class was canceled by administration and they have absolutely no conception 
of the technology and scope that PHP brings to the table. In fact, they were so 
opposed to PHP that when I first started teaching there they had PHP removed 
from their servers because of security concerns. So, for me to teach PHP, they 
were forced to install PHP/MySQL.

Now that you asked, here's the story about my PHP class.

The college moved the entire CIT (Computer Information Technology) department 
five miles from the downtown campus, where it has always been, to the new West 
campus. It's a nice campus, but no Macs -- admin said Mac don't meet their ROI 
requirement, but that's another story.

Of course, most students don't have transportation and there is no established 
public transportation from main campus to west campus -- that's not good.

Knowing that the students were going to have problems with transportation and 
that would result in a reduction in class sizes, the administration agreed to 
allow "smaller than norma"l classes for the Fall semester. Furthermore, the 
administration agreed to allow registration to be for a longer period than 
normal, namely from a couple of weeks before the semester started to a week 
after the semester started.

Everything sounds ok, right?

My PHP class had six students register two weeks before the class started. I 
expected, as is custom, to pick up a couple of students after the semester 
started thus exceeding the minimum number of student required. Furthermore, I 
agreed to teach the class at a reduced rate if there wasn't a sufficient number 
of students attending. BTW, administration had not made a determination as to 
exactly what the minimum class-size should be -- keep in mind, they only had 
two years to decide and these things take time.

So what happened?

Well we (the teachers) have a new contract and in that contract is a provision 
that allows for a reduced class size IF the teacher agrees to teach it at a 
reduced rate -- which I agreed to do. However, administration became confused 
as to how to pay a full time teacher IF they taught an undersized class. So, 
their solution was to cancel ALL under sized classes before the semester 
started. That way there would be no confusion as to what to pay.

Now, in my case I am the only teacher to teaches PHP, so there would be no full 
time teacher that might teach it. I am also an adjunct (part time) teacher and 
as such there is no confusion as to my pay. I am simply paid hourly and a 
reduced class size would result in my rate being reduced. So, there was 
absolutely no reason what-so-ever for my class to be cancelled. Leaps and 
bounds of illogic.

This is just another example of how administration makes decisions. It would be 
nice if administration decisions were made with respect to "what is best for 
the student" as compared to this type of nonsense.

Cheers,

tedd

_____________________
t...@sperling.com
http://sperling.com









.


--- End Message ---

Reply via email to