6 ms·
I was never able to move from PHP to something else. I tried nodejs for a few months but it always seemed much more complicated. Especially the dependency and b
by geek_at 3y ago
I was never able to move from PHP to something else. I tried nodejs for a few months but it always seemed much more complicated. Especially the dependency and build system.
With PHP to move my code to a production system I just need to run `git pull` and the new codebase is instantly live. No builds, no server updates.
The Markup system of PHP is also very very handy. No more messing with handlebars or external libraries.
Realistically you can start a small site with PHP and HTMX and no external PHP package dependencies in an evening.
- aaviator42 3y agoI'm in the same boat! PHP is so insanely functional. There are a lot of powerful frameworks but I personally like to keep my projects very simple with minimal dependencies and nothing comes close in terms of how fast I can go from idea → prototype → production. PHP + SQLite is a beast.
- zelphirkalt 3y agoNit: Most code written in PHP is the (an) opposite, of what many people discussion programming languages would call "functional". It is procedural, and maybe object oriented, although important things are missing, like generics/parametric polymorphism.
- seszett 3y agoFunctional here means that it functions well. Not that it's a functional language.
- aaviator42 3y agoIn case it wasn't obvious from the context of the rest of my comment, I was using this dictionary definition of 'functional': > designed to be practical and useful, rather than attractive. It gets the job done. Really well.
- kyriakos 3y agoall he said is that he can get his work done. definition of "functional" is "designed to be practical and useful, rather than attractive"
- zelphirkalt 3y agoAnd all I said is, that most people understand something different under that term, when talking about programming languages ... But thanks everyone, for the dictionary definition lookup.
- ars 3y agoAnd that's why people look down on it - it's the same as how movie reviewers don't like regular movies, or book reviewers only like complex barely-readable books. The simple stuff is just too boring once you are an expert in the subject.
- ainiriand 3y agoSimilar to how Stephen King will never win the Literature Nobel but he is such an incredible writer.
- agumonkey 3y agoPersonally I never shat on php because of simplicity but because of lack of expressiveness, limited language constructs and bugs. Combined with the massive new crowd going into programming with it, it gave rise to immense walls of pain (I remember wordpress sociable code source 12 screens long loops visually..). Later they started to move away from all that with PSR, typed object layer and more es6/py3 set of features.
- Morelesshell 3y agoI shit on php because when you develop professionally with it, you want strong types so what happend was that people started to use comments to hint types. Those hinted types are than enforced through an IDE. Thats just horrendes langauges missuse / misdesign.
- zer00eyz 3y agoI write go so... types. Types are great and they have downsides. Perl, PHP, Python, Ruby, JS, Lua, lisp, objective c are proof that you dont NEED them to have working code.
- kaba0 3y agoGo’s types are like talking about how cool internal combustion engines are, and you bring up a crank.
- 3y ago
- wink 3y agolow-skill sounds much more negative than "not complicated enough to constantly fail" :P After so many sightings of bespoke build tooling I kinda miss this part the most.
- progx 3y agoWhat did you have to build? `node index.js` and it works, without build. And what did you mean with "no server updates"? PHP has to be updated and the server processes has to be restarted. The markup of PHP is a mess, OK js is not much better :D Sure you can start PHP without any dependency, cause it has a "million" dependencies included. And yes, i use both. The right tool for the right job.
- gwervc 3y ago> Sure you can start PHP without any dependency, cause it has a "million" dependencies included. This is exactly what good/great languages are doing: providing a standard large standard library.
- zelphirkalt 3y agoI do not agree, that this is the only way of great languages. Great languages in my opinion are those, that implement concepts in a way, that they compose well and enable you to do anything you want elegantly. With the concepts they implement, they give you an answer to any situation might come across, without forcing you to write tedious ugly code as a workaround for lacking facilities. Perhaps what you refer to are great ecosystems of programming languages?
- Capricorn2481 3y ago> And what did you mean with "no server updates"? PHP has to be updated and the server processes has to be restarted. This is not true. You can update a PHP file without restarting your server, and it will run your updated code.
- zer00eyz 3y agoI spent years making money off of PHP. I was doing PHP when shitting on PHP was cool. I spend most of my time writing GO now. Go + htmx + tmpl is all you need for a basic site. The go runtime produces binaries... While you're still installing php and a web server, my binary is already running and in systemd. Need validation, grab validator. Need a DB, grab sqlc and write sql and then have the code for your API calls generated for you!!! (This bit of code generation feels like magic candidly) Need a command line tool? GO. Have to build a Key Value store? GO Want to build a database? GO Do you need a container deploy system ... well Kubernetes is already in GO... There was a magic to LAMP and PHP 4... it was the right stack at the right time. When I work in go now I feel all that magic again.
- cies 3y agoI like Go. But how come they have not fix the issue with implicit nulls? Null guards everywhere... I cannot believe that a company as mighty as Google did not choose to use decades old insights on how to fix this. Now it's really hard to fix. The std lib already does implicit nulls all over the place. Kotlin kind of fixed it for Java, and it really helps us. PHP is old, and makes it easier to forgive it's mistakes. But Go?
- hbogert 3y ago> I like Go. But how come they have not fix the issue with implicit nulls? Null guards everywhere... I cannot believe that a company as mighty as Google did not choose to use decades old insights on how to fix this They relied on decades old insights of persons who worked on C and Unix. That said, I'm honestly still on the fence about if nil checking is really braindead, or just what it boils down to in the end and the rest like exceptions and Options/Result is just theatrical. What I don't get is that they are not more pedantic about checking nil errs in the compiler. They error hard during compilation on unused variables, but err checking is simply not done.
- kaba0 3y agoWhy? Like, besides some basic cli tool, and some “system” network programming (what google meant in their marketing, as go is definitely not a system language), I fail to see any benefit of that thoroughly uninteresting language. It’s basically Java 1.2, sold in “Unix-flavor”, somehow making it acceptable to the people that otherwise hate to touch anything non-C (and in extension, never having used anything more modern)
- zelphirkalt 3y agoI mean, if I had been doing PHP-only professionally for years and then as an alternative merely checked out NodeJS, I wouldn't budge either, I think. But NodeJS is not known to be an elegant, fascinating or even horizon expanding language. None of that. So I am not surprised. Additionally it is kind of in the same language family as PHP is (while there are differences). Add to that all the overhead you have with minifiers, bundlers and whatnot, and I can understand easily, how one would not want to switch to NodeJS coming from PHP. However, it might be a good idea to try languages, that are encouraging different paradigms, belong to another family of programming languages, or are often used for other things than PHP usually is. Try a Haskell, try an Erlang, an Elixir, a Scheme/Racket, a Rust. Languages so significantly different, that they add value for your learning experience as well as enabling you to do new things and get to know elegance in programming language design.
- wildrhythms 3y agoI also use PHP this way and the speed I'm able to get something from a database to the page and iterate is still unmatched.
- znpy 3y ago> With PHP to move my code to a production system I just need to run `git pull` and the new codebase is instantly live. No builds, no server updates. Make sure your .git folder is not "instantly live" as well...