Some advice for an "old school" PHP-MySQL dev wanting to go on with new web stuff.
#1

So, the thing is I'm the usual guy who makes UCPs the easy/old way:

Include and start MySQL connection from another file
Query contents (Eg. player inventory) from MySQL database
echo retrieved stuff

And so, every section of the UCP is a PHP file and well, everyone says that's the 2005 way, and it looks like it's true. Everything ends up also being "static" as well. (to better explain this, here's a well made explanation of this by Southclaws).

Is there any advice on where to actually start with this? Since I'm planing to make a new script for SAMP, and would like to experiment with this new things that actually put all the logic on the browser and the data gets retrieved in json (I find that pretty amazing) and actually start learning something modern and new with the help of SA-MP motivating me.

I've heard of React, Laravel and stuff like that but I don't really know where to start, specially also if the SAMP server should also throw away MySQL in favor of things like Redis and those new things (you actually hooked my up with this type of reads Southclaws, thanks). Is there any starting point I should follow or that you would recommend me?

Thanks!
Reply
#2

There's nothing wrong with the 2005 way.
Actually in my opinion the 'new', 'modern' way is often more bulky, slow and ugly than the good old php-with-mysql solution (and it is not friendly to older browsers/hardware).

That being said, in an attempt to answer your question: I've heard from some people that laracasts is a pretty good way to learn laravel
Reply
#3

imo, you won't need the new technology unless you're planning on real time applications.
PHP is sufficient for UCP and I think even an overkill to learn NodeJS or Go just to improve a generic UCP, on the other hand, just learning any of the two is a nice advantage in terms of wider perspective of what you can do on the web.

PHP will always be better for small and/or simple things (& faster).


For where to learn I can only recommend to experiment as much as possible, don't have any recommendations from where to learn stuff.
Reply
#4

Sure, he doesn't "need" a modern stack but the advantages of learning one outweigh any other option, especially in the pursuit of knowledge. React/Vue/Angular will not only increase your productivity but will teach you new and important techniques which will be a huge benefit to any future in web development.
  • New tech is often designed around the idea of both scalability and maintainability. It is very easy to build large applications in React Redux and not get lost.
  • Initial load times are extremely optimised and quick. Serving a bundled React file will use hardly any bandwidth and it will only happen once implying you design your UCP around using a RESTful api.
  • The ability to use ES6+ loaders is a must in itself, the new features make async implementation a breeze, along with a ton of other cutting edge principles like object deconstruction etc.
  • Although you can create a compelling user experience with PHP and HTML, nothing will come close to responsive SPA. If you want a snazzy animated UCP which is easy to update and adjust then frameworks are your friends.
If you're doing raw queries and echoing HTML in the same file while wanting to take web development series then you need to stop. Oh, and as Southclaw said: TypeScript. Not only will it catch 95 percent of your errors, they it also help you write cleaner code. JS if very nuanced which makes spaghetti code common and TS will help avoid that.
Reply
#5

Python and Flask. 💖
Reply
#6

I recently made a UCP on top of react and nodejs which has server-side rendering too, you can check it out here. As Southclaw said you can use create-react-app to avoid writing/copy-pasting boilerplate code, but my recommendation is to make your first application from the scratch without using such tools, it will help you understand the working of these applications more clearly.

I too moved from php-mysql to nodejs-react and it took me few weeks of grinding to finally understand and get my server-side code working.
Reply
#7

Java + Spring + Thymeleaf + Hibernate + Bootstrap
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)