Skip to content

u/bkanber

In this archive from Dec 2010 to Oct 2024

5
posts
213
comments
2
media
907
score

You're supposed to pick the tools that are a) right for the job and b) feel good in your hands.

I wouldn't pick PHP for a desktop GUI app (I mean, do whatever the heck you want for fun and learning, no judgement there), but if you're making anything that serves websites or SaaS in production, PHP is still one of the best tools out there, especially for deployment and server management. php-fpm is much easier and cheaper (timewise and hardware-wise) to manage than python wsgi, for example.

I grew up on PHP and still run a SaaS company built on top of it. My tastes have changed over the years though. I primarily do web/SaaS, and I find myself using node.js for all my side projects. Both PHP and node satisfy "a) right for the job", but these days, node.js hits "b) feels better in my hands".

The most important thing is to be able to ship products that work and that customers use. Everything else is secondary. If you're a solo developer working on low stakes side projects, prioritize your fun and education; write that network driver in 'Brainfuck'. If you're trying to build a project solo or with a small team, use the language and platform that's going to get you to launch most efficiently. If you're planning on building a large company with a team, pick the language and platform that you can hire and train easily against. They are all just tools and at the end of the day, pick the ones you prefer.

13 points

And likewise, I appreciate you being so open and gracious here! The more I think about it, the more I realize you and I don't actually disagree. I think we just have different thresholds and tolerance levels. Despite what it may sound like, you and I actually agree on labor rights -- I'm a strong proponent (for me, labor unions !== labor rights, but still). But our difference seems to be one of threshold: you want companies to strive for labor excellence, where I'm content with companies simply being "not awful." Similarly, I think I have a higher threshold for, lets call it "potentially grating personalities".

And we both agree on the really WTF stuff. Honestly, some of the stuff he does makes me worried that he's completely cracking up. I'm worried he's only got another 5 years in him before he either drives everything into the ground or goes completely crazy. I would love to see him finish his various works though, so I hope I'm wrong.

2 points

No, that's not the reason. It's just that I don't think these are particularly egregious. Not letting workers unionize? That's most industries, and moreso a political issue that I can't bring myself to say "fuck you" to someone over. The coronavirus argument you make is one-sided; they brought people back to work with safety equipment, and if you didn't go back to work you got laid off like the rest of America. The company couldn't float the employees while not producing, so those are the choices: start producing again, or have layoffs. Maybe he had a cavalier public attitude about it, but they still did implement a ton of safety procedures and equipment for everyone. So again, I can't bring myself to say "fuck you" to him for this. I won't say "fuck you" to him for anything in his personal life either. To me, a "spotty at best" safety record is more like a "do better" than a "fuck you". Taking personal credit for his companies' work is also a public persona thing that I have trouble saying "fuck you" about as well. The only things I agree with you on are the weird shit he does with his stock prices and that whole pedophile thing. But to me, those are more "what the fuck?" moments than "fuck you" moments.

I see the problems with Elon Musk and his companies. I don't worship him. But I certainly don't hate the guy, and I want him to continue what he's doing and producing the things he's been producing. His companies aren't great to work for, but they're better than most of the other "high octane" companies in the US, and they're actually doing stuff I believe in. So I won't judge his personal life, I give his companies like a C+ or B- in terms of labor treatment, but I give his vision an A+. All in all, I still can't say "fuck you" to the guy.

If you want me to say "fuck you" to someone, I'd happily say it to Zuck. I'd also say it to Bezos, but I'd also keep using Amazon. If you want something that doesn't reflect terribly well on me, use my hypocrisy towards Amazon rather than my lenience towards Musk.

2 points

None of this really bothers me. You take any random dude and put him in the spotlight like that, you could write basically the same exact list of complaints. No difference from literally any other movie star or celebrity out there. I just wanna let the man do his work without having to call him an ass.

0 points

It's O(1). The data structure is a hash table. The way that works is that the key is hashed, and the hash is used essentially as a memory address. It is possible that two keys can cause a hash collision in which case we get something just a little bit worse than O(1), but it is definitely O(1)

3 points

Yes. More abstraction. Seriously. You can abstract away authentication, cursors and pagination, search queries, response parsing, exception and error handling. Plus you can also unit test the whole shebang, use dependency injection to manage transport, mock edge cases, catch changes to the Reddit API more easily, ensure that changes to your code doesn't break anything else, and so on and so forth.

It is up to the engineer or architect to decide how much abstraction is appropriate for their codebase. But it's ridiculous to claim that php doesn't benefit from abstraction. And just because php was "built for the request/response cycle of the internet" doesn't mean it is good at handling any one api's vagaries.

8 points

You should run all requests with user input through a validator before using them. Your validator would catch this issue. Never trust any type of validation to happen automatically.

If you want more insight into why Symfony isn't catching this issue, you'd have better luck opening an issue on the Symfony github or something. They may have a reason, or they may not. But to me it seems like /u/nashkara is right; rather than 'string' you should expect this to return 'string or bag of strings'.

2 points

Couple of reasons.

Low barrier to entry = lots of noobs littering the ecosystem.

Inconsistencies in the standard library (needle/haystack, haystack/needle).

Before PHP 7, PHP wasn't a "real language". Yes PHP 5 has OOP, but to me, the retooling of PHP's core to use an AST (abstract syntax tree) is what makes it a real language now. I've been using PHP for over a decade, and it's always been great for me, but I still see PHP 7 as its rebirth. And that was somewhat recent. So a lot of the folks that "grew up" on Python and Ruby and Java never really saw PHP as a serious thing. Basically, if you learned to code anywhere between say 2006 and 2016, you probably have an unreasonable distaste for PHP just based on what the landscape looked like back then.

24 points

TBH just browse the Wordpress theme store until you find one that hits the checkboxes. You'll likely find a free theme you like. If not, there are many high-quality premium themes available in the $20-100 range. There are also lots of 3rd party sites. Just browse.

And don't forget you can change the theme later if you're using a CMS. The theme is not that big a decision point. 99% of your site's value will come from the content, so spend most of your time there.

1 points

Not all of machine learning is big honking deep neural stuff. I find that most machine learning in practice is foundational bits and pieces, a classifier here, a regression there. Php does very well in those situations, and I have indeed used this library's random forest in production. If it gives my statement any more clout, I'm a ml researcher that has published two books. When researching my last book, I discovered that while JavaScript has NO acceptable random forest library, this phpml one is actually quite solid. If a little slow ;) but perfectly performant when running as a queue consumer or in a job thread.

6 points

Keyboard shortcuts

Move and act

jork
Next / previous post or comment
Enteroro
Open the post
f
Open the media viewer
s
Save
h
Hide (the toast has Undo)
Tab
Right after an action: the toast's Undo
x
Collapse the comment
v
Next layout: cards, compact, grid

Go to

/
Search
gthenh
Home
gthena
All
gthens
Subreddits
gthenl
Library
?
This list
Esc
Close a menu or this list

In the viewer

←or→
Previous / next file
↑or↓
Previous / next post
korj
Previous / next post
Space
Play / pause
m
Mute
z
Zoom
s
Save
o
Open the post (on its own page: back to it)
Esc
Close

Keys do nothing while you type in a box.