News:

Let's find out together what makes a PIC Tick!

Main Menu

Python or PHP.. which is better?

Started by shantanu@india, Apr 15, 2022, 02:37 AM

Previous topic - Next topic

shantanu@india

Hi,
I've to learn to write server end scripts for my IOT devices. I was bent on Python for its easy readability but a IT professional told me to learn PHP+HTML+JS which is more suitable for Cpanel based shared server spaces.
He said Flask/Django would be an overkill for displaying a few values on a web browser.
Any suggestions?
Regards
Shantanu

keytapper

As python addicted, I'd say that you are choosing the rocky road. What about Home-assistant, entirely wrote with python and will accept anything not excluding MQTT protocol or any other stuff.
Of course, some learning should be applied, but less stress than trying to learn three languages.
You may use it ready to go, in a containerized form, which will allows you an easy portability, or to get rid of it without affecting your common environment.
Ignorance comes with a cost

shantanu@india

Thanks Keytapper... I'm also Python addicted no doubt about it.
Home Assistant needs a OS to install which unfortunately I don't have.
My ESP's are standalone and have to directly upload/download data from the cloud. The only vehicle is the Wifi gateway.
Maybe no other option but to take the bumpy road!!
JavaScript is easy... Ive started at w3Schools.
Regards
Shantanu

keytapper

#3
I imagined that you had a server on a PC or SBC. But if you plan works with ESP, may be a possibility to have micropython an use a light weight like bottle as a server (anyway is just a fork of Flask).
In my point of view, all of these languages are rather bloated and I feel it would be hard to fit in a ESP.

I wish you to success, my experience for Home Automation still not well developed.
Ignorance comes with a cost