Should i learn PHP or ASP?

I started learning recently html, css and javascript basic stuff. I want now to start learning back end and try make an ecommerce site. I tryed PHP but i found it extremely hard and messy. The syntax i hate it, also is annoying with filtering variables to not run scripts inside and security. I managed to insert and read data into MySql database, but to make login, logout and session it kills my brain. I saw ASP.net and seems way much cleaner and easier to use. Should i let go PHP and go for ASP.net? What you recomand for a newbie in web development?
6 Replies
Joao
Joao7mo ago
For PHP, I highly recommend Laravel. It makes everything so much easier. But ultimately, for someone getting started, it doesn't really matter all that much. Any reason why you are considering these two languages only? You already know JavaScript so you could try Node.js for backend development.
Heitor
Heitor7mo ago
What languages do you know? Node.js is a good option since you already is using javascript in the frontend.
Neo
Neo6mo ago
Deno and bun is good either
Hungry🐻
Hungry🐻6mo ago
My personal opinion is for a newbie you should know your style of learning. PHP is very clean. If you're learning with methods and those methods are going at a different pace than you it would be difficult. as a newbie also when you say you hate the syntax i'd need clarification(what does a newbie know enough to hate a syntax). I think the issue is more in the lines of you rushing through it instead of taking your time. If you could explain it better id appreciate it
trashlord
trashlord6mo ago
look into what roles are in your area and make the choice based on that, im in the process of learning a little of both both
13eck
13eck6mo ago
Just a bit of clarification: ASP.net is not a language you learn, it's a web framework that uses the C# language. IMO C# is a good, solid language and one that I have been learning for a few years now. You can use it for back-end web servers with ASP.net, sure. But you can also use it for CLI tools, games, desktop/mobile GUI apps via .NET MAUI, and a host of other applications. And it's compiled to machine code that's read by a .NET runtime (hence ASP.net) that can run on Windows, Mac, and Linux. Or, if you don't want to assume your target audience has the .NET runtime (it's bundled with Windows, but not on on Mac or Linux) you can also complie your codebase to a standalone executable for any of the above mentioned OS. It's a very versatile language that has a lot of applications and it's worth learning, IMO.