Leaving PHP is too expensive
suckyninja.azurewebsites.net
suckyninja.azurewebsites.net
Kind of silly, but also kinda a good point. If a framework is awesome but deployment for side projects is either $50 a month or a huge pain, it may be not worth it for the small fish..
In the past certain events such as the rise of Ruby on Rails made a compelling reason to move, but now PHP has very productive frameworks of its own. Even though a strong case could be made that working in rails is still a bit more productive, PHP is close enough that it's a win in the short term.
From the other side, PHP isn't as performant as Java, Node or Go for certain things, but that gap has also narrowed (especially with PHP7). In this case, the biggest returns from switching would appear only after your app has hit a certain scale and at that point switching is harder.
This would have been a compelling argument.
What the author argued instead was that Heroku, Azure and other hosts were too expensive and $10/month hosting at Laravel Forge locks him into PHP. I don't get that at all, especially coming from a Swede.
How much is it worth to learn something like Rails that would give you an edge in building an MVP for a side project? How about learning Node and getting an idea of what so much of the development world is using? If you're living in a wealthy norther European country, is the hosting cost really something that you want to direct what education you'll invest into your career?
Dreamhost is affordable enough and will do such things.
Problem 1) SBT cannot run with 512 ram, so you cannot compile locally. If using phat jars, that means you need to upload a 100mb jar every time you want to deploy, vs just a git pull and a build. May or may not matter to you.
Problem 2) Once you start doing some actual work, the JVM itself is taking up a few 100 MB of ram, and the OS takes up a fair bit.. this leaves something like 128MB ram for your app best case.. for a lot of apps this is not enough. I had to go up to at least 1 GB VMs to get my medium complexity Scala app to work in prod, and I have been tuning JVMs for many years.
fallocate -l 4G /swapfile
chmod 600 /swapfile
mkswap /swapfile
swapon /swapfile
swapon -s
Works pretty well. You can't actually run too much on it however if you use a tomcat you actually get a decent Request per Second something like 100r/s.And you don't need 1GB VMs. 512 MB Scala Apps are working fine. It just depends on the technology.
"Staying PHP is too expensive" Yeah? How big did Facebook get before starting to migrate off of it? Do you think you're going to be Facebook big? Probably not.
I don't mean to sound snarky, and I know language bashing has been around as long as computers have. It would be nice though if this community, out of all of them, could at least acknowledge the fact that every language has it's pros and cons, we will all have our favourites, and just because we like X doesn't mean Y is horrible.
I grew up writing PHP. I still do. I've written some applications that are handling millions of hits per day on a $20 Linode. You know what? For the longest time, despite having some some neat things in the past, I felt ashamed that all I knew was PHP. Because of comments like this. People bashing it constantly. It made me feel like a bit of a script kiddie, that I wasn't a "real" programmer unless I knew language _____. I had a huge, 2 year lull in my side projects where I tried to learn Ruby, Java, Python, before getting frustrated and dropping the project. I finally got over that and went back to PHP and suddenly I'm finishing, launching, and making a bit of money off my side projects again.
For anyone that happens to read this; don't worry what language you write in. Just make cool, functional shit, that's really all that counts.
I'm building a network scanner at the moment and I have to say that even Python let alone PHP isn't really cutting it. As I've been learning Elixir (for a project in my spare time) and getting to grips with the OTP you really do start to realise that functional programming and the Actor Model amongst all the syntactic sugar is a big win.
Sure if you are bashing out a PHP websites great. But if you are building something with lots of processes or parallelisation requirements PHP (or Python for that matter) is not your friend. In conclusion use the right tool for the job.
As everyone knows we should all stop using PHP and start using lisp, given the choice :-) http://www.paulgraham.com/avg.html
With that being said, you can accomplish some pretty interesting things if you think outside the box a little bit. I wrote a small application to perform an ETL between various data sources (MySQL, an old version of MSSQL, various third party API's, CSVs). I populate a queue and spawn up as many PHP processes as I want/need (php -f /thread.php {$id}) and each one runs on their own, grabbing an item from the queue, processing it, then grabbing another one. Currently I run about 64 of these "threads" at a time with no issues, which allows me to sync a few million records relatively quickly. Best tool for the job? No. Does it work? Hell yeah. Had I tried to learn a new language to get this done I probably never would have finished it or it would be way harder for me to maintain/debug in a language I'm not familiar with or use often enough to efficiently troubleshoot when something comes up weeks/months/years down the road.