Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Post New Thread Reply

Register GFY Rules Calendar
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed.

 
Thread Tools
Old 09-01-2007, 03:32 PM   #51
BusterBunny
perverted justice decoy
 
BusterBunny's Avatar
 
Join Date: Aug 2005
Location: unborn still in the womb connected via blackberry
Posts: 19,291
50 incompetent mofos
__________________
my sig caught gonoherpasyphilaids and died
BusterBunny is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 09-01-2007, 04:35 PM   #52
sortie
Confirmed User
 
sortie's Avatar
 
Industry Role:
Join Date: Mar 2007
Posts: 7,771
Quote:
Originally Posted by calmlikeabomb View Post
Where's Jace? He never says anything back to my replies.

I guess he doesn't have the time to follow up on everything he posts

This is the 4th time I've had to step up and reply to him and haven't heard anything back. hrm....
I read the screen shots of the post and you told the guy you would get to it in a few days. After a few days you should have contacted him and told him you were not going to do it.

You told him to wait and he did.

It was then up to you to tell him to stop waiting.

What if you had started it in a few days, then finished and contacted him and he said "Oh, sorry man, I didn't wait, I had someone else do it so I don't need what you worked on". You would be pissed, right?
__________________
sortie is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 09-01-2007, 04:57 PM   #53
StuartD
Sofa King Band
 
StuartD's Avatar
 
Join Date: Jul 2002
Location: Outside the box
Posts: 29,903
Quote:
Originally Posted by WarChild View Post
Just curious, are you a self taught programmer or do you have formal schooling? Do you work mostly with script languages (php) or could you sit down and bang something off in C# if you needed to?
I'm a self taught web developer.. not a programmer. However I do have some training (schooling only without the school) from other developers.
As you said, there's a mighty fine difference between a developer (scripter) and an actual programmer.

I have "banged off" a few apps in C# using Visual Basic Express but nothing much beyond that as I've never had the time to devote to learning it properly.
StuartD is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 09-01-2007, 05:37 PM   #54
WarChild
Let slip the dogs of war.
 
WarChild's Avatar
 
Industry Role:
Join Date: Jan 2003
Location: Bermuda
Posts: 17,263
Quote:
Originally Posted by StuartD View Post
I'm a self taught web developer.. not a programmer. However I do have some training (schooling only without the school) from other developers.
As you said, there's a mighty fine difference between a developer (scripter) and an actual programmer.

I have "banged off" a few apps in C# using Visual Basic Express but nothing much beyond that as I've never had the time to devote to learning it properly.
Real programmers are a breed apart from everyone else. I never had the patience to spend 14 hours crawling over code, locked in a dark back office sucking down Doctor Pepper like it's water. I also like the sun.
__________________
.
WarChild is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 09-01-2007, 05:55 PM   #55
Tickler
Confirmed User
 
Join Date: Jul 2005
Posts: 650
Well, 35 years in systems & programming at a bunch of $1+Billion companies. A couple of honors degree. Another $250k in additional training, and still going.

I dont' really work in web stuff, but, have learned PHP to go along with the other dozen or so languages that I have worked with over the years.

I agree with Libertine that a lot them burn out by the time they are 35(or moved up into management). Most only got in for the money anyways. There are only a few like myself(maybe 2-5%) that actually enjoy it, and don't go the management route. Been a manager a few times, and I get bored trying to figure out how many pencils I have to budget for, etc. Although putting me under MBAs working as Project Leaders with no programming experience is just inviting me to take them out to the parking lot.

As Warchild pointed out, there are some pretty complex stuff that the larger companies have had time to develope. Also there are Enterprise packages that are 100s of millions of lines of code. This stuff doesn't run on PCs though. Figure $20 million for hardware, plus another $10 million for software.

Quote:
Originally Posted by GrouchyAdmin:
Code:
XOR %reg, %reg
vs
MOV.B 0x00, %reg
to save a byte or a cycle doesn't do much these days.
Things like bit sorts, etc. are still used a quite a bit. Terrabyte data mines need all the performance you can get. A neighbor also does machine language game programming. He has to fight off the companies wanting to hire him.

Also, I've seen newbies load everything into tables and then try to update with them. Nice way to get into multiple cross locks. Actually had a college stop teaching that stuff, because we don't allow it out in the real world.

Warchild:
On high access files(Client Master, etc.) you might want to look into DB fragmentation. Split your master file into different files based on how often each field is accessed. Use joining or extra reads to pick up the additional info only as needed.

For huge transaction files try partitioning so that each user/date gets a new file. Creates a zillion files, but you just enumerate the required files as you need them for consolidated stuff. You can also pickup some performance by arranging Ifs/Cases in the most often used order.

Quote:
Originally Posted by Warchild
Real programmers are a breed apart from everyone else.
I've been at it so long that I even do systems when I'm out in the pub hitting on the females.
__________________
Big Sister Live - Live sex club paid in Euros

Why all the PSYCHIC ads in the papers, and on TV?
Makes $$$s on the web @ Psychic Access
Tickler is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 09-01-2007, 08:27 PM   #56
dig420
Confirmed User
 
Industry Role:
Join Date: May 2001
Posts: 9,240
any of you high end programmers want to do a well paid, interesting project hit me up on icq 2417874
dig420 is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 09-01-2007, 08:48 PM   #57
GrouchyAdmin
Now choke yourself!
 
GrouchyAdmin's Avatar
 
Industry Role:
Join Date: Apr 2006
Posts: 12,085
Quote:
Originally Posted by Tickler View Post
Things like bit sorts, etc. are still used a quite a bit. Terrabyte data mines need all the performance you can get. A neighbor also does machine language game programming. He has to fight off the companies wanting to hire him.
This is very true. I was being mostly facetious; as anyone doing anything so streamlined in the adult industry likely isn't writing it in PHP.
__________________
GrouchyAdmin is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 09-01-2007, 09:12 PM   #58
Nookster
Confirmed IT Professional
 
Industry Role:
Join Date: Nov 2005
Location: Hollywood, CA
Posts: 3,744
It's funny how I notice the "real programmers" here noting that php is lame and this and that. Just shows how little you do know about PHP. PHP is coded in C# by the way...may want to think about that long and hard.
Nookster is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 09-01-2007, 09:14 PM   #59
WarChild
Let slip the dogs of war.
 
WarChild's Avatar
 
Industry Role:
Join Date: Jan 2003
Location: Bermuda
Posts: 17,263
Quote:
Originally Posted by Nookster View Post
It's funny how I notice the "real programmers" here noting that php is lame and this and that. Just shows how little you do know about PHP. PHP is coded in C# by the way...may want to think about that long and hard.
Who said it's lame? It's good for what it does.
__________________
.
WarChild is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 09-01-2007, 09:16 PM   #60
Nookster
Confirmed IT Professional
 
Industry Role:
Join Date: Nov 2005
Location: Hollywood, CA
Posts: 3,744
Quote:
Originally Posted by WarChild View Post
Who said it's lame? It's good for what it does.
Heh, glad to see you on your toes. I wasn't directing that one to you. I just noticed a few others here mentioning that it's "just a scripting language"...when it surely is not.
Nookster is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 09-01-2007, 09:17 PM   #61
psili
Confirmed User
 
Join Date: Apr 2003
Location: Loveland, CO
Posts: 5,526
Quote:
Originally Posted by Nookster View Post
It's funny how I notice the "real programmers" here noting that php is lame and this and that. Just shows how little you do know about PHP. PHP is coded in C# by the way...may want to think about that long and hard.
Isn't the PHP interpretor coded in "C" or something like that? I always thought "C sharp" was an MS thing. Or am I getting my acronyms all twisty again?
__________________
Your post count means nothing.
psili is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 09-01-2007, 09:18 PM   #62
Nookster
Confirmed IT Professional
 
Industry Role:
Join Date: Nov 2005
Location: Hollywood, CA
Posts: 3,744
Quote:
Originally Posted by psili View Post
Isn't the PHP interpretor coded in "C" or something like that? I always thought "C sharp" was an MS thing. Or am I getting my acronyms all twisty again?
Haha ouch. Sorry I meant og C, not sharp. Doh. lol
Nookster is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 09-01-2007, 09:22 PM   #63
yahoo-xxx-girls.com
Confirmed User
 
yahoo-xxx-girls.com's Avatar
 
Join Date: Jul 2006
Location: Canada
Posts: 3,143
Quote:
Originally Posted by Jace View Post
yup, there are way more flakes and idiots in adult than any other industry

I have hired from 3 different industries and adult is by far the worst for idiots

shit, one of them still posts on gfy and added ME to his ignore list because HE flaked on me!! haha

said he would do the job, would get back to me in a day or so, disappeared, then proclaims on gfy that I am now on his ignore list

I just don't get it..I have money...I have insane ideas...but finding a programmer that can make shit happen is impossible around these parts
Jace you are one of the biggest flakes on GFY... you should not be speaking on the subject...
yahoo-xxx-girls.com is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 09-01-2007, 09:29 PM   #64
psili
Confirmed User
 
Join Date: Apr 2003
Location: Loveland, CO
Posts: 5,526
Quote:
Originally Posted by Nookster View Post
Haha ouch. Sorry I meant og C, not sharp. Doh. lol
Fuck man... If those damn "interpretors" would just accept the code how I wrote it, a missing ";" wouldn't be an issue. I blame all my wasted web development error debugging on engineers making shit too complicated ;) -- It's a semi-colon for god's sake. Sorry. !!!!!!

j/k... kind of.
__________________
Your post count means nothing.
psili is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 09-01-2007, 09:49 PM   #65
GreyWolf
So Fucking Banned
 
Join Date: Jun 2007
Posts: 2,036
Quote:
Originally Posted by WarChild View Post
Real programmers are a breed apart from everyone else. I never had the patience to spend 14 hours crawling over code, locked in a dark back office sucking down Doctor Pepper like it's water.
You can keep the Doc Pepper - but 14 hours is just the start of the day - love it

As long as other humans stay out of the way and don't distract (that costs 30 mins trying to find out what you were doing) - it's nice to inject levels of 'intelligence' into code and make it useful.

Tho sure would not be doing it for $30-$50/hour - that's not even a biz.
GreyWolf is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 09-01-2007, 09:51 PM   #66
GreyWolf
So Fucking Banned
 
Join Date: Jun 2007
Posts: 2,036
Quote:
Originally Posted by psili View Post
Fuck man... If those damn "interpretors" would just accept the code how I wrote it, a missing ";" wouldn't be an issue. I blame all my wasted web development error debugging on engineers making shit too complicated ;) -- It's a semi-colon for god's sake. Sorry. !!!!!!

j/k... kind of.
Tut tut - don't blame the compiler
GreyWolf is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 09-01-2007, 09:56 PM   #67
GrouchyAdmin
Now choke yourself!
 
GrouchyAdmin's Avatar
 
Industry Role:
Join Date: Apr 2006
Posts: 12,085
PHP is a set of routines written in C that usurps other third party libraries written in C and creates a hodgepodge system of bizarrely named routines which usually do things, but sometimes don't do what you expect, depending on the release, the day of the week, the season, phase of the moon, et al..

Perl used to be, but it's been capable of rewriting itself, in itself, for quite a few years, now.
__________________
GrouchyAdmin is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 09-01-2007, 10:04 PM   #68
Bro Media - BANNED FOR LIFE
MOBILE PORN: IMOBILEPORN
 
Join Date: Jan 2004
Location: Tinseltown NL
Posts: 16,502
perl sucks...
Bro Media - BANNED FOR LIFE is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 09-01-2007, 10:06 PM   #69
psili
Confirmed User
 
Join Date: Apr 2003
Location: Loveland, CO
Posts: 5,526
Quote:
Originally Posted by GrouchyAdmin View Post
PHP is a set of routines written in C that usurps other third party libraries written in C and creates a hodgepodge system of bizarrely named routines which usually do things, but sometimes don't do what you expect, depending on the release, the day of the week, the season, phase of the moon, et al..

Perl used to be, but it's been capable of rewriting itself, in itself, for quite a few years, now.
GA, what scripting language / framework would you use to build a website?
__________________
Your post count means nothing.
psili is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 09-01-2007, 10:16 PM   #70
GrouchyAdmin
Now choke yourself!
 
GrouchyAdmin's Avatar
 
Industry Role:
Join Date: Apr 2006
Posts: 12,085
Quote:
Originally Posted by psili View Post
GA, what scripting language / framework would you use to build a website?
It really depends on the task at hand. I do use and support PHP, but I don't pretend that it always does things intelligently. For instance, PHP uses literals (as does C) for defines, such as:

TRUE = 1
FALSE = 0

This creates problems when it doesn't define (or care) about the data, wether it's a string, or a numeric. For instance: strpos.

If you have:

Code:
$data="hello";
$testfor="h";
$test=strpos($data, $testfor);
echo ($test) ? "'$testfor' found in '$data'.\n" : "'$testfor' not found in '$data'.\n";
It would say 'h' not found in 'hello', because the 'h' is at the beginning, or offset 0, which also means FALSE to PHP.

In C you get around this by declaring data types, but with PHP you have to use the '===' test directive, which is basically a really lame way of saying 'if this literally means the same as that'.

There's plenty of strange things with different functions as libraries, and PHP have grown over the years - sometimes a function is binary safe, so you can pass anything, other times, you can only use strings. It's messy, but it's getting better.
__________________

Last edited by GrouchyAdmin; 09-01-2007 at 10:18 PM.. Reason: Clarification.
GrouchyAdmin is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 09-01-2007, 10:41 PM   #71
psili
Confirmed User
 
Join Date: Apr 2003
Location: Loveland, CO
Posts: 5,526
Hahaha...

I'm not a school-taught anything (well, journalism / creative writing), but I hate that shit myself; putting in triple equals sometimes to test a false is retarded compared to double equal.

I only deal with building websites. Personally, I find it difficult, sometimes, to try and find the right "framework" for my task at hand. There's PHP frameworks to help make my duties more efficient (smarty, off the top of my head) and there's Java ones ( spring, off the top of my head). Plus a bazillion others, such as Ruby on Rails -- one I've played with a little and though I hate saying the moniker of "R.O.R", I do dig how quick a website can be prototyped with it.

Anyway, all that shit aside, I think there's a disconnect between how laymen refer to those who do work by using terms like "programmer" / "coder" / "whatever".

In the end of my babble .... Grouchy, thanks for hooking up Wolfy.

Quote:
Originally Posted by GrouchyAdmin View Post
It really depends on the task at hand. I do use and support PHP, but I don't pretend that it always does things intelligently. For instance, PHP uses literals (as does C) for defines, such as:

TRUE = 1
FALSE = 0

This creates problems when it doesn't define (or care) about the data, wether it's a string, or a numeric. For instance: strpos.

If you have:

Code:
$data="hello";
$testfor="h";
$test=strpos($data, $testfor);
echo ($test) ? "'$testfor' found in '$data'.\n" : "'$testfor' not found in '$data'.\n";
It would say 'h' not found in 'hello', because the 'h' is at the beginning, or offset 0, which also means FALSE to PHP.

In C you get around this by declaring data types, but with PHP you have to use the '===' test directive, which is basically a really lame way of saying 'if this literally means the same as that'.

There's plenty of strange things with different functions as libraries, and PHP have grown over the years - sometimes a function is binary safe, so you can pass anything, other times, you can only use strings. It's messy, but it's getting better.
__________________
Your post count means nothing.
psili is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 09-01-2007, 11:29 PM   #72
sortie
Confirmed User
 
sortie's Avatar
 
Industry Role:
Join Date: Mar 2007
Posts: 7,771
Quote:
Originally Posted by GrouchyAdmin View Post

If you have:

Code:
$data="hello";
$testfor="h";
$test=strpos($data, $testfor);
echo ($test) ? "'$testfor' found in '$data'.\n" : "'$testfor' not found in '$data'.\n";
It would say 'h' not found in 'hello', because the 'h' is at the beginning, or offset 0, which also means FALSE to PHP.
That's does not look like an error or anything strange to me.
I don't do php, so tell me if I'm wrong:

You tested for the "string position" of "h" and it retuned position zero, which means it was found!! The first index of a string is "0", so it found "h" in the very first index of the string "hello".

Then you do a boolean test on the result for the "echo", correct?.

You can only do a boolean test of a result that will return either 0 or 1 and nothing else.

Change the "h" to "o"

$testfor="o";
$test=strpos($data, $testfor);

And it returns "4" right?

If the "h" was not found then the function either returns "-1" or "string::nopos", right?

Neither of those are boolean values.

Your example doesn't illustrate a problem with php, instead it illustrates that you tried to do a boolean test on a non-boolean result.

Right???
__________________
sortie is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 09-01-2007, 11:46 PM   #73
darksoul
Confirmed User
 
darksoul's Avatar
 
Join Date: Apr 2002
Location: /root/
Posts: 4,997
The problem is not programmers. I bet there are plenty good programmers around here.
The reason why flakes are always brought to discussion is because of
the cheap webmasters.
I've had several gfy'ers shit themselfs when they hear $60/h quotes
so they naturally get the cheaper coder and come back to complain
on gfy few weeks later.

Flakes exist only because theres a market for cheap programmers
that do a half assed job.
__________________
1337 5y54|)m1n: 157717888
BM-2cUBw4B2fgiYAfjkE7JvWaJMiUXD96n9tN
Cambooth
darksoul is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 09-01-2007, 11:54 PM   #74
tony286
lurker
 
tony286's Avatar
 
Industry Role:
Join Date: Aug 2002
Location: atlanta
Posts: 57,021
Quote:
Originally Posted by sortie View Post
I read the screen shots of the post and you told the guy you would get to it in a few days. After a few days you should have contacted him and told him you were not going to do it.

You told him to wait and he did.

It was then up to you to tell him to stop waiting.

What if you had started it in a few days, then finished and contacted him and he said "Oh, sorry man, I didn't wait, I had someone else do it so I don't need what you worked on". You would be pissed, right?
I agree,if he didnt want to do it. He should of just told him, its very simple.
tony286 is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 09-01-2007, 11:55 PM   #75
GrouchyAdmin
Now choke yourself!
 
GrouchyAdmin's Avatar
 
Industry Role:
Join Date: Apr 2006
Posts: 12,085
Quote:
Originally Posted by sortie View Post
Then you do a boolean test on the result for the "echo", correct?
Not quite. For PHP, anything that isn't 0 is considered to be legitimate. I used a ternary operator because I love 'em.

Another way of writing it would be if ($test != FALSE) { echo "Found." } else { echo "Not found." }

See the link on strpos above; my shorthand was a little difficult to read if you're not familiar with the nuances of PHP, but it's valid.

Code:
<?php
$data="hello";
$testfor="h";
$test=strpos($data, $testfor);
echo ($test != FALSE) ? "'$testfor' found in '$data'.\n" : "'$testfor' not found in '$data'.\n";
?>
It's precisely the same, only with more text in it. As noted, 0 has the same value as FALSE, so unless you explicitly test for it, you can have nasty results.
__________________
GrouchyAdmin is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 09-02-2007, 12:03 AM   #76
Harrison Richard
Confirmed User
 
Join Date: Oct 2005
Posts: 199
Quote:
Originally Posted by darksoul View Post
The problem is not programmers. I bet there are plenty good programmers around here.
The reason why flakes are always brought to discussion is because of
the cheap webmasters.
I've had several gfy'ers shit themselfs when they hear $60/h quotes
so they naturally get the cheaper coder and come back to complain
on gfy few weeks later.

Flakes exist only because theres a market for cheap programmers
that do a half assed job.
QFT.

You are already destined to fail and you are already losing money if you even consider hiring a programmer for under 100/hr to create and maintain something critical to your business.
__________________
i sale executive summaries of threads
Harrison Richard is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 09-02-2007, 12:05 AM   #77
darksoul
Confirmed User
 
darksoul's Avatar
 
Join Date: Apr 2002
Location: /root/
Posts: 4,997
Quote:
Originally Posted by Harrison Richard View Post
QFT.

You are already destined to fail and you are already losing money if you even consider hiring a programmer for under 100/hr to create and maintain something critical to your business.
haha, true
tell that to the gfy crowd though
they like it cheap even if it fails once in a while
__________________
1337 5y54|)m1n: 157717888
BM-2cUBw4B2fgiYAfjkE7JvWaJMiUXD96n9tN
Cambooth
darksoul is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 09-02-2007, 12:07 AM   #78
GrouchyAdmin
Now choke yourself!
 
GrouchyAdmin's Avatar
 
Industry Role:
Join Date: Apr 2006
Posts: 12,085
Quote:
Originally Posted by Harrison Richard View Post
You are already destined to fail and you are already losing money if you even consider hiring a programmer for under 100/hr to create and maintain something critical to your business.
As a rule of thumb, I find that it's a bit difficult to take someone seriously when they're running mission critical applications on a virtual server.

Quote:
Originally Posted by darksoul View Post
haha, true
tell that to the gfy crowd though
they like it cheap even if it fails once in a while
Cash is king, and the cheaper, the better. So what if the car catches fire once in awhile. Wait, no, cars are worth paying for..
__________________
GrouchyAdmin is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 09-02-2007, 01:58 AM   #79
sortie
Confirmed User
 
sortie's Avatar
 
Industry Role:
Join Date: Mar 2007
Posts: 7,771
Quote:
Originally Posted by GrouchyAdmin View Post
Not quite. For PHP, anything that isn't 0 is considered to be legitimate. I used a ternary operator because I love 'em.

Another way of writing it would be if ($test != FALSE) { echo "Found." } else { echo "Not found." }

See the link on strpos above; my shorthand was a little difficult to read if you're not familiar with the nuances of PHP, but it's valid.

Code:
<?php
$data="hello";
$testfor="h";
$test=strpos($data, $testfor);
echo ($test != FALSE) ? "'$testfor' found in '$data'.\n" : "'$testfor' not found in '$data'.\n";
?>
It's precisely the same, only with more text in it. As noted, 0 has the same value as FALSE, so unless you explicitly test for it, you can have nasty results.

It's precisely the same in the sense that both methods are completly wrong.

If you program in C, then you know that strpos is not a boolean function.
It MAY return a boolean value but it will also return an interger which is 0 ,
which is confused as boolean zero. But, in this fuction, zero is not a boolean value yet you tried to evaluate it at as such.

You have to tell php that you want to perform an incongruent comparison by using the "===" operator.

http://en.wikipedia.org/wiki/Congruent

See zero and FALSE are not EQUAL but the are congruent!
The "===" says "ignore congruence" and find exact equivalency to
FALSE.

See you can read all the stuff you want on the internet but it obvioulsy can't replace my education that a boolean function returns either zero or one.
If it returns anything else then don't do a boolean test on it.

I didn't know php had "===" but I still would have gotten it right because the code you did is just wrong wrong wrong wrong wrong and I would have never written that, because I know what a boolean value is.

I never wrote even one line of php code and I saw that right away in your example. But yet you still can't see that.

http://us2.php.net/strpos
Quote:
Originally Posted by http://us2.php.net/strpos
Warning
This function may return Boolean FALSE, but may also return a non-Boolean value which evaluates to FALSE, such as 0 or "". Please read the section on Booleans for more information. Use the === operator for testing the return value of this function.

The manual tells you that.
I told you that.

I never read the manual until 5 mins ago and already knew that.

But you don't want to hear that.

Which proves one thing.

Progammers may not be incompetent, but they sure are
Fucking Hard Headed



So I back down on my "self taught programmer can write good code" statement.

Go to fucking college like I did.
__________________
sortie is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Post New Thread Reply
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >

Bookmarks



Advertising inquiries - marketing at gfy dot com

Contact Admin - Advertise - GFY Rules - Top

©2000-, AI Media Network Inc



Powered by vBulletin
Copyright © 2000- Jelsoft Enterprises Limited.