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

help-circle
  • How do you sort through the trash though?

    The thing about SO is there really is a ton of poorly phrased or poorly researched questions asked each hour. So, how do you find quality questions to dedicate your time answering? How do you search QA when there’s a number of similar questions asked?

    That’s the thing StackOverflow was trying to solve.

    There’s millions of people with programming questions that think their problem is unique or they simply don’t understand how to research their issue, so you end up with a ton of bad or duplicated questions.


  • W h a t ? I couldn’t disagree with your comment more.

    StackOverflow, and the slew of substacks, are/were almost entirely volunteer run. From the questions, to the answers, to the moderation.

    Like yeah, there’s assholes everywhere, and yeah tech jockies are always snooty when they think they know better. I don’t think any of this is the fault of StackOverflow necessarily, it’s just a format that isn’t a forum. They were, and are, a QA site where they wanted answers from the people that knew. Not discussions. Not the same question asked a hundred times. Not quick homework answers.

    StackOverflow is one of the defacto ways I still get programming answers and knowledge from. So much so that I haven’t needed to ask a question in a long time. It’s robotic, it’s uniform, it’s boring, but it’s is/was such a useful website.

    IMO it’s downfall was not promoting more community and branching our beyond QA and into discussion based topics and chats. Not being able to see that people needed a space outside their QA model and not trying to harness that in their hay day cost them everything. Now AI has scrapped all their content.


  • ProtecyaTec@lemmy.worldtoTechnology@lemmy.world*Permanently Deleted*
    link
    fedilink
    English
    arrow-up
    1
    ·
    edit-2
    4 months ago

    Not a single modern system does that. It’s terrible practice and won’t even pass automated code reviews with sane settings.

    What you’re talking about is semantics. At a base level, whether you use a templating engine, include / require, or just straight up mix HTML / PHP - PHP “stops execution” to output to the browser. The few exceptions to this that I can think of is if it’s instead handing off that responsibility to JS or some other frontend processor.

    Templating engines are cool. They make it easier to separate your views from logic. It makes interloping more straight-forward and possibly more maintainable (though, not always - Engines don’t save from bad practices), but I do not agree that it’s defacto. I think the strength of PHP is it’s ease to just jump into it and get something working, right “out of the box”. The ease of mixing PHP and HTML is a boon from an entry level aspect. Low entry level leads to wider adoption, leads to more discussions, more volunteers for FOSS, more bug reports, more more more.

    I could create a vanilla PHP application that organizes views just as well without a templating engine which could be understood by someone with baseline PHP knowledge - that’s good thing. It’s inherit to PHP and I won’t need to worry about keeping any templating library updated or ported to a new engine. In my made-up vanilla app, I wouldn’t do what 4chan did in their views, but I may do what WordPress does in your example because, used sparingly, in an organized application, it’s not that big of a deal. For the most part though, I do like to keep my HTML views and my PHP logic separate in an MVC kind of way either through templating or just straight up includes.


  • ProtecyaTec@lemmy.worldtoTechnology@lemmy.world*Permanently Deleted*
    link
    fedilink
    English
    arrow-up
    2
    ·
    edit-2
    4 months ago

    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.


  • ProtecyaTec@lemmy.worldtoTechnology@lemmy.world*Permanently Deleted*
    link
    fedilink
    English
    arrow-up
    1
    ·
    edit-2
    4 months ago

    Really though, it doesn’t.

    Github -> WordPress

    Github -> 4chan

    I absolutely hate the way 4chan formats their HTML + PHP intermingling in views. That’s not to say WordPress doesn’t do this as well, but oh man in a much better, cleaner, and more sparingly way. The 4chan imageboard view Github -> 4chan is absolute chaos. Why this wasn’t rewritten is beyond me. That’s just the first thing I see as I peruse the source, I can’t imagine it gets much better from here.

    Here’s a fun exercise: What’s the deepest nest in this loop? Github -> 4chan Bonus points: What’s the deepest nested statement in the whole source?


  • 4 of the richest men in the world who own 7/10 of the most popular websites on the internet donated to and sat at The Presidents inauguration. They own the information pipeline and can literally control propaganda completely unchecked and unsupervised. Most of those gun toting freedom fighters use those platforms because it’s all they know. Their family is on it, their business is on it, their news comes from it, they get their daily dopamine kicks from it.

    There isn’t going to be any Civil War. It’s just going to be a slow rotation into what Russia currently is now. Little by little by little, hardly noticable changes, over a long enough period of time (say 4 years or so), until one day they wake up and say “Well, it was better then but there’s nothing we can do about it now.” and go about their day.

    The next war is going to be a war of ideas and a war of messaging. We can’t rely on online outreach and have to be proactive IRL spreading messages that it really is a class war. There’s no better time than now, no more apparent point in history than today, it’s just pulling those people away from the propaganda for them to realize it. Somehow, We The People, need to convince the Boiling Frogs.


  • IMO it’s a logistics problem.

    The wealthy own the Internet. 7/10 of the top websites on the entire Internet are owned by the same people at Trump’s inauguration. The interest is no regulation so that they can keep pouring money into marketing tactics, ethical and unethical, for engagement. The bottom line is wealth, power, control.

    Their websites are visited by Billions, daily. They control the narrative. That doesn’t even get into news networks.

    Education has been eroded for close to a century now.

    Technology has grown far faster than we can keep up with.

    AI is going to make information control, data gathering, and data compiling faster/easier.

    How do you fight a beast this big? How can any other party get their message and their narrative out to the masses on par with the wealthy? How do you convince the ignorant of harmful things that they can neither believe nor fathom?

    I truly have little hope for non-dystopian future.


  • Sure is going to be more difficult to make progressive change in a fascist state. I’ve no doubt conservatives are going to be more open to change than their counterparts, but something tells me that those changes aren’t going to be anywhere near progressive.

    Yeah, I do blame the voters who sat this election out or voted 3rd party. Absolute ignorance in the face of factual, tangible datapoints.

    “Oh, the democrats should have campaigned harder! Oh, they should have been more progressive!” while conservatives just consistently lie through their teeth, skirt the law, and prey on the weak and ill-informed. While conservatives are open-faced about their regressive policies.

    Change takes time, but yeah, let’s sit this one out. Real progressive. Nothing like watching the trolly going toward the wrong side of the track and saying “Oh, not my problem, I didn’t touch the lever! Whatever happens, it’s not my fault because I did nothing to help or hurt the situation! My hands are clean!”


  • I don’t know, y’all can point fingers in every direction, but the fact is - those voters who didn’t show up to vote, voted 3rd party, or voted Republican knew who Trump is and what the outcome would be. Project 2025 was laid out in full right in front of us. We all saw his previous 4 years in office. We saw the repeal of Roe with a majority court. These (potential) voters just don’t care about progress or people and want to speed up the burning of Rome. US Presidential elections have been binary in everyone’s lifetime here.

    There’s no excuse other than simply “I don’t care” regardless of which excuse you want to pick from the box. The House, Senate, and Supreme Court are all lost - they have absolute free reign to do whatever they want in the next 4 years. The best case scenario is that it’s not as bad as last time. The worst case scenario is the US becomes reclusive, regressive, and more corrupt akin to other dictator run countries. Just like those other dictator run countries, in the worst case scenario, there will be no revolution if/when things go “too far” because they hold the power and have the support to stomp down any opposition to dust.

    It’s certainly a sad state of affairs, and in no sane world should DJT have won a 2nd term, but here we are, watching the circus erect their tents while we whisper in the stands.




  • No good will come of this “Weekend at Bernie’s” farce of an election.

    Hard disagree.

    Anybody who has actually followed what Trump has done / is doing vs what Biden has done / is doing knows there’s a clear distinction between the two. One is clearly a worse choice. It reads like you’re just intoxicated by the smelling of your own farts.