DEV Community

Ellai
Ellai

Posted on • Updated on

My experience with JavaScript and PHP as a junior web developer.

Community support and resource for PHP and JavaScript

JavaScript have larger community support and resources such as libraries, frameworks, tutorials and learning materials.

This could be debatable but numbers don't lie, you can literally see the numbers of tutorial uploaded everyday related to JavaScript compared to PHP language, or amount of JavaScript frameworks dominating the modern web development.

Installation hell and get started with PHP

When it comes to learning or developing with PHP as beginner, I have realised the only way you could run a PHP is via web server solution(XAMPP)/development environment(Laragon)/or Live Server(non DB connected code).

And to download one, is not a child's play. You required to be tech savvy or at least able to read documentation for several time in order to have successful PHP installation in your machine/laptop.

Don't believe? Get a laptop without any programming language installed in it, and try to run a PHP script vs a JavaScript(No installation needed, you can run JavaScript literally at your browser)

Access to DOM

When you are developing a website / or web application using PHP as your dominant stack. You are forced to write jQuery(a JavaScript library) to manipulate your DOM, or use internal JavaScript script tags to access DOM Node to add any kind of event listeners.

Control over frontend side of the application

Even Laravel the most popular free, open-source PHP framework integrates with Vue.js(a JavaScript framework) to aid the frontend reactivity and to enhance SPA web development speed.

Laravel does have a framework of its own, which is LiveWire uses AlpineJS(built with Javascript as well).

Final thoughts

If you have started working with JavaScript as a beginner, you will never come across PHP language. But if you, started as a beginner with PHP for web development, be ready to face JavaScript as it dominates the web development even in PHP's own ecosystem.

These are my personal thoughts and experiences with both PHP and JavaScript. I have learnt PHP way earlier than JavaScript and I have spend almost equal time with both development language.

I welcome all open minds to share your thoughts on post and eager to know your point of view too.

Latest comments (3)

Collapse
 
msulaimanmisri profile image
Muhamad Sulaiman

Good one @ellaidevs !

Collapse
 
ellaidevs profile image
Ellai

Thank you master !

Collapse
 
brockcaldwell profile image
Brock Caldwell

I'm potentially biased, considering I started out with PHP about 6 years ago and just started with JavaScript (ES6) about two years ago.

PHP has a strong community with regular conferences, a seasoned portfolio of questions/answers on Stack Overflow, and many open source projects alive and well. From my experience, JavaScript has a similar presence on the web but with a more scattered and polarized viewpoint from many JS developers in regards to the many frameworks that live out there.

In my experience, PHP is a powerful tool (albeit with a lot of quirks) for use as a back-end programming language. Getting started with PHP (Windows) can be as simple as downloading the language, sticking it in your C: drive, adding a PATH variable, then spinning up a development server with "php -S localhost:80 -t public". Or, if you're familiar with Docker you can just create a Dockerfile, e.g. "FROM php:8.1", and skip the whole downloading and setting up PATH variables.

Since I started with JS two years ago, I started out with ES6 and was told to avoid jQuery as it's days seemed numbered. Access to the DOM is as simple as a query selector, so I'm a bit confused by your point about needing jQuery.

I think both languages serve their own purposes in the world and there's a place for both of them in most situations.

Thanks for sharing!