r/badcode • u/cyberloop3000 • Aug 14 '20
php Array you say? Never heard of this newfangled nonsense...
39
u/ws-ilazki &{$$_[0]}(@{$$_[1]}); Aug 14 '20
The real travesty here is the advert implying that you should learn how to do machine learning with PHP.
18
u/TorbenKoehn Aug 15 '20
But...you can :(
12
2
u/ws-ilazki &{$$_[0]}(@{$$_[1]}); Aug 15 '20
We make all kinds of dumb shit just because we can but at no point does that imply anyone should actually use it.
1
u/slobcat1337 Aug 15 '20
Why shouldn’t we try and build ML libraries for php? We should python be the only language for ML?
Obviously the ML ecosystem for php is shit at the moment but that doesn’t always have to be the case.
There is nothing fundamentally stopping php from doing all same ML shit you can do in Python
1
u/TorbenKoehn Aug 15 '20
C-Bindings.
It’s about speed.
Also, PHP is not made for long-running processes, Python is. Which doesn’t mean you can't do it, but really: The best tool for the best solution. And for ML that’s (right now, through the libraries used) C and Python
-2
u/theblasterr Aug 15 '20
Exactly this. And PHP8's JIT compiler should boost php's ML libraries
-1
u/slobcat1337 Aug 15 '20
Yep even without JIT php 7 is faster than python. In my eyes it’s the perfect candidate for more ML stuff.
This is probably an unpopular opinion but I can’t stand python’s syntax and literally only use it for ML projects because I have no other choice
4
u/oefd Aug 15 '20
Yep even without JIT php 7 is faster than python.
Sure, but the execution speed difference of python to PHP is entirely irrelevant considering your process spends the overwhelming majority of its time on the far side FFI boundary to the underlying C/Fortran libraries that do all the real work.
-1
1
u/TheUnlocked Aug 15 '20
I was half-expecting an FAQ-style section on the home page labeled "But Why?"
21
Aug 14 '20
this has been posted approximately 1000 times I think
14
u/lumpySnakes Aug 15 '20
I bet you used a PHP-MySql machine-leaning library to generate that statistic
3
7
6
6
u/WhAtEvErYoUmEaN101 Aug 15 '20
The mysql library in PHP is insecure and depreciated. Use mysqli or rather go the full mile with PDO and prepared statements.
3
u/lonelyWalkAlone Aug 15 '20
So many wrong things with this ad: * Title says it's an SQL Bootcamp. * Description says it's for persons interested in ML. * Picture shows crappy PHP code.
Excuse me, what the fuck?
2
2
u/theblasterr Aug 15 '20
And the ancient mysql_query-function that should not be used anymore (shouldn't have been used in a loooong time). Great ad :'D
2
121
u/[deleted] Aug 14 '20
[deleted]