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
Earlier commentsI find I get burned out by commercial code. So many hands have touched it, millions of lines, scant docs, hard to make sense of it, but ... deadlines, get this task done and that.
Create a simple program outside of work and connect with the joy again!
I am having fun writing a simple nodejs app which is using AWS service. Nothing groundbreaking but its fun to learn and tinker with. I have no expectation of getting good at AWS or NodeJS, just want to build something and get it working.
I found the opposite was useful. My day job was writing quite trivial code (crud apps, forms, etc) so I started writing far more complex apps in my spare time. Things that were truly challenging. It turns out they're a lot of fun to build.
There are two kinds of difficult I find. Difficult and rewarding (coming up with an elegant algorithm to solve a problem). Difficult but unrewarding. It doesn't take brainpower to solve these, just knowledge of lots of inconsistencies and a lot of trial end error. Interacting with Saleforce API and a lot of JavaScript / Browser work seems to fall into this category.
Best case, you can find pride and joy in something about your programming other than the technical excellence. However, that depends on you personally caring about the purpose of your code's existence.
Of course, left to their own devices, a bunch of engineers could be very happy and ship nothing useful. So you have to impose some sort of balance in a business environment. However, it's an interesting management problem to allow people enough time and autonomy to be proud of their work, while still accomplishing what needs doing. Ideally, with happy engineers, more gets done, and it pays off.
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/
I moved from C++ to the much simpler C which I started to enjoy more because it's not putting such a "mental barrier" between my brain and the problem to solve (another option would've been to use an entirely different programming language you're currently interested in but can't use "at work").
Basically: have one or several fallback projects which are completely different from your usual work, without any self-imposed deadlines or long term planning to go back to when the other work becomes boring or overwhelming, just having fun is the main point, and part of the fun is going back to the core of what makes programming actually fun: Just whipping out code in a way that "feels right" to you, and seeing things actually happen, free from outside opinions or priorities.
From time to time (usually over the Christmas holidays) I take a deep dive into this project, but otherwise it's just a few hours a week at most, usually with months-long pauses inbetween.
PS: it took me a few months to "detox" my brain from the "professional software development process" that has become the norm in the "industry" ("agile" processes, software development patterns, estimates, tickets and all that crap). Those had been deeply ingrained into my brain in the last decades, but it's important to realize that all these things are, in fact, turning programming into a chore where burnout is ineviatable.
We program for various reasons.
We got into it because we loved it then it became our job and what started as something we do for fun became something we do to survive. We no longer have a lot of freedom what we want to program and we are required to code for objectives that doesn't interest us.
On top of that, it becomes something that identifies us and more or less the only tool we have at hand to prove we are successful.
Many start dreaming how can they change the world with this tool and invent the next big thing.
We start attempting to hit jackpots by creating one project after the other and failing miserably in all.
By late 20s mid 30s we get burnt out from failure and many move to management.
The ones that stick are the ones that program for no reason other than they enjoy it and are content with that. They aren't trying to change the world, become super rich etc. Sometimes they do by mere luck but it wasn't their intention.
My suggestion here is to tinker. For example, when was the last time you benchmarked a string comparison function and found out exactly why it bottlenecks down to the cpu instructions, instruction ordering, barriers, caching etc ? It's fun and can suck you in for days and a great learning experience. The example here is specific, but the gist of it is not. I hope it helps you.
All comments shown.
Couldn't load more comments. Check your connection and try again.