The Bard in Green
- Technology Consultant.
- Software Developer.
- Musician.
- Burner.
- Game Master.
- Non-theistic Pagan.
- Cishet White Male Feminist.
- Father.
- Fountain Maker.
- Aquarium Builder.
- Hamster Daddy.
- Resident of Colorado.
- Anti-Capitalist.
- Hackerspace Regular.
- Traveler of the American West.
- 0 Posts
- 117 Comments
The Bard in Green@lemmy.starlightkel.xyzto
Programming@programming.dev•What We Lost the Last Time Code Got CheapEnglish
6·3 months agoJust have AI scrape Twitter for people complaining about applications they wish existed, and have the AI make them.
I mean… in 2026, this is probably a viable business strategy tbh.
The Bard in Green@lemmy.starlightkel.xyzto
Programmer Humor@programming.dev•Hamster ITEnglish
161·5 months agoThis is the way.
The Bard in Green@lemmy.starlightkel.xyzto
Programming@programming.dev•I'm making a "pure" PHP site. The code works (mostly, still WIP), but I really feel like I'm doing a lot of "wrongs"English
2·6 months agoVery rarely, but probably only in situations where you would too. No, usually I put my HTML in HTML files. They’re usually building blocks… page components, not a full page. I regulate the page flow in PHP, and I don’t like it cluttered up with tons of HTML, inside or outside of echos. I have been known to do stuff like this though:
echo “<div class=‘whatever-container’>”.$Page->pagecomponents[‘contents_of_some_html_file’].“</div>”;
If I go and look at $Page, it will show that $this->pagecomponents is set by reading my template files in so I can grab HTML structures dynamically. If the contents of pagecomponents[‘component’] are set dynamically (they usually are), there won’t be some ugly <php ?> tag in the HTML file, but my $Page class will handle populating it somehow. The architecture I usually use is $Validator is instantiated for a page load, then $Data, so whatever user activity $Validator has detected and cleaned up tells $Data what to do with the data backend (which is usually a combination of Maria and Redis) then $Data gets fed into $Page which figures out what page to build, looks at all my HTML building blocks and figures out how to put them together and populate whatever it needs to. So it will usually be something like (very simplistically)
$Validator = new Validator($_GET, $_POST);
$Data = new Data($Validator);
$Page = new Page($Data);
renderPage($Page->Page);
The Bard in Green@lemmy.starlightkel.xyzto
Programming@programming.dev•I'm making a "pure" PHP site. The code works (mostly, still WIP), but I really feel like I'm doing a lot of "wrongs"English
2·6 months agoI don’t like reading it captain pedantic. Deal with it. :)
The Bard in Green@lemmy.starlightkel.xyzto
Programming@programming.dev•I'm making a "pure" PHP site. The code works (mostly, still WIP), but I really feel like I'm doing a lot of "wrongs"English
2·6 months agoOn the one hand, you do have good reasons to use classes.
- Interacting with your database.
- Sanitizing your inputs.
- Building pages from templates.
Rather than piecemeal loading all these functions from every page where a bunch of them aren’t being used, you can create three classes.
-
has all your database interactions in it and then you can treat all database interactions as an object. My queries are usually all executed with $Data->runQuery();
-
Since you’re working in raw PHP with no frameworks or libraries, you NEED to validate every input users send, or bots are going to spam the shit out of your database. The way you have things now, you’re probably either calling some function(s) on every form submit (every time $_SERVER[‘request_method’]===‘POST’) OR you’re just not doing it. When working in raw PHP, I always write a Validator class which sits in between every $_GET and $_POST and makes damn sure what ever is coming in meets a set of criteria that I expect. I’m happy to go into the architecture of this with you if that would be helpful.
-
I’m assuming you might have something for each page like
include(‘header.php’);
<my page specific PHP is here>
include(‘footer.php’);
Instead, I like to write a page builder class that constructs my pages dynamically based on routing. So then any given page becomes and instance of $Page and you populate it with various methods (like $Page->renderForm(‘form’);) You can also then base the routing logic on your form submissions.
On the other hand… it’s probably fine at this stage to just not use classes and if it works, why fix it?
You probably feel like you don’t have a need for classes because you’re just not comfortable working with them yet, and need more experience thinking through architecture. This is fine. This is normal. This is exactly where you should be, given what you say about your experience level.
SQL injection probably didn’t work because PDO protects you from that to some extent. Doesn’t mean you shouldn’t account for it in your input processing.
Most of my HTML comes from echo.
Good, it should. I effing HATE reading through code where people are tagging in and out of PHP all the time. It looks so ugly. That’s not a standard best practice, just MY personal practice. IMHO, for HUMAN readability purposes, HTML should either be in echos or template files.
I fricken hate this:
<a> <bunch> <of> <html> <php? run_some_php('here'); />Don’t effing make me read that. I co-run an independent coding shop and whenever we work in PHP, I tell people please not to do that.
The Bard in Green@lemmy.starlightkel.xyzto
Programmer Humor@programming.dev•SaltyEnglish
3·7 months agoSteve Rogers, when the monkeys flew.
The Bard in Green@lemmy.starlightkel.xyzto
Selfhosted@lemmy.world•What are you using n8n for?English
11·8 months agoThank you. You saved me a Google search.
The Bard in Green@lemmy.starlightkel.xyzto
Programming@programming.dev•AI Is still making code worse: A new CMU study confirms
30·8 months agoCapitalism is happy to have cheap code that works “well enough” to sell, and mostly prefers it to expensive code that works “really well.”
The future is full of buggy ass code that runs most services and devices, who’s main priority is vacuuming up data about its users and everyone and everything around them, and then a few high quality products and services only the rich can afford.
The Bard in Green@lemmy.starlightkel.xyzto
Selfhosted@lemmy.world•what would you do with an old dell server?English
2·9 months agoBut did your winter heating bill go down? Asking for a friend.
The Bard in Green@lemmy.starlightkel.xyzto
Selfhosted@lemmy.world•what would you do with an old dell server?English
4·9 months agoAdd a GPU and mine some crypto, add a GPU and mine some crypto, add a GPU and mine some crypto, earlie in the mornin’!
The Bard in Green@lemmy.starlightkel.xyzto
Programmer Humor@programming.dev•Vibe Coding
23·10 months agoMy absolute favorite thing about LLMs is how when they do that they explain the problem with “my code” to me.
The Bard in Green@lemmy.starlightkel.xyzto
Selfhosted@lemmy.world•What is the easiest way to have a self hosted git server?English
5·11 months agoSecond Forgejo. Easiest deploy I’ve ever done.
The Bard in Green@lemmy.starlightkel.xyzto
Programmer Humor@programming.dev•Who needs MongoDB when you have JSONB?
29·11 months agoYeah! Postgres is great!
- Mutters something under his breath about MariaDB.
The Bard in Green@lemmy.starlightkel.xyzto
Programmer Humor@programming.dev•Vibe coding is great for MVP's
38·11 months agoMy experience working with a vibe coder hired by one of our clients is actually that’s it great for MAXIMUM VP, as in a viable product made up of just under 40k lines of typescript, plus 90+ Node libraries for an app that amounts to a login page, a Square payment gateway and a user settings page (it’s seriously just a signup page for a coastguard and weather alerts service that the rest of our team built in Python and Rust). It crashes if it can’t talk to a database server that hosts no actual databases. It crashes if it doesn’t have the Square API secrets as envars, but the LLM also hard coded them into the API calls. It actually crashes if you try to run it any way other than “npm run dev” (so I srsly set up a service that runs it as npm run dev, as the ubuntu user).
The Bard in Green@lemmy.starlightkel.xyzto
Programmer Humor@programming.dev•the myth of the good tech giant
51·1 year agoThe way laws and bylaws describe the jobs of CEOs and CFOs, the most qualified people to do those jobs are sociopaths. Empathy is practically a disqualifying personality trait.
The Bard in Green@lemmy.starlightkel.xyzto
Selfhosted@lemmy.world•Turn linux server into a router?English
1·1 year agosystemd’s networkd has a built-in DHCP server; check option ‘DHCPServer’ and section ‘DHCPServer’ for that (same man page as above).
Is that true in Debian? If so, cool. I did not know that.
The Bard in Green@lemmy.starlightkel.xyzto
Selfhosted@lemmy.world•Turn linux server into a router?English
2·1 year agoI’m happy to answer specific questions as you dig into it. :) Good luck.
This is a different world. Stop asking yourself “What tooling is available to me?” and start asking yourself “What tooling do I want, that I can describe to Claude?” Most of the interfaces I interact with recently are interfaces I designed.
tl;dr: Fuck Cursor. It’s yesterdays vibecoded garbage.