carmatic Posted November 18, 2009 Share Posted November 18, 2009 do you agree? Link to comment https://www.neowin.net/forum/topic/846686-picwhat-beautiful-html-looks-like/ Share on other sites More sharing options...
0 Raa Posted November 18, 2009 Share Posted November 18, 2009 I think you're reading into it a bit much mate :p But yes, it does look very well set out... Obviously wasn't written with Frontpage :laugh: Link to comment https://www.neowin.net/forum/topic/846686-picwhat-beautiful-html-looks-like/#findComment-591862126 Share on other sites More sharing options...
0 The_Decryptor Veteran Posted November 18, 2009 Veteran Share Posted November 18, 2009 I like how he uses tags from HTML5 that IE won't parse, but then goes and encodes every non ASCII character as an entity. Link to comment https://www.neowin.net/forum/topic/846686-picwhat-beautiful-html-looks-like/#findComment-591862146 Share on other sites More sharing options...
0 +jamesyfx Subscriber² Posted November 18, 2009 Subscriber² Share Posted November 18, 2009 Code isn't meant to be beautiful. It's the part designers don't want you to see. :laugh: That's just clean code which will help the developer or anyone who's interested in the makeup of the site to read it easier. Link to comment https://www.neowin.net/forum/topic/846686-picwhat-beautiful-html-looks-like/#findComment-591862148 Share on other sites More sharing options...
0 Pc_Madness Posted November 18, 2009 Share Posted November 18, 2009 Gah, but how do you get the HTML to be tabbed correctly when your generating it in PHP, mine always goes to the ****. :( Link to comment https://www.neowin.net/forum/topic/846686-picwhat-beautiful-html-looks-like/#findComment-591863052 Share on other sites More sharing options...
0 MikeChipshop Member Posted November 18, 2009 Member Share Posted November 18, 2009 Does it count if it's not a full pages HTML? He's used PHP includes for portions of the page, portions that theoretically could have been messy. Link to comment https://www.neowin.net/forum/topic/846686-picwhat-beautiful-html-looks-like/#findComment-591863066 Share on other sites More sharing options...
0 The_Decryptor Veteran Posted November 18, 2009 Veteran Share Posted November 18, 2009 Gah, but how do you get the HTML to be tabbed correctly when your generating it in PHP, mine always goes to the ****. :( I cheat by running it through an XSLT transformation that does pretty printing and such. Makes it much easier if you start out writing it as proper HTML5 code. Link to comment https://www.neowin.net/forum/topic/846686-picwhat-beautiful-html-looks-like/#findComment-591863166 Share on other sites More sharing options...
0 HawkMan Posted November 18, 2009 Share Posted November 18, 2009 I think you're reading into it a bit much mate :pBut yes, it does look very well set out... Obviously wasn't written with Frontpage :laugh: people who at best only tried frontpage 1 are entertaining :p Link to comment https://www.neowin.net/forum/topic/846686-picwhat-beautiful-html-looks-like/#findComment-591863174 Share on other sites More sharing options...
0 XerXis Posted November 18, 2009 Share Posted November 18, 2009 (edited) I assumed this was going to be a joke and btw, there is nothing beautiful about that code ;) The php includes for starters are very ugly and potentially messy. And why would you use UTF-8 encoding and still replace every non ascii character with it's html entity. Another one who doesn't know **** about character sets (far too many of those people on this world i'm afraid) Edited November 18, 2009 by XerXis Link to comment https://www.neowin.net/forum/topic/846686-picwhat-beautiful-html-looks-like/#findComment-591863192 Share on other sites More sharing options...
0 game_over Posted November 18, 2009 Share Posted November 18, 2009 When will HTML5 be widely used, is it worth learning yet? Link to comment https://www.neowin.net/forum/topic/846686-picwhat-beautiful-html-looks-like/#findComment-591863226 Share on other sites More sharing options...
0 The_Decryptor Veteran Posted November 18, 2009 Veteran Share Posted November 18, 2009 HTML5 is already in use in the majority of browsers and sites. HTML5 is just a standardisation of practises already in use, the parsing algorithm is based on what IE/Safari/Mozilla/Opera did. Old IE only extensions are being promoted to being part of HTML5 if they're useful (and it means the implementations in other browsers are no longer mimicking IE, they're standard) Link to comment https://www.neowin.net/forum/topic/846686-picwhat-beautiful-html-looks-like/#findComment-591863264 Share on other sites More sharing options...
0 lt8480 Posted November 18, 2009 Share Posted November 18, 2009 Gah, but how do you get the HTML to be tabbed correctly when your generating it in PHP, mine always goes to the ****. :( Is there any need for php to generate html tidy? The point of making it tidy is to make it easy to read and edit... but the view source isn't the code you are editing, it should be the php thats tidy, not the outputted html. I suppose it could potentially help with debugging formatting, but if you get your html clean before you throw php around it will always be right. Link to comment https://www.neowin.net/forum/topic/846686-picwhat-beautiful-html-looks-like/#findComment-591863284 Share on other sites More sharing options...
0 Hot Posted November 18, 2009 Share Posted November 18, 2009 Beauty is in the eye of the beholder. Somebody may consider this code professional because it is neatly indented. I consider it amateurish because the author is using inline PHP, and in a .HTML document, which would never even parse the code unless he re-configured his server mime type handling, no less. I seriously urge any budding developers who look at this picture not to take it to heart. Anybody focusing on on their code being "pretty" is most likely doing so because they don't know enough to focus on functionality. In the real world, not only is this a waste of time but it can actually impact your applications negatively. Just the other day, I noticed my new PHP developer indenting the search result HTML in one of our web applications. In this particular application, an average query yields about 1,000 results, all of which have to be displayed for the client without pagination. Simply removing the indentation my apprentice put in reduced the uncompressed output from the 600KB range to about 250KB. Link to comment https://www.neowin.net/forum/topic/846686-picwhat-beautiful-html-looks-like/#findComment-591863360 Share on other sites More sharing options...
0 primexx Posted November 18, 2009 Share Posted November 18, 2009 I cheat by running it through an XSLT transformation that does pretty printing and such. do you mind elaborating on this a bit? sounds interesting. Link to comment https://www.neowin.net/forum/topic/846686-picwhat-beautiful-html-looks-like/#findComment-591866040 Share on other sites More sharing options...
0 Pc_Madness Posted November 19, 2009 Share Posted November 19, 2009 Is there any need for php to generate html tidy? The point of making it tidy is to make it easy to read and edit... but the view source isn't the code you are editing, it should be the php thats tidy, not the outputted html.I suppose it could potentially help with debugging formatting, but if you get your html clean before you throw php around it will always be right. Mostly so it looks professional and it also helps with debugging when your PHP generated section isn't off the screen because of tabbing. :p I wouldn't mind knowing about this XSLT trick as well if its possible. Link to comment https://www.neowin.net/forum/topic/846686-picwhat-beautiful-html-looks-like/#findComment-591866948 Share on other sites More sharing options...
0 The_Decryptor Veteran Posted November 19, 2009 Veteran Share Posted November 19, 2009 I use output buffering in a shared file to grab the result of the PHP script, then run it through a function that creates an XSLT processor based on a file (http://alex.thefrapp.com/pretty_print.xsl), and then runs the PHP output through it, then I output the result. The shared file basically detects the user agent and runs one of 2 output functions based on the buffer (if it's HTML, it outputs the HTML5 doctype and changes "/>" into ">", if it's XHTML it runs it through the XSLT file while outputting the proper XML namespaces and PI). Link to comment https://www.neowin.net/forum/topic/846686-picwhat-beautiful-html-looks-like/#findComment-591867012 Share on other sites More sharing options...
0 wrack Posted November 19, 2009 Share Posted November 19, 2009 Gah, but how do you get the HTML to be tabbed correctly when your generating it in PHP, mine always goes to the ****. :( I use Visual Studio to keep it nice and formatted. Link to comment https://www.neowin.net/forum/topic/846686-picwhat-beautiful-html-looks-like/#findComment-591867046 Share on other sites More sharing options...
0 Pc_Madness Posted November 19, 2009 Share Posted November 19, 2009 Hmm, I did some googling and I came across the Tidy Class, which is built into PHP on windows and an extension on other platforms. $out2 = ob_get_contents(); ob_end_clean(); $tidy = new tidy(); $config = array('indent' => TRUE, 'output-xhtml' => TRUE, 'wrap' => 200, 'indent-spaces' => 6); $tidy->parseString($out2, $config, 'UTF8'); $tidy->cleanRepair(); echo $tidy; Not sure if it will have any negative affects on a live site, might be worth doing only locally. Link to comment https://www.neowin.net/forum/topic/846686-picwhat-beautiful-html-looks-like/#findComment-591867890 Share on other sites More sharing options...
0 White Cuban Posted November 19, 2009 Share Posted November 19, 2009 its the font :D Link to comment https://www.neowin.net/forum/topic/846686-picwhat-beautiful-html-looks-like/#findComment-591867900 Share on other sites More sharing options...
0 vhane Posted November 20, 2009 Share Posted November 20, 2009 Beauty is in the eye of the beholder. Somebody may consider this code professional because it is neatly indented. I consider it amateurish because the author is using inline PHP, and in a .HTML document, which would never even parse the code unless he re-configured his server mime type handling, no less.I seriously urge any budding developers who look at this picture not to take it to heart. Anybody focusing on on their code being "pretty" is most likely doing so because they don't know enough to focus on functionality. In the real world, not only is this a waste of time but it can actually impact your applications negatively. Regarding "pretty code", it's been my experience that developers who are anal about how their source code is formatted also tend to be anal about the quality of their code. The few developers that I've worked with who were really inconsistent with their source code formatting were also pretty useless at application design, as if their inability to be consistent with their code formatting pointed to some deeper inability to marshal components together in a logical fashion. Link to comment https://www.neowin.net/forum/topic/846686-picwhat-beautiful-html-looks-like/#findComment-591872112 Share on other sites More sharing options...
Question
carmatic
do you agree?
Link to comment
https://www.neowin.net/forum/topic/846686-picwhat-beautiful-html-looks-like/Share on other sites
19 answers to this question
Recommended Posts