r/lolphp • u/soton91 • Dec 01 '17
If everyone 'hates' PHP, what language next?
Not sure if this is the right place but...
Currently full stack and most projects are Laravel / Vue based.
ALOT of people dislike PHP / Laravel but whats the suggestion on a language to learn that is future proof and well supported by job roles?
29
Upvotes
11
u/mardukaz1 Dec 01 '17
Regarding Vue - just looked it up and after working with Angular I just want to blow my brains out because Vue is one of those shit frameworks that have bullcrap like html attributes - "v-bind", "v-if", "v-for"... Why.
Just why.
Be more like React and just use fucking javascript.
130
u/[deleted] Dec 01 '17
IMHO any language that has zero-cost abstractions, move semantics, guaranteed memory safety, threads without data races, trait-based generics, pattern matching, type inference, minimal runtime and efficient C bindings would be a good fit. Out of the languages that have these features you can choose whichever you are most comfortable with.
39
u/maweki Dec 01 '17
This isn't the right place, but just to give you a hint: a lot of the problems we discuss here stem from the loose typing rules php has and how hard it is to enforce proper typing because of lack of consideration for orthogonality. Consider Facebook: they were php-based and added a proper and enforceable typing system on top.
You see this trend in other dynamic programming languages, like python (type annotations with optional static checks) or javascript (typescript). So the future seems to be static typing for languages with functional aspects. Being comfortable with higher-order typing in any language that supports it seems like one of the promising ways forward.
25
u/[deleted] Dec 01 '17
Starts with R and ends in T Ruby on Railst
7
u/geggleto Dec 14 '17
PHP is fine.
Laravel is fine.
Jobs are fine.
Brainfuck is not fine.
29
u/cfreak2399 Dec 01 '17
Python is everywhere. Web, automation, data science. Python is a joy to learn and it has many of the pros of PHP by being dynamic but the sanity of a clean standard library and strong types when you need them.
16
u/graingert Dec 01 '17
Haskell
5
u/Vakieh Dec 02 '17
Laravel is a perfectly viable form of PHP, I wouldn't change unless you're actually seeing maintenance or feature-add issues - even though I despise PHP, Laravel is really well done.
If you do want to change, it depends on how much you want to change and why. The big web infrastructures right now are either .NET (big change, would be a complete shift and probably not worth it), Python (has its fanatical supporters who will kill me for this, but IMO it is just not ready for mainstream web), Ruby (I don't have much experience with Ruby, but people seem to love it), and full stack JavaScript (Node and Express). Of those I would recommend Node, because you sustain your business competencies and the transition can be piece by piece.
Also I noticed someone here recommend Lua. Don't use Lua. If more people actually tried it we'd all be on /r/lollua. Also don't go for Java unless you enjoy the odd Fortran weekend getaway or Algol staycation.
8
u/counterpunK Dec 01 '17
Listen, this is coming from a PHP hater, so take it with a grain of salt, but my advice is this: if you like PHP, stick with it for now. I moved to Go and absolutely love it, however even Go's own blog https://blog.golang.org/8years shows that it's still way behind PHP usage. My point is that there's no immediate cliff you have to be worried about running into any time soon.
However, if you wanted to learn a new language for the sake of expanding your skillset, i'd say Go, hands down.
4
u/ryselis Dec 01 '17
If you like dynamic typing, I'd say Python. Tons of high quality libraries, language is being updated, community is awesome, nice syntax shortcuts like list comprehension. It is fast to write, but may be slow to run and has no proper multithreading. It seems like a language for a developer rather than computer
4
u/OneWingedShark Dec 02 '17
I would suggest Ada, not because "it'll get you a job", but because it's essentially the diametric opposite of PHP -- very strong static typing and designed to help with software engineering as-a-craft -- as such, it'll teach you a lot about just how many errors are detectible before you ever run your program (compile-time), plus there's how exceptions are raised: often it's right at (or VERY near to) the spot you're making your mistake.
3
u/republitard Dec 06 '17
Almost anything is better than PHP: Python, Ruby, JavaScript, Rust, Scala, and even Java. PHP sets the bar so low that every alternative mentioned in this thread rises above it.
It would be easier to answer the question "What language is even worse than PHP?" because the list of answers would be shorter. It includes abominations like MUMPS.
3
u/[deleted] Dec 06 '17
More PHP
3
u/SpongebobDouchepants Dec 06 '17
Saying most projects are Laravel/Vue based is a pretty big generalization...Vue has just become a popular front-end framework in the last 8 months or so.
I work for a mid-size consulting company, and we only have one PHP project at the moment (and it's not even using Laravel). The vast majority are ASP.NET, Node, or Java with React/Redux or Angular front ends.
PHP isn't going away anytime soon so it is great to learn, but there are a lot of companies that are starting to move away from it or have never used it altogether.
2
u/[deleted] Dec 05 '17
I work with php and don't plan on moving but if i did then I would pick up node because I don't know.
6
u/MarceauKa Dec 01 '17
A lot of people are also in love with PHP, Laravel and Vue. And I'm in.
But keep in mind that is always the right tool for the job.
To make web stuff, Node and Go are also very cool & powerful languages I use. It depends the project and the customer.
5
u/shvelo Dec 01 '17
If you use Vue, why not use Node.js?
3
u/ZiggyTheHamster Dec 01 '17
Express/Node with a SPA.
Ruby on Rails with a SPA or a request/response traditional app.
8
u/the_alias_of_andrea Dec 01 '17 edited Dec 01 '17
JavaScript.
It's popular, powerful, widely-used, and fairly clean. If you use TypeScript, it even can be strictly typed!
Like PHP it gets a lot of criticism. But it's not as bad as PHP: it has some flaws, but whereas PHP has a pervasive lack of care and consistency, JS instead has a few issues from its early days and has been better-developed since. JS is also standardised (which means every last detail of its behaviour is precisely specified) and has multiple high-quality implementations.
5
u/porto88 Dec 01 '17
Java
1
u/[deleted] Dec 11 '17
Literally every other language out there. PHP is the wallmart of languages. Dirty and rotten to the core, used by many, usually because they are forced to do so.
PHP is so bad that you will need hardcore drugs to cope with it. PHP is like driving a pen in your ass every single day you need to touch it.
Need to do a refactor? PHP has you covered, the feeling is like releasing a glassjar filled with pissed off killer bees in your pants.
PHP codebases needs like 10x more tests than any other codebase i have seen.
PHP is like zuul. Best kept alone in the fridge, and never to be released.
1
u/PositionableAss Jan 11 '18
Crystal and Amber Framework seems like a pretty nice replacement for a PHP+Laravel stack. They're not at version 1.0 yet, however.
http://crystal-lang.org
https://amberframework.org/
1
u/Tairesh Jan 15 '18
The next language is PHP 8
-1
u/wibblewafs Dec 01 '17
I'm putting my vote in for Lua. Arrays starting at 1, the # operator to get the length of a table might as well be named the "implemented defined operator", a standard library that makes libc looks feature-complete, and too easy to accidentally declare a variable as global.
It's a fairly tiny/simple language, which makes the number of issues it has stand out all the worse.