Jump to content

.josh

Staff Alumni
  • Posts

    14,780
  • Joined

  • Last visited

  • Days Won

    43

Everything posted by .josh

  1. .josh

    PHP no nos

    With regards to the email filter presented, all that it does is run the value through a regular expression. Nothing magical nor complicated. well sir, that's where you are wrong. regex is magical.
  2. .josh

    PHP no nos

    overall I lean towards readability. I get off to regex but most people run away screaming even thinking about it. If I can accomplish the same thing using an strpos and an explode or some other similar thing, I'll usually go for that, as it would be easier for future people touching it to figure it out.
  3. .josh

    PHP no nos

    @roopurt: okay for your situation I can see how you would say doing it that way might work out better for you, so if that works for you, then more power to you Agreed. And to extend that, I hate how people liberally escape quotes to make up for stuff like that. How can having a long string of escaped quotes possibly help anybody? I've seen more than plenty of syntax errors posted on the forums that were due to people getting lost in their quoting endeavors. Agreed. At best, this does not help readability. At worst, it hurts error handling capabilities. yeah... I really don't see the point in this, with few exceptions, like for instance, a switch with a bunch of single line code blocks. I don't have issue with the break; being added to the end of them. To be fair though, this is kind of a hangup from the good old days. With high res monitors, 80 chars wide should not be a big deal, except catering to people who refuse to update their hardware...on the other hand...I guess trying to sort through shit from a command line might suck, but I'd counter that with..why are you messing with a script from a command line instead of a real editor anyways?
  4. sure, that would work, though opposite of what you're asking. If it finds anything that is not a-z or A-Z it will return true. So true means the string has more than just letters, false means that it IS only a-z or A-Z if you want to have it return true if the string is only case insensitive letters, you would need to do this: preg_match("/^[a-z]+$/i',$str);
  5. .josh

    PHP no nos

    Designers should not be making html "templates" to be handing to coders. Coders should be making a system that designers can use, so they can easily add new pages/content. It is pages/content that is constantly being added to a site, not code. Look at any CMS as an example. And yes, javascript generated content will not show up in the view source, and you are correct, you would need a live DOM inspector to see that...but I can take your argument and apply it to your own class. PHP kicks out the javascript etc... there is no way for php to know ahead of time what it's going to do with whatever you give javascript. Javascript is going to take what you give it and do its thing client-side, and you may or may not get errors (and they may or may not be browser (version)? specific, and php ain't gonna know anything about it.
  6. .josh

    PHP no nos

    eh... at the end of the day, if that works for you, then go for it. I personally don't see the benefit in swapping one syntax for another. Running a validator is IMO not that big a deal. Not to mention, I don't really see how that code maintains the spirit of MVC. If I were a designer just trying to focus on content and html, I'd have to learn to code to do it your way.
  7. .josh

    PHP no nos

    @roopurt: Seems like an awful lot of baggage just to prevent some syntax errors...one of the easiest types of bugs to squash. And what's to say you won't typo the php code itself! But I remind myself that I am by no means as versed a coder as most people around here, so I'm sure there's some greater benefit to it I'm not seeing...
  8. .josh

    PHP no nos

    I don't disagree that there is nothing inherently wrong with register globals. But it was apparently abused to the point that it was changed to being off by default, and soon to be altogether removed. It's the same argument as guns killing people: guns don't kill people, people kill people. That's right, but if there's so many people killing each other, it's a problem that needs to be addressed, and a good way to address that is by controlling the guns. My logic with $_REQUEST being like register globals was not that it in and of itself is bad, but that it's easier to get lazy about programming, and end up opening up abusing it the same way as register globals was abused.
  9. .josh

    PHP no nos

    tibberous said he hates it when people use $_GET or $_POST instead of $_REQUEST (IOW he was saying you should use $_REQUEST). I was questioning why he felt that way, and argued that if anything, using $_REQUEST is not ideal.
  10. .josh

    PHP no nos

    so tibberous, is using $_GET and $_POST instead of $_REQUEST just a personal pet peeve of yours, or do you have a real reason why that's some kind of bad practice? If anything, I would argue the opposite, as $_REQUEST holds both, it's one step closer to the concept of register globals. ...and same goes with someone using their own framework they built...I sort of fail to see how that's bad practice. Do you know the ins and outs of all the existing "big name" frameworks out there? And btw they did have to start somewhere themselves; at one point in time they were also no-name frameworks.
  11. .josh

    PHP no nos

    okay, I can understand doing that for large amounts of html but seriously what you have there makes it less readable IMO.... Why not just use heredoc instead?
  12. ah, quote nomination. Dunno...I mean, I did mildly lol at it. Felt the need to IM someone about it even (before I got down to your post, even), but dunno, just not feelin' it. Bit too cliche and predictable. I guess to be fair, some of the other ones I have are too...hmm...fuck, now I have to sit here and make an actual decision about something...
  13. are you implying that I am businessman?
  14. I remember seeing return of the jedi in theaters when I was a kid. My dad said he took me to empire strikes back too, but I don't remember that one. Anyways, you should check around, you're more than likely able to find them playing somewhere in your area, occasionally, or make some kind of request for it. A lot of movie theaters do like matinees or midnight matinees where they play older movies. Popular one is rocky horror picture show. And many theaters allow you to rent out screens for a couple hours for a fairly reasonable price (people do it all the time for meetings or bday parties). Point is, you don't have to hope for it, you can make it happen for relatively cheap, if you're that intent on it.
  15. Of course. I can also play this game, in some other parts of the world $8/hr is not much at all Well It's certainly not much where I live, either. My point was that it might be lots of money where the OP lives, so area/cost of living should be taken into consideration.
  16. I know right? I just found out last week. And the week before, I found out the world was round.
  17. well $8/hr is a lot of money in other parts of the world. And yes, there is a world beyond the U.S.
  18. i do agree that the traditional blue links seem old and worn out. Vote #3! It's still got some tradition mixed in it, for those who prefer to dip their feet in the pool instead of cannonball in!
  19. #3 is my first choice. #2 is my 2nd choice
  20. Well you're the button pusher, you tell me, lol. If it's not a hard thing for you to do, then uh...go forth and push buttons. Yeah.
  21. "People don't follow links, therefore we shouldn't make it easy to notice links." How does that make sense? The easier the links are to notice, the higher the chance of someone actually following them. I see that, and raise you with: "People must not be buying our stuff because we aren't advertising enough or making our ads big and bright enough or maybe we should keep calling them over and over again because maybe they didn't answer the phone because we missed them." My point being that (IMO) most people don't follow links because they don't want to, not because they can't find them.
  22. yes, I saw it. I'm not disagreeing with the notion that the links could stand out a bit more. My point was nobody bothers to follow important links anyways, regardless of how we mark it up, so why bother.
  23. maybe if people actually made use of the links (like to the rules, or the manual), this might be worth looking into
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.