PDA

View Full Version : "Whoops!"


Draknek
06-13-2005, 04:53 PM
I decided it would make more sense to have a thread in here for posting site problems, rather than continuing to clutter the update threads.

If you click on the latest addition link on the Doctor Who page (http://www.fiveminute.net/doctorwho/), it might crash your browser. Certainly crashed mine both times I tried. The cause is an infinite loop in the PHP code. From the errors, I'm guessing you're doing something like this:
$handler = fopen($file);
// Read from $handler
When you want to do something like this:
if ($handler = fopen($file))
{
// Read from $handler
}
else
{
// Give error
}

Also, on all the doctor who fivers, the main top image (http://www.fiveminute.net/images/s5ep.png) disappears onmouseover, and doesn't come back. That image is broken on the all seasons page (http://www.fiveminute.net/doctorwho/all.php), too, but that seems to be because it's looking for a png while the 5MDW image is a gif.

Finally, I noticed that the Sci-fivers page (http://www.fiveminute.net/scifivers/) is out of date. Only one of the recent smallville fivers is there, and the DW fivers are still listed there.

:)

Xeroc
06-17-2005, 01:10 AM
Actually I noticed that too, if you go to a "fiver.php" but give no "ep=" it does the same thing.


And yes, it almost crashed my broswer too.


And I think this is dangerous enough to actually point out, as Zeke requested not to be notified of errors.

Zeke
06-17-2005, 02:55 AM
This thread is a good idea, but here's the thing... right now it's a struggle to get done what I "need" to do for 5M. I don't have any spare sitework time at all. As a result, there's literally no exception handling in the PHP code. When I get back to Waterloo I'll have time to tidy up the code, but right now if it works, that's enough. I just have to rely on you guys to tell me when stuff like infinite loops happens.

Xeroc
06-17-2005, 05:56 AM
This thread is a good idea, but here's the thing... right now it's a struggle to get done what I "need" to do for 5M. I don't have any spare sitework time at all. As a result, there's literally no exception handling in the PHP code. When I get back to Waterloo I'll have time to tidy up the code, but right now if it works, that's enough. I just have to rely on you guys to tell me when stuff like infinite loops happens.

Zeke, If you can, you can send me the code, and I'll clean it all up for you - don't worry about my time - it'll honestly take me like 15 minutes to add all the exception handling, etc, and even print out pretty error messages!


If I can - I'd love to help out with fixing the code for you!

Zeke
06-17-2005, 04:55 PM
Much appreciated, X, but the coding is one area where I can't take volunteers. It's not just a matter of programmer's pride -- I have to be able to read my code, and that's hard enough with just my stuff in there, let alone lines I've never seen before.

Draknek
06-17-2005, 05:48 PM
That makes sense. When I posted this, I didn't realise how much stuff you had to do for the anniversary.

Speaking of code-writing, at some point (not now), I'd quite like to clean up your HTML for you. Those font tags and embedded onmouseover really jump out at me whenever I look at the source code. If you don't mind, of course.

Xeroc
06-17-2005, 07:02 PM
Much appreciated, X, but the coding is one area where I can't take volunteers. It's not just a matter of programmer's pride -- I have to be able to read my code, and that's hard enough with just my stuff in there, let alone lines I've never seen before.
Not even if it was very logically organized and had lots of comments? :P

Zeke
06-17-2005, 07:18 PM
Again, no. If anyone's going to clean up my code, it'll be me. I've learned some CSS and I'm going to learn more, but until then, I feel absolutely no guilt whatsoever for using "deprecated" tags like <font> and [b]. They get the job done perfectly well.

Gatac
06-17-2005, 08:02 PM
CSS is the classical example of "Somebody beat us to it, so now we have to take it, make it elephantine and scream at everybody who doesn't like it", as applied to text formatting in HTML. After all, Netscape did a lot of stuff before it was actually standardized...that accounts somewhat for the compatibility mess, but damn, we needed *something* to work with.

/W3C rant

Gatac

Draknek
06-17-2005, 10:54 PM
Fair enough.

Gatac: I'm not sure what you think is elephantine about CSS, but it wasn't introduced just because someone didn't like HTML formatting. There is no way in HTML to create a uniform theme without dotting font tags and bgcolor attributes all through the code. With CSS, you can apply a style to every element of a certain type, and override that as necessary.

To me, that just makes a lot more sense.

Also, I don't know what compatibility mess you're talking about. For the basic features of CSS (this covers far more than you can do in HTML, if you exclude tables), browser support is very good, and very predictable.

Nan
06-18-2005, 07:29 AM
Mozilla/Firefox and Opera are good as far as support goes. Internet Explorer still has loseriffic CSS support, but supports proprietary tags that aren't even clearly marked as such OR established CSS tags. For shaaaaame.

CSS is an excellent tool when used properly. See The CSS Zen Garden (http://www.csszengarden.com/) for a good example.

Using linked CSS files allows you to separate your style and content information, makes your files smaller, and make sweeping style changes comparitively easily.

I prefer XHTML 1.0 to HTML 4.0 anyhow.

Gatac
06-18-2005, 08:01 AM
CSS is plenty flexible and powerful, yes, but I venture to say that 95% of the websites out there don't use it and don't have to. When I just want some text to be in bold, you can bet that I'm not going to write a CSS class to do that. I'm not denying that CSS is wonderful and confirms to the abstract trinity of HTML-Javascript-CSS as in Content-Design-Interactivity, but there's literally everything AND the kitchen sink in the specs, so if I call it elephantine, I do believe that I have a good reason to do so. The fact that I haven't done any coding in a few years and still remember most of the Netscape tags versus basically nothing with CSS proves squat, but I don't think I'm the only one who has that problem.

Compatibility problems weren't caused by CSS; that started with the use of non-standard tags, but it could've been headed off at the pass if they'd gotten off their ass in getting CSS done. By the time browsers could reasonably be expected to support CSS, the damage was already done. Never mind that it's theoretically far superior - it simply came too late. Add the smothering market percentage of Internet Explorer and its ludicrously slow upgrade cycle, and you know why the web is such a formatting mess today.

The problem with all solutions (including XHTML) is that it's easier to write broken HTML than it is to get everything right. It's no-win - as long as browsers can render non-compliant HTML, things won't change, and if they suddenly switch to strict enforcement of standards, then the web will be nothing more than the world's largest collection of error messages. Kinda like recycling - brilliant idea, but it took (and will still take) a lot of time before it's really widespread.

Gatac

Nan
06-18-2005, 12:38 PM
You're a ray of sunshine, you are.

Gatac
06-18-2005, 01:18 PM
I try. :)

Gatac

NAHTMMM
06-18-2005, 07:03 PM
CSS is an evil bourgeois plot by a bunch of evil elite antisocial nerds to add so much unnecessary complexity to webpage coding that only elite nerds will be able to code webpages.

You just wait and see. Five years from now you'll have to create separate CSS documents just to do this or this or this or even this!


http://img.photobucket.com/albums/v27/Sloublues/Smilies/endworld.gif

Gatac
06-18-2005, 07:30 PM
*chants*

C-S-S
Kiss my...cheek!

No, seriously, I like CSS, but some of the followers are a bit intense.

Gatac

Draknek
06-18-2005, 10:46 PM
The cynicism! It's killing me!

CSS is an excellent tool for certain tasks. Most notably, any time you want to style the appearance of more than one object at a time. For these things, you can do it in HTML, but once you've learnt CSS it becomes a lot easier.

HTML is also a good tool for other tasks, but for the most part, as good a tool as CSS. If you know CSS, you can use it. If you know HTML, you can use that. It's personal preference.

The only place I can think of that HTML is easier to use than CSS is tables. Now, I can see some argument in the idea that you shouldn't use tables for presentation (have you ever looked at a website in a text-mode browser?), but at present, table-less designs are too much effort to be worth-while for most.

With a website of any decent size, most of it falls under "making everything look consistent".

evay
06-19-2005, 03:35 AM
::shakes head in quiet bewilderment:: With a site the size of mine, I'd have to be insane not to use some kind of style sheet. And as far as code complexity, maybe I'm just an amateur, but I fail to see how a font tag/then size tag/then weight tag/then center tag is less cumbersome than saying "class=header." But then, I only know basic HTML.

I don't understand how you could use CSS to create a table.

NAHTMMM
06-19-2005, 03:57 AM
With a site the size of mine, I'd have to be insane not to use some kind of style sheet.
Templates certainly meet that description ;)

And as far as code complexity, maybe I'm just an amateur, but I fail to see how a font tag/then size tag/then weight tag/then center tag is less cumbersome than saying "class=header."
You are forgetting the powers of Ctrl-C / Ctrl-V! ;)





*is apparently feeling silly tonight :oops:*

Zeke
06-19-2005, 04:15 AM
::shakes head in quiet bewilderment:: With a site the size of mine, I'd have to be insane not to use some kind of style sheet.

Not that I'm claiming not to be insane, but you realize I don't use any at 5M yet, right?

Xeroc
06-19-2005, 04:52 AM
Again, no. If anyone's going to clean up my code, it'll be me. I've learned some CSS and I'm going to learn more, but until then, I feel absolutely no guilt whatsoever for using "deprecated" tags like <font> and [b]. They get the job done perfectly well.
And you shouldn't feel any guilt!


My motto, is go with what works, works best, and doesn't take more time than it needs to.


Therefore, I use <font>'s for some things <span>'s for other, <... class="...">'s for other things, and stylesheets for many other things! Each thing is good at its specialty.


Also, standards aren't always helpful or annoying. They're helpful when the improve the situation, make things work better, and make thigs easier. They're annoying when they're unrealistic, don't include things people want or include things no one could care about or use, or when they're unneccesarily complex and time-consuming. Some are more helpful, others more annoying, but most are a mix, IMHO.


Also, I was only offering to fix the PHP Back End for you so no more people's computers crash because of a typo. And you really should fix that bug.

Zeke
06-19-2005, 05:11 AM
Also, I was only offering to fix the PHP Back End for you so no more people's computers crash because of a typo.

Your MOOM's a typo.

evay
06-19-2005, 01:29 PM
With a site the size of mine, I'd have to be insane not to use some kind of style sheet.
Templates certainly meet that description ;)
and if I wanted to do something new, which doesn't fit into a previously-created template?...

And as far as code complexity, maybe I'm just an amateur, but I fail to see how a font tag/then size tag/then weight tag/then center tag is less cumbersome than saying "class=header."
You are forgetting the powers of Ctrl-C / Ctrl-V! ;)
No, I'm talking about two different things. "Ease of typing" and "code complexity" are not synonymous. I can always paste a bunch of tags, but the browser still has to read and execute each and every one each and every time. If the single command is "class=text," then it goes to one external document and reads one string of code and can cache that. Again, I'm an amateur, but that how I learned it.

Also, when I'm looking at my HTML source to fix problems, it's way easier to have that much less material cluttering up the page. Fewer moving parts and all that.


Not that I'm claiming not to be insane, but you realize I don't use any at 5M yet, right?
But you use php and the tag generator program and all that real code stuff -- you don't generate any pages manually any more, do you? So you may still have the issue of code complexity as I noted, but you aren't pasting or formatting by hand.


Ultimately I agree with Xeroc: If it works for you, and doesn't crash anybody, use whatever you like.

Nan
06-19-2005, 03:50 PM
Your MOOM's a typo.

Heheheheheheh. :mrgreen:

PointyHairedJedi
06-20-2005, 08:08 PM
Code nerds give me the willies. :shock: