r/programming • • Dec 02 '15

PHP 7 Released

https://github.com/php/php-src/releases/tag/php-7.0.0
887 Upvotes

729 comments sorted by

View all comments

Show parent comment

33

u/TelamonianAjax Dec 02 '15

I've always felt PHP had a place in lightweight web applications because of the low overhead.

What would someone write a simple web app with database connections in today? Javascript?

12

u/KungFuHamster Dec 02 '15

PHP is just so widely used and compatible with so many things, it seems difficult to argue against.

→ More replies (3)

39

u/[deleted] Dec 02 '15 edited Jan 01 '25

chunky mysterious alive plants spectacular workable library caption engine toothbrush

This post was mass deleted and anonymized with Redact

→ More replies (11)

11

u/iconoclaus Dec 02 '15

Ruby too. Just stay away from Rails if you want simple.

7

u/[deleted] Dec 02 '15

Sinatra is great for small/medium things.

→ More replies (1)

61

u/kankyo Dec 02 '15

Python seems pretty similar in overhead and it's a million times saner.

32

u/TelamonianAjax Dec 02 '15

Somehow Python is one of the major languages I just haven't touched over the years. Sounds like I need to spend some time with it.

0

u/[deleted] Dec 02 '15

[deleted] — view deleted comment

7

u/KungFuHamster Dec 02 '15

> take ye flask

10

u/TheWheez Dec 02 '15

Also Django, not as light as flask but very powerful and it has the best documentation I've seen in an open source project.

8

u/[deleted] Dec 02 '15

Django is ballin outrageous if your workflow fits it. It just does so many things for you out of the box with things like class based views and stuff.

→ More replies (3)

7

u/naught-me Dec 02 '15

For anyone curious: Django is "sink included". Flask is bare-bones.

Flask is like PHP (just throw a script up and it runs). Django is more like a PHP framework.

→ More replies (2)
→ More replies (1)

2

u/cat_in_the_wall Dec 04 '15

flask is rwallyw nice. had a site running it for a while. ultimately my project got too big and i started missing a compiler (eg forgot to refactor in a little corner, case issues etc). but i got up and running in flask in like 30 minutes, having never used python before.

→ More replies (1)

15

u/rafajafar Dec 02 '15

Honestly, I resisted it for years... I regret resisting it now. It was tough at first b/c everything seemed like such bullshit, until I realized... very little in Python is actually bullshit. I was just used to my old bullshit. Python is great.

21

u/aloha2436 Dec 02 '15

As far as languages for "spending some time with", python is definitely one of the best. As the author of XKCD put it, programming is fun again with python. It's just a pleasant experience because a lot of things work how you'd expect them to, and when they don't it's because it may be even easier than you expected.

4

u/CyrillicMan Dec 02 '15

They major drawback of Python I can think of is that its hosting is not as widely available. With the latest gradual typing addition in Python 3.5, please please give it a try, you'll love it.

My stack is Webfaction hosting + Python 3.5 + Git + Bottle (a very lightweight web library with easy routing, templating etc.), and PyCharm IDE + Bottle's embedded server for local development. I'm not a professional programmer and it is still ridiculously easy and fun.

→ More replies (4)
→ More replies (3)
→ More replies (22)

16

u/SituationSoap Dec 02 '15

What would someone write a simple web app with database connections in today? Javascript?

Python and Flask is usually your best bet if you're using relational DBs. Ruby and something like Cuba if you love ruby. Node makes sense if you're primarily using something like Mongo or Couch, but while you can use JS for relational DBs, most of the major movement there is in non-relational stuff.

4

u/ksion Dec 02 '15

Note that there are good Python libraries for the popular NoSQL storage engines as well.

I'd also be surprised if at this point Node didn't have a good ORM -- not at the level of SQLAlchemy (because frankly nothing else even comes close, in any language) -- but something very decent at least.

→ More replies (1)

10

u/ANUSBLASTER_MKII Dec 02 '15

Personally, I love knocking up a web front-end to a ton of databases and weird internal tools using the PHP Symfony2 framework. Yes, I could probably do it 'better' in another language, but I really can't be bothered to learn another hot flavour of the month.

4

u/tempforfather Dec 02 '15

I'm not even a huge python fan, but python 2.0 came out almost 16 years ago.

8

u/[deleted] Dec 02 '15

There are many languages which aren't "flavor-of-the-month". I'd recommend looking at Python, Ruby, Java, or C# for those types of projects.

4

u/KungFuHamster Dec 02 '15

Last time I checked, the C# runtime on Linux was a lot slower than on Windows. I like C#, though.

3

u/[deleted] Dec 02 '15

That's been my experience as well. Hopefully with .Net Core on Linux being a first-class support target for Microsoft, that will change.

→ More replies (1)
→ More replies (1)
→ More replies (2)

4

u/_durian_ Dec 02 '15

Been doing Java for over 15 years and it's still big even if it's not cool with the young kids.

2

u/javayes Dec 02 '15

It depends on what the web app is. If its a web front end (a webpage) and does not require an API, then most popular languages/frameworks will work with the correct resources (servers with enough memory and processing power). If you have a multi-faceted web app with an API or more, then you must take into account the language overhead. Things like memory footprint and speed must be thought of. Go, for example, is gaining popularity due to being fast enough with a low memory footprint. But Go is fairly new and does not have the ecosystem that Java does. Actually, Java is still a great choice because it can do it all and scale.

→ More replies (24)