Author Topic: How do big projects get away with such shitty code?  (Read 2263 times)

Mike

  • Jackass In Charge
  • Posts: 11256
  • Karma: +168/-32
  • Ex Asshole - a better and more caring person.
How do big projects get away with such shitty code?
« on: August 06, 2007, 12:56:40 PM »
Code: [Select]
<body <?php if($this->data['body_ondblclick']) { ?>ondblclick="<?php $this->text('body_ondblclick'?>"<?php ?>
<?php if($this->data['body_onload'    ]) { ?>onload="<?php     $this->text('body_onload')     ?>"<?php ?>
 class="mediawiki <?php $this->text('nsclass'?> <?php $this->text('dir'?> <?php $this->text('pageclass'?>">
<div id="globalWrapper">
<div id="column-content">
<div id="content">
<a name="top" id="top"></a>
<?php if($this->data['sitenotice']) { ?><div id="siteNotice"><?php $this->html('sitenotice'?></div><?php ?>
<h1 class="firstHeading"><?php $this->data['displaytitle']!=""?$this->html('title'):$this->text('title'?></h1>
<div id="bodyContent">
<h3 id="siteSub"><?php $this->msg('tagline'?></h3>
<div id="contentSub"><?php $this->html('subtitle'?></div>
<?php if($this->data['undelete']) { ?><div id="contentSub2"><?php     $this->html('undelete'?></div><?php ?>
<?php if($this->data['newtalk'] ) { ?><div class="usermessage"><?php $this->html('newtalk')  ?></div><?php ?>
<?php if($this->data['showjumplinks']) { ?><div id="jump-to-nav"><?php $this->msg('jumpto'?> <a href="#column-one"><?php $this->msg('jumptonavigation'?></a>, <a href="#searchInput"><?php $this->msg('jumptosearch'?></a></div><?php ?>
<!-- start content -->
<?php $this->html('bodytext'?>
<?php if($this->data['catlinks']) { ?><div id="catlinks"><?php       $this->html('catlinks'?></div><?php ?>
<!-- end content -->
<div class="visualClear"></div>
</div>
</div>
</div>
<div id="column-one">
<div id="p-cactions" class="portlet">
<h5><?php $this->msg('views'?></h5>
<div class="pBody">
<ul>
<?php foreach($this->data['content_actions'] as $key => $tab) { ?>
<li id="ca-<?php echo Sanitizer::escapeId($key?>"<?php
  if($tab['class']) { ?>
class="<?php echo htmlspecialchars($tab['class']) ?>"<?php }
 ?>
><a href="<?php echo htmlspecialchars($tab['href']) ?>"<?php echo $skin->tooltipAndAccesskey('ca-'.$key?>><?php
 echo htmlspecialchars($tab['text']) ?>
</a></li>
<?php  } ?>
</ul>
</div>
</div>
<div class="portlet" id="p-logo">
<a style="background-image: url(<?php $this->text('logopath'?>);" <?php
?>
href="<?php echo htmlspecialchars($this->data['nav_urls']['mainpage']['href'])?>"<?php
echo $skin->tooltipAndAccesskey('n-mainpage'?>
></a>
</div>
<script type="<?php $this->text('jsmimetype'?>"> if (window.isMSIE55) fixalpha(); </script>
<?php foreach ($this->data['sidebar'] as $bar => $cont) { ?>
<div class='portlet' id='p-<?php echo Sanitizer::escapeId($bar?>'<?php echo $skin->tooltip('p-'.$bar?>>
<h5><?php $out wfMsg$bar ); if (wfEmptyMsg($bar$out)) echo $bar; else echo $out?></h5>
<div class='pBody'>
<ul>
<?php  foreach($cont as $key => $val) { ?>
<li id="<?php echo Sanitizer::escapeId($val['id']) ?>"<?php
if ( $val['active'] ) { ?>
class="active" <?php }
?>
><a href="<?php echo htmlspecialchars($val['href']) ?>"<?php echo $skin->tooltipAndAccesskey($val['id']) ?>><?php echo htmlspecialchars($val['text']) ?></a></li>
<?php ?>
</ul>
</div>
</div>


I posted this to the team over at SM since sometimes we get shit for having "complex" template code.  One of them pointed out this bit
Code: [Select]
<?php }
?>
><a href="<?php echo htmlspecialchars($val['href']) ?>"<?php echo $skin-

The idiots are leaving PHP mode just to output > and again just to output "

How do they not see that doing that just makes the code 500x harder to read and needlessly slows it down?

micah

  • A real person, on the Internet.
  • Ass Wipe
  • Posts: 6915
  • Karma: +58/-55
  • Truth cannot contradict truth.
    • micahj.com
Re: How do big projects get away with such shitty code?
« Reply #1 on: August 06, 2007, 12:59:55 PM »
perhaps because they want to see how the HTML code generates without running through the PHP processor first?

they're probably using a WYSIWYG editor and are switching back and forth between "code view" and "layout view"'

thats my guess at least
"I possess a device, in my pocket, that is capable of accessing the entirety of information known to man.  I use it to look at pictures of cats and get in arguments with strangers."

Steve

  • This 49%er supports Romney
  • Just a Jackass
  • *
  • Posts: 16120
  • Karma: +31/-410
  • Mr. Mom
Re: How do big projects get away with such shitty code?
« Reply #2 on: August 06, 2007, 02:17:38 PM »
>>since sometimes we get shit for having "complex" template code.

i can follow the code for smf, that means its not complex. what kind of idiots are throwing that at you lol
hey ethic if you and i were both courting lily allen..... oh wait, which one of us has a relationship that lasted more than the bus ride home?