• 0 Posts
  • 14 Comments
Joined 2 years ago
cake
Cake day: September 13th, 2023

help-circle
  • I completely disagree.

    Intermingling PHP and HTML is one of PHP strengths. The processing/executing difference you’re describing is almost always negligible due to how PHP is optimized (specifically for this kind of thing - outputting HTML to the browser sometimes).

    Seriously, compare this to the 4chan image board view we really aren’t looking at the same source code. In comparison, the WordPress function is blocked, purposeful, together. It’s a single CSS block output all at once. On the otherhand, in the linked 4chan discussion board PHP file, it echos as strings, broken up by multiple conditionals, and is difficult (even from an IDE perspective on highlighting) to tell where a block starts and where it ends (again due to it being echo’d in strings, and broken by conditionals). Trying to modify this blocked CSS is going to be wayyyyyyyyyyyyyyyyyyyy easier than trying to modify a bunch of printed HTML strings broken up by multiple nested conditionals. Plus it’s just straight-up easier to read and straight-forward to understand what the function does right away.

    To harp on this even more, one of the benefits of blocking HTML in this way is IDE highlighting. In your example, if you were to pop that into a modern IDE like VSCode, it’ll highlight tags and allow collapsing like a normal HTML doc. It’ll probably even highlight the CSS as expected. On the other-hand, by echoing / printing HTML strings, IDEs aren’t going to highlight these things as HTML since they’re PHP strings, and in the case of the imageboard, it’s going to struggle finding matching open/end tags due to PHP strings and broken conditionals. I’d much prefer the WordPress example over echo / printing multiple lines of HTML strings (this is really a pet-peeve of mine).

    I can’t think of a single system that doesn’t “stop PHP executing” at some point to output HTML in some way. Maybe an app that dynamically pulls it’s views in through JS I guess.

    For comparison to future readers, this is just a small portion of the imageboard which goes on like this for another 600 lines:

    	if( $resno ) {
    		$closed = $log[$resno]['closed'] || $log[$resno]['archived'];
    		
    		if( !$stripm ) {
    			$msg .= '<div class="navLinks mobile">
    	<span class="mobileib button"><a href="/' . BOARD_DIR . '/" accesskey="a">' . S_RETURN . '</a></span> <span class="mobileib button"><a href="/' . BOARD_DIR . '/catalog">' . S_CATALOG . '</a></span> <span class="mobileib button"><a href="#bottom">' . S_BOTTOM . '</a></span> <span class="mobileib button"><a href="#top_r" id="refresh_top">' . S_REFRESH . '</a></span>
    </div>';
    		}
    
    			if( !$stripm ) $msg .= '<div id="mpostform"><a href="#" class="mobilePostFormToggle mobile hidden button">' . S_FORM_REPLY . '</a></div>';
    	} else {
    		if( !$stripm ) $msg .= '
    <div class="navLinks mobile">
    	<span class="mobileib button"><a href="#bottom">' . S_BOTTOM . '</a></span> <span class="mobileib button"><a href="/' . BOARD_DIR . '/catalog">' . S_CATALOG . '</a></span> <span class="mobileib button"><a href="#top_r" id="refresh_top">' . S_REFRESH . '</a></span>
    </div>
    <div id="mpostform"><a href="#" class="mobilePostFormToggle mobile hidden button">' . S_FORM_THREAD . '</a></div>';
    	}
    

    Formatting and structure is important for a readable framework / project and longevity. 4chan had none of this - Moot took the bag and ran and whoever took it over just left left the PHP standards/organization in 2003.




  • I did, and you’re full of shit.

    It’s not just the salute that shows this being the case (which is extremely obvious and intentional, again just by watching the video). It’s the history of anti-union practices, the history of lying and being caught lying, the history of supporting far-right movements. Over time this seems to form what’s called a “pattern”.

    You’re literally sleep-walking through life or intentionally trying to mislead the conversation.









  • If you still have your Amazon Prime subscription, Facebook Account, Twitter Account. The literal, very least you could do, is not support the companies of these literal Billionaires, with a capital B.

    We need to bring back community, actual in person communities. Supporting local businesses and bring people together for discussions and socializing. As a society, we are too disconnected. It’s too easy to just throw a comment online (what I’m doing now) and move on. Actual change comes from society, and as a society we need to make change together.