Ask HN: How to rediscover the joy of programming?
483 pointsI remember in my teens I used to love programming. After 20 years of a career, I don't enjoy it anymore.
Have you rediscovered the joy of programming? Any advice?
Have you rediscovered the joy of programming? Any advice?
Comments (329) 141 threads
Show all comments
Showing thread 18 of 141
What is the easiest way to launch a simple PHP website these days?
-A simple CRUD web app
-No new sytax to learn (just good ol' PHP)
-Simple flexible front end library (I have used Materialize CSS, is that the best?)
-Any easy way to make the MySQL pieces easier to manage? Any boilerplates?
-Any end to end integrated development environment? I have codeanywhere subscription and inmotion hosting. Is that good?
Essentially I have decent experience with PHP/MySQL from past and want to launch a simple CRUD website using as much off-the-shelf pieces as possible. Looking for the easiest path to get there.
It would be gravy on top of some day I can wrap it into a mobile app (for location, camera etc.)
I think lobste.rs is open source.
Edit: it is. Also I thought it was written in PHP but it turns out to be Rails.
The hardest hurdle initially is to set up a “virtual environment” which means you have a project by project collection of all the packages you need instead of installing everything globally.
Setting up virtual environments used to be a pain. Today it’s so easy:
1. Make sure you have Python 3.8 installed. There’s installers for Mac and Win. 2. Create a folder for your new project. 2. Inside that folder, use your console or terminal to write: python3 -m venv p_env 3. You now have a virtual env, all your stuff will be stored in that p_env folder. 4. Activate it with another command: source p_env/bin/activate 5. It’s now activated and you can use “pip” to install packages like Django a great web framework.
By the way go check out Django and go through the tutorial. It’s very fun and will get you going with a CRUD in no time.
Let's be honest: you don't have any experience with php or mysql anymore. 12 years ago was the era of php 5 with some remnants of 4. Php 7 and the ecosystem are a lot better nowadays (composer, Symfony etc.). For database people tend to use Postgres when they can but even MySQL added lot of good things with JSON, CTE, window functions.
You may want to start learning from scratch.
"Hello world" is still those letters in a .php file uploaded to a host tho.
Composer also provides the benefit of a lot of neat packages that can help accomplish a lot of the heavy lifting, depending on your needs. For my purposes, the Slim Framework[1] was perfect. Beyond that, PHP still has PDO, so I wrote a simple class to manage my common CRUD activities. I haven't bought into the npm-gulp-JS-babel hamster wheel nonsense for the front-end. I still download the odd JS library and FTP upload my files.
Tying it back to the OP, I really rediscovered the joy of programming by ignoring all the over-engineered nonsense that's taken over (particularly in web dev). I stopped feeling like I'm behind if I don't spend a day learning about a process that might save me 20 minutes but will be deprecated in a month and obsolete in a year. I went back to just writing the code that does what I need it to do.
[0] https://learnxinyminutes.com/docs/php-composer/
[1] http://www.slimframework.com/