God Bless them.
-
We are developing an app for a client and it is in PHP (My Native for Web). I have a new kid working for me fresh out of uni. I put him incharge of site navigation. Basically what happens is everything is stored in a database and then when a page is called the main page customises itself with the data. (really easy to manage). I came down from the "Eagles Perch" (from which i watch the seniors) to inspect his code. It was very good to say the least. However i noticed a 60 line function that i couldn't remember being in the plans. When i asked him about it I was informed that it was to check if the response from the database contained any data. I'll explain: we used this to read the content for the page:
$page_content = mysql_result($query, '0', 'content');
Simple enough. but what if the page didn't exist in the databse? well it would eisplay and ugly MySQL error. His solution was to parse the result and check that it matched serveral templates he had created before called for the content of the result. He had spent a whole day on this and couldn't understand what i was thinking when i deleted the function. I then rewrote the prvious piece of code and the kid has felt like an idiot ever since: i rewrote it to this:$page_content = **@**mysql_result($query, '0', 'content');
He'll never make that mistake again.Brad Australian Have you tried Rebooting it?
-
Brett Rowbotham wrote:
On behalf of all non-PHP coders, what is the difference ?
Oh sorry I forgot you dont all code PHP. (I am ignorant arnt I). Basically the '@' symbol stops errors being displayed. It is rather like the '@' in a batch file. You won't receive errors or indication of the action, only the result. 60 lines replaced by 1 character. Still think it is funny.
Brad Australian Have you tried Rebooting it?
-
We are developing an app for a client and it is in PHP (My Native for Web). I have a new kid working for me fresh out of uni. I put him incharge of site navigation. Basically what happens is everything is stored in a database and then when a page is called the main page customises itself with the data. (really easy to manage). I came down from the "Eagles Perch" (from which i watch the seniors) to inspect his code. It was very good to say the least. However i noticed a 60 line function that i couldn't remember being in the plans. When i asked him about it I was informed that it was to check if the response from the database contained any data. I'll explain: we used this to read the content for the page:
$page_content = mysql_result($query, '0', 'content');
Simple enough. but what if the page didn't exist in the databse? well it would eisplay and ugly MySQL error. His solution was to parse the result and check that it matched serveral templates he had created before called for the content of the result. He had spent a whole day on this and couldn't understand what i was thinking when i deleted the function. I then rewrote the prvious piece of code and the kid has felt like an idiot ever since: i rewrote it to this:$page_content = **@**mysql_result($query, '0', 'content');
He'll never make that mistake again.Brad Australian Have you tried Rebooting it?
It's all part of learning. This is one of life's lessons; the lesson has nothing to do with knowing how to code a function in PHP or any other computer language, but that there is always another solution to a problem and that the solution you have created may not be the best. He shouldn't feel like an idiot: he identified the problem and found a solution to the problem. He didn't make a mistake: he found a solution to a problem; there are better solutions, but that's okay. It sounds like he takes pride in his work and should be commended for his fortitude in creating a solution. I have read that motivation is the single biggest factor in software development speed. The only mistake that can come from this is to treat his solution as if it were wrong.
-
It's all part of learning. This is one of life's lessons; the lesson has nothing to do with knowing how to code a function in PHP or any other computer language, but that there is always another solution to a problem and that the solution you have created may not be the best. He shouldn't feel like an idiot: he identified the problem and found a solution to the problem. He didn't make a mistake: he found a solution to a problem; there are better solutions, but that's okay. It sounds like he takes pride in his work and should be commended for his fortitude in creating a solution. I have read that motivation is the single biggest factor in software development speed. The only mistake that can come from this is to treat his solution as if it were wrong.
Very well put. 60 lines of code for one function? Atleast he's trying?
William M. [netdev]
-
Brett Rowbotham wrote:
On behalf of all non-PHP coders, what is the difference ?
Oh sorry I forgot you dont all code PHP. (I am ignorant arnt I). Basically the '@' symbol stops errors being displayed. It is rather like the '@' in a batch file. You won't receive errors or indication of the action, only the result. 60 lines replaced by 1 character. Still think it is funny.
Brad Australian Have you tried Rebooting it?
Bradml wrote:
Basically the '@' symbol stops errors being displayed.
But - ahem - wasn't it that you needed those info? Just silently dying is not the best error strategy I can think of. Years of heated discussions have beenfilled with the correct way of handling different types of errors, and billions of lines of code have been written. But maybe webdesigner have a different measure.
"We trained hard, but it seemed that every time we were beginning to form up into teams we would be reorganised. I was to learn later in life that we tend to meet any new situation by reorganising: and a wonderful method it can be for creating the illusion of progress, while producing confusion, inefficiency and demoralisation." -- Caius Petronius, Roman Consul, 66 A.D.
-
It's all part of learning. This is one of life's lessons; the lesson has nothing to do with knowing how to code a function in PHP or any other computer language, but that there is always another solution to a problem and that the solution you have created may not be the best. He shouldn't feel like an idiot: he identified the problem and found a solution to the problem. He didn't make a mistake: he found a solution to a problem; there are better solutions, but that's okay. It sounds like he takes pride in his work and should be commended for his fortitude in creating a solution. I have read that motivation is the single biggest factor in software development speed. The only mistake that can come from this is to treat his solution as if it were wrong.
I think this is an excellent point. I would like to clarify that I by no means made him feel stupid. An the poor guy does take pride in his work. But he has disapointed me once again this week. As some of you may know my servers all crashed because of a huge software bug. It was this kid again. As much as he means well, and even though he is one of the most promising programmers that have ever passed through my doors, he doesn't fully understand the syntax of most of the languages we have been using. Except C++, he seems to be quite good at that. Anyway I at no point called him stupid or insinuated it. He simply felt that way after realising he had made a mistake[as such](as we all do).
Brad Australian Have you tried Rebooting it?
-
Bradml wrote:
Basically the '@' symbol stops errors being displayed.
But - ahem - wasn't it that you needed those info? Just silently dying is not the best error strategy I can think of. Years of heated discussions have beenfilled with the correct way of handling different types of errors, and billions of lines of code have been written. But maybe webdesigner have a different measure.
"We trained hard, but it seemed that every time we were beginning to form up into teams we would be reorganised. I was to learn later in life that we tend to meet any new situation by reorganising: and a wonderful method it can be for creating the illusion of progress, while producing confusion, inefficiency and demoralisation." -- Caius Petronius, Roman Consul, 66 A.D.
jhwurmbach wrote:
But - ahem - wasn't it that you needed those info? Just silently dying is not the best error strategy I can think of. Years of heated discussions have beenfilled with the correct way of handling different types of errors, and billions of lines of code have been written. But maybe webdesigner have a different measure.
Very nice point, however in this instance we had a substantial amount of error handling code for this particular event (content equal to null) but this function happens to throw an error if roe "0" doesn't exist while still providing that value of null. And i don't thnk we ever have a different measure for error handling, except maybe sometimes you just don't care a much [Clients please ignore previous statment]
Brad Australian Have you tried Rebooting it?
-
Brett Rowbotham wrote:
On behalf of all non-PHP coders, what is the difference ?
Oh sorry I forgot you dont all code PHP. (I am ignorant arnt I). Basically the '@' symbol stops errors being displayed. It is rather like the '@' in a batch file. You won't receive errors or indication of the action, only the result. 60 lines replaced by 1 character. Still think it is funny.
Brad Australian Have you tried Rebooting it?
Sort of like putting on a blind fold to replace an expensive sonar rig. Scott
-
Sort of like putting on a blind fold to replace an expensive sonar rig. Scott
Well I would care to remind you that I have already stated that we have extensive error handling. The point of the "sonar rig" was simply to stop an error being displayed. It served the same purpose as the '@', except much more complex. Nice analogy though.
Brad Australian Have you tried Rebooting it?
-
jhwurmbach wrote:
But - ahem - wasn't it that you needed those info? Just silently dying is not the best error strategy I can think of. Years of heated discussions have beenfilled with the correct way of handling different types of errors, and billions of lines of code have been written. But maybe webdesigner have a different measure.
Very nice point, however in this instance we had a substantial amount of error handling code for this particular event (content equal to null) but this function happens to throw an error if roe "0" doesn't exist while still providing that value of null. And i don't thnk we ever have a different measure for error handling, except maybe sometimes you just don't care a much [Clients please ignore previous statment]
Brad Australian Have you tried Rebooting it?
plus brad's the boss so gets to have his way :) nerdy spotty little newbie coders have no rights. everyone knows that Bryce
--- To paraphrase Fred Dagg - the views expressed in this post are bloody good ones. --
Publitor, making Pubmed easy. http://www.sohocode.com/publitorOur kids books :The Snot Goblin, and Book 2 - the Snotgoblin and Fluff
-
plus brad's the boss so gets to have his way :) nerdy spotty little newbie coders have no rights. everyone knows that Bryce
--- To paraphrase Fred Dagg - the views expressed in this post are bloody good ones. --
Publitor, making Pubmed easy. http://www.sohocode.com/publitorOur kids books :The Snot Goblin, and Book 2 - the Snotgoblin and Fluff
bryce wrote:
plus brad's the boss so gets to have his way nerdy spotty little newbie coders have no rights. everyone knows that
I like your Style, Want a Job? I would like to inform you that this was not actually a valid offer for occupation. By reading this you may not sue me. God I hate lawyers
Brad Australian Have you tried Rebooting it?
-
bryce wrote:
plus brad's the boss so gets to have his way nerdy spotty little newbie coders have no rights. everyone knows that
I like your Style, Want a Job? I would like to inform you that this was not actually a valid offer for occupation. By reading this you may not sue me. God I hate lawyers
Brad Australian Have you tried Rebooting it?
Bradml wrote:
I like your Style, Want a Job?
thats because i'm very stylish...and i'll turn down the virtual offer becoz its in sydney...and sydney is a cesspit and we left it for Brisneyland where its milk and honey time ...though i can be contracted to work from here ;) plenty of experience working from home remotely :) in a stylish way of course Bryce
--- To paraphrase Fred Dagg - the views expressed in this post are bloody good ones. --
Publitor, making Pubmed easy. http://www.sohocode.com/publitorOur kids books :The Snot Goblin, and Book 2 - the Snotgoblin and Fluff
-
Bradml wrote:
I like your Style, Want a Job?
thats because i'm very stylish...and i'll turn down the virtual offer becoz its in sydney...and sydney is a cesspit and we left it for Brisneyland where its milk and honey time ...though i can be contracted to work from here ;) plenty of experience working from home remotely :) in a stylish way of course Bryce
--- To paraphrase Fred Dagg - the views expressed in this post are bloody good ones. --
Publitor, making Pubmed easy. http://www.sohocode.com/publitorOur kids books :The Snot Goblin, and Book 2 - the Snotgoblin and Fluff
-
We are developing an app for a client and it is in PHP (My Native for Web). I have a new kid working for me fresh out of uni. I put him incharge of site navigation. Basically what happens is everything is stored in a database and then when a page is called the main page customises itself with the data. (really easy to manage). I came down from the "Eagles Perch" (from which i watch the seniors) to inspect his code. It was very good to say the least. However i noticed a 60 line function that i couldn't remember being in the plans. When i asked him about it I was informed that it was to check if the response from the database contained any data. I'll explain: we used this to read the content for the page:
$page_content = mysql_result($query, '0', 'content');
Simple enough. but what if the page didn't exist in the databse? well it would eisplay and ugly MySQL error. His solution was to parse the result and check that it matched serveral templates he had created before called for the content of the result. He had spent a whole day on this and couldn't understand what i was thinking when i deleted the function. I then rewrote the prvious piece of code and the kid has felt like an idiot ever since: i rewrote it to this:$page_content = **@**mysql_result($query, '0', 'content');
He'll never make that mistake again.Brad Australian Have you tried Rebooting it?
So a student who you had responsibility for was ignorant of a short cut , you showed it to him and then mock him ? Must be a nice working environment , I see you at fault here more than him.:omg:
-
So a student who you had responsibility for was ignorant of a short cut , you showed it to him and then mock him ? Must be a nice working environment , I see you at fault here more than him.:omg:
Andrew Torrance wrote:
So a student who you had responsibility for was ignorant of a short cut , you showed it to him and then mock him ? Must be a nice working environment , I see you at fault here more than him.
Andrew please read the very last thing i said. Then I also to stop making assumptions. In you statement I noticed claimed that the "student" (I'll get back to that) was my responsibility. Unless you know how I organize my development structure please keep your comments to yourself. The kid was not my responsibility at all. Also I could swear I never called him a student. Do you think I would post something about someone who is still supposed to be studying? And once again I will have to explain that I, at no point, tried to make him feel stupid or ignorant. I simply stated his own feelings which i assured him were unfounded. People should watch what they say.
Brad Australian Have you tried Rebooting it?