Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
ragnese
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
94 ms
·
871.
▲
by
ragnese
6y ago
I'm almost positive that was tongue-in-cheek.
872.
▲
by
ragnese
6y ago
Honestly, PHP is a decent scripting language. It's pretty fast with text processing and you can choose to play fast-and-loose or go in a more type-checked direction. It's basically my least favorite language for "real" p
873.
▲
by
ragnese
6y ago
Not that it matters, but I think it's much more likely he chose Rust specifically for the language features over Go. A lot of Rust's type-system and semantics are inspired by ML-family languages which are well-known to be great fo
874.
▲
by
ragnese
6y ago
> There's no namespacing between packages. They can run right over each other and cause weird bugs. This isn't theoretical; it's what happens when you have a bunch of packages installed. Sorting out performance issues caus
875.
▲
by
ragnese
6y ago
I'm getting quite tired of the nonsense straw men in this discussion. Do you truly believe that I articulated that there was exactly one reason that I think PHP hinders developer productivity? And of course, we brought out the old &quo
876.
▲
by
ragnese
6y ago
I suppose you're right. I did not mean people who shrug and say "Yeah, PHP sucks, but I'll defend its use here for X reason." I was more, in my head, describing people who say "Well, all languages have issues."
877.
▲
by
ragnese
6y ago
You example doesn't work because you tried to access the element with a string, which was ALSO converted to an int. https://repl.it/repls/CompetentBlondInstructions Here I changed your string index to an int and i
878.
▲
by
ragnese
6y ago
Just to tease it out more. What do you mean by functional? I assume that you design your classes to be immutable (only getters with defensive copies when needed). Do you also keep most business logic as pure, static methods on non-data-hold
879.
▲
by
ragnese
6y ago
Perhaps it was condescending, but it was, first of all, not intended to be malicious. I have had the luxury of having used a lot of programming languages for various projects. The first N years of my career, I used mostly C++ and Python. I
880.
▲
by
ragnese
6y ago
My unit tests did not cover all possible strings, unfortunately.
881.
▲
by
ragnese
6y ago
Going a bit off-topic, but I can't imagine doing "functional" programming in PHP or Java. C++ has const and top-level functions (PHP kind of does, but the autoloader...). It has (real) generics. It has move semantics, which i
882.
▲
by
ragnese
6y ago
You remember every bug you've written in 15 years? I'm not that talented. I write bugs all the time. Most of the time, tests save me. You can size me up as just childishly trying to divert blame when I made a mistake, but you'
883.
▲
by
ragnese
6y ago
Except that if you do anything other than mapping, you start taking a performance hit. If you want to use array_map with array_filter, you're now iterating your array twice. Also, if you ever use array_filter, you almost certainly need
884.
▲
by
ragnese
6y ago
PHP arrays can be indexed by ints or strings (at the same time).
885.
▲
by
ragnese
6y ago
Is "powerful" really even the right description? I can't even do a map + filter without looping through the array twice. Ew. I guess I'll just stick with the primitive foreach loop (which leaves a dangling allocated obje
886.
▲
by
ragnese
6y ago
It takes 5 seconds on Google to find a myriad complaints about weird, unexpected, and downright incorrect things that PHP does. That wasn't the point of my reply. The point was that language choice CAN affect productivity. And having a
887.
▲
by
ragnese
6y ago
I'm in a similar boat. I've decided that whatever it is that makes PHP successful must be exactly the same thing that has made JavaScript successful. It's going to sound extremely condescending, but here it is, anyway: I beli
888.
▲
by
ragnese
6y ago
I don't know. I think that global variables, even in PHP, are still poor software engineering. It still, very much, makes the code harder to reason about and debug. In fact, my understanding of the anti-global-vars rhetoric is that it&
889.
▲
by
ragnese
6y ago
Yeah, you're probably right about that. Though, it might take longer to train them to spot every place where they could/should be using some stricter version of the defaults. That's the problem with opt-in safety. On the othe
890.
▲
by
ragnese
6y ago
Yeah, but if you're worried about bugs and security holes, I'm not sure PHP can possibly help more than it hurts. E.g., type juggling: https://www.netsparker.com/blog/web-security/php-type-juggli...
891.
▲
by
ragnese
6y ago
I think what the comment really means by "request scoped" is that the PHP process is totally torn down after each request. In Java you can mutate global state as its running. You can leak memory until you OOM.
892.
▲
by
ragnese
6y ago
Not only is PHP playing catch-up. It's only playing catch-up to Java. That's... not the highest bar, IMO.
893.
▲
by
ragnese
6y ago
> Language improvements A.k.a., Kotlin. :p In all seriousness, though. The only thing PHP still has over Java is that when I say my function takes Foo type, you can't give it null instead.
894.
▲
by
ragnese
6y ago
I'm a PHP "hater", so take this for what it's worth. You are very close to implying that the language doesn't matter if you can hire developers and there are a lot of good packages in the ecosystem. Having worked on
895.
▲
by
ragnese
7y ago
The keyword is "premature". The whole silly meme of "premature optimization is the root of all evil" is a 100% useless statement. Of course, you shouldn't do it yet if it's premature- that's the definition
896.
▲
by
ragnese
7y ago
Exactly. While I think that Swift is a batter language than Kotlin for a couple of reasons, I'd much rather actually use Kotlin for a project.
897.
▲
by
ragnese
7y ago
I do agree. The syntax they chose was not my favorite option. I wish they at least had put the stupid parentheses, so you can think of awaiting as an operation that the compiler "magically" puts on Futures in async contexts. I k
898.
▲
by
ragnese
7y ago
> What do you enter as error type in the type signature? In most cases, it would be sufficient to use Box<dyn Error>, but that requires boxing and thus an allocation, which is something that many libraries want to avoid to be usefu
899.
▲
by
ragnese
7y ago
There's nothing the CEO could say differently. Words don't cancel out the fact that they outright lied and absolutely, intentionally, implemented something that violated the privacy that they promised. It has nothing to do with th
900.
▲
by
ragnese
7y ago
And a related question: How far is too far and/or impractical? I just recently was working on a backend application and was modeling the database entities. The project uses UUIDs as primary keys. Should each entity have its own primary
More ›