Ask HN: I just want to have fun programming again

240 points by jb1991 ↗ HN
I've written in many very different languages in a professional full-time capacity in my many-year career. Now I'm interested in building something new and I have a clear idea in mind with some code already in C++ to proof-of-concept it for myself, but I'm struggling to find a direction forward that would be... fun. I don't mind challenging work, but I like an environment that feels sane and logical and where I am not facing loads of incidental complexity along the way. I'm also attracted to implementing my app cross-platform.

I just want to have some fun writing something without headaches, and that is seemingly less and less easy to achieve today. I'm not a fan of the complexity of either JavaScript or C++, and while I very much like Swift and working in the UIKit world, it's not so portable to platforms that many use.

I feel like there aren't really any good options in software development any more. It's always one big compromise with lots of possible decision fatigue. Every direction has drawbacks.

If I could write an app in a good static-compiled language that did not require extraneous expertise in CSS but that shipped on a web page and looked good using tools only in that language, with good interop with an HTML Canvas, that would be one possibility, but it is again a compromise -- no easy multithreading, dealing with all the front-end baggage to bundle or deploy such an app, etc.

Any recommendations? I'm not afraid of learning an entirely new language too.

218 comments

[ 2.8 ms ] story [ 254 ms ] thread
I've used Qt in past years. Qt is to C++ what C++ is to other languages. It's the "rich man's rich man." It has some nice qualities, but it takes the complexity of C++ to a new level IMO. Also its most easily-used editor (Qt Creator) has historically been buggy on mac, which I typically use.
Qt/QML? I have been doing cross-platform development with Qt for a few years now [1]. It does have a learning curve, but I do like the split of C++ logic and Qml for the UI. I can recommend the qml book [2].

[1] https://screen-play.app/

[2] https://www.qt.io/product/qt6/qml-book

Thanks, I've used it. I left another comment about it [0]. Perhaps I should give it another look. Qt doesn't really satisfy my desire to use something fun and relatively simple, but you and the other commenter are pointing out the obvious -- it is clearly a viable choice.

[0] https://news.ycombinator.com/item?id=34707057

> while I very much like Swift and working in the UIKit world, it's not so portable to platforms that many use.

Your title says you just want to have fun programming but your post is full of other requirements. You need to decide if having fun really is what you’re after—in which case it seems you’ve found your answer—or if it’s secondary to some other metric such as customer reach.

There is always a compromise. No solution is all good things at once, including easy, performant, and cross-platform. If that existed we’d all be on it. You’re clamouring for a past which I’m doubtful truly existed.

Yeah exactly, even though I'm more of a Linux user than an Apple user, one thing I do admire is that there a lot of apps with UI polish because they JUST build for one platform.

They just focus on making it exist, without premature generality.

How about Unity? https://unity.com/products/unity-platform

Or Racket? https://racket-lang.org/

---

I only have a little experience with the suggestions above; I personally like SvelteKit, but it doesn't fit your requirements.

Unity and application development are not a fun combination. Their UI system is notably terrible in both performance (not only the redraw-every-fraction-of-a-second paradigm, but just the plain ol' software architecture and layouting, or even simple things like culling offscreen elements) and features (Event bubbling/propagation? Naaah who needs that? It's not like you're putting a button inside another button! Or a button on a slippy map... Oh wait).

And while the prospect of cross-platform is appealing, it has 0 accessibility support and no way of embedding or being embedded into native widgets.

It's just a little bit better than passable for game UIs (non-interactive HUDs and one-screenful-at-a-time interactive menus), but once you start needing to implement things like drag&drop, virtualized scrolling, or non-trivial layouts, it get exponentially harder when compared to a "proper" application UI library.

Believe me I use it for a living :)

I just discovered and it seems enticing: https://github.com/raysan5/raylib

> no fancy interface, no visual helpers, no gui tools or editors... just coding in pure spartan-programmers way. Are you ready to enjoy coding?

Doesn’t it also say no debugger? You’re a brave soul, my friend :)
It's a c library. You'll have very powerful and mature debugging and tooling available to you.
I don't know of a current way to do front end dev without CSS. The frameworks which allowed you to do that, like Flash, Java Applets, Silverlight are long gone. You could try Blazor, it's statically compiled in C# and can run either on the server or in the browser, using WebAssembly.
It's not "fun", but it's perhaps best to start with the problem you're trying to solve rather than the tools you want to use.

As for "fun" for UI, I found doing UI in Dear ImGui strangely liberating. It sounds like a web front end is part of your requirements, maybe, but if not, try one of the "immediate mode" UI toolkits like that. They have their limitations, for sure, but they come with a lot less "normative lifestyle assumptions" and it's strangely enjoyable to toss a UI together in them.

Also I started having a lot more "fun" once I start doing my hobby projects in Rust rather than C++... once I got past the initial learning curve... I say this not so much for the language side of things -- which can be a little straightjackety -- but for the fact that I was no longer fighting all the sharp corners in the C++ ecosystem (CMake, different 3rd party lib packaging styles, dubious 3rd party library programming styles/standards, etc.). Rust+Cargo simplifies a lot. And the third party crates are generally of pretty good quality and consistency.

Or learn another language, like Zig. That looks fun, too.

My main problem with Dear ImGui is that it just looks pretty terrible on a high DPI screen like most macs' Retina screens. The scrolling behavior feels clunky too compared to how scrolling works in every other app or browser on mac. If those two things were fixed without my having to figure out workarounds myself, I'd probably use it.
Ruby on Rails is desperately waving hello. Though it's not x-platform...and I don't think the magical x-platform tool/framework you're looking for really exists.
You don't need much expertise in CSS to build common web UI patterns. It's been around a long time, and tropes like "it's hard to center a div" aren't really true anymore.

It's absolutely possible to build JavaScript apps in a single page with no external dependencies. All you need is a single .html file and a simple development server (I use python http.server).

Writing in typescript is a easy as a single dev dependency to compile the code. There's no multithreading but first class async support.

Additionally, JS / TS are very flexible. You can implement almost any programming paradigm you want to learn. I love doing FP in typescript personally.

Trouble with CSS is still this: https://media.giphy.com/media/yYSSBtDgbbRzq/giphy.gif (Peter Griffin trying CSS)

And centering a div can still be very hard depending on the circumstances.

> And centering a div can still be very hard depending on the circumstances.

Are the circumstances that you are banned from using flex or grid?

I always see this meme going around, but it's just plain and simply untrue now that Grid can be used reliably.

You can center anything by making the container display:grid; align-content:center; justify-content:center; I don't know of any situations where that wouldn't work. Flex is a bit finnickier to understand with its major/cross axis concept and wrapping, but you can write Grid layouts with your eyes closed.

It gets better as you practice and learn good practices, and for the kinds of "fun" projects OP wants to do, there's no real downside to using a css framework that abstracts a lot of it away.

> centering a div can still be very hard depending on the circumstances.

Only thing i could think is targeting ancient browsers. I'm curious, do other UI languages not have quirks or edge cases to learn?

C#/.NET is cross platform. I find it more fun than doing things like php or node. But I also don’t follow the whole “everything needs an interface” crap, or the insane level of abstractions people seem to implement.

I’m sorry learning rust tho. Like it a lot.

C# also allows you to use blazor, eliminating the need for js/multiple languages to write a web app.

I personally find that a much more fun way to program.

I'm using C#/.NET7 for a side project. I use .NET6 at work.

For me, the language itself has no bearing on fun. Having something that "just works" in most areas without having to antagonize over 3rd party dependencies allows me to have fun.

I'm sure if I was as familiar with Java or something I'd probably use it for my fun projects instead.

If you want the language itself to be an amusement, then I don't think C# is for you. It is about as boring and straightforward as it gets. I use it because it lets me work on fun problems without getting in the way very much.

If you want some fun, try working with the allocation-minimizing parts of the standard libraries, or lambdas-as-Expression, or even Roslyn analyzers/generators. C# has loads of "fun language features" to play around with, but what I find useful is that you can just use them boringly if you need to.
I find alot of difficult to solve problems fun with C#, but C# doesn't get in my way so when I work on personal projects, its fun because of what I'm building, not so much the language.

I suggested C# mainly it lets me focus on what I'm building. Node I feel like I'm thinking "is there a package for that" "how to use the package" "this doesn't work the way you would think it does"...

If that makes sense...

C# can go in both directions because if you don't go full of shenanigans and simply write what you need it can be reasonably elegant. But to your point it won't necessarily be "fun", however if the fun is more in the problem it can be a great answer.

F# I'm finding to be a language I can have some fun with because some of the syntax just speaks to me (being able to use pipe operators aka |> to chain work so that what you work on is at the front and then it flows into each step without explicitly writing out intermediate variables or writing code inside out feels GOOD to me). It certainly isn't for everyone though.

At some point I want to play with Avalonia because I need to get back to doing non-web UI but I never have the right idea other than some of my game stuff and that's getting done in Godot or Unity.

Best way I found to "have fun programming" is to not do it "for work"

That's personal experience, of course, but the most "fun" I have in almost any task/topic/field is when it's not 'forced' on me by $WORK

> I'm also attracted to implementing my app cross-platform.

Depending on your project, you might consider working on the backend and API to drive this app and contract/partner with somebody who can do a killer job on a great frontend.

https://elm-lang.org

https://elmlang.slack.com

Static FP lang targeting the web as a runtime environment. Wonderful people. The nicest compiler in the game. Tight dev loop. Good tooling.

No JavaScript knowledge required. Join us.

Programming in Elm with mdgriffith's elm-ui package is the only way I've ever been able to tolerate developing a ‘modern’ web app.
This

Elm brought back joy and longevity for side projects to front-end for me (that had been ground down by the JS ecosystem sadly)

₊1 for Elm. Easy, fun, reliable.

And the Elm Slack is the most helpful Slack I've ever seen.

Elm Slack has literally made my career. Hats off to every last one of the regulars for their patience and kindness.
I'm going to suggest Clojure. It is a very opinionated language made a person who was about to quit professional programming because of an explosion of complexity (both accidental and incidental).

Check out the talks by Rich Hickey to see if you have the same sentiment or perhaps this paper: https://download.clojure.org/papers/clojure-hopl-iv-final.pd...

The community of the language largely follows this philosophy, the ecosystem is very stable and there is little churn. The most common implementation is on the JVM making the language very portable.

The headaches historically were with getting your environment setup, but there are amazing tutorials and good tooling or VSCode, IDEA, Emacs and vim.

I would like to throw in Erlang and or Elixir with this. Not as stable as Clojure in the case of Elixir of course (or even just the BEAM environment tbh, certainly not as popular as JVM), but it's possible OP has already done the traditional functional programming thing.

This is absolutely not a criticism of Clojure or your recommendation. I'm a huge fan of Clojure, but I don't know where OP is coming from/if they've done a LISP before.

I don't know why but whenever I get depressed of bureaucracy at work I turn to functional programming in my spare time.

> I don't know why but whenever I get depressed of bureaucracy at work I turn to functional programming in my spare time.

I have noticed the same thing about myself.

I think for me, I am drawn to remember how simple programming can be.

> (or even just the BEAM environment tbh, certainly not as popular as JVM)

It has run some ~40% of global telephone communications for a few decades now, on top of the usual suspects (WhatsApp, Discord, (old) Facebook Messenger, Motorola, Blizzard chats, a number of banks...) and predates the JVM by a couple of years.

I'd go out on a limb and say that it's one of the most battle tested VM's there is.

And as a bonus, once you know Clojure (on the JVM) you basically get ClojureScript, on top of JavaScript, for free, which is amazing.
I love Clojure, and listening to Rich Hickey talk is often enlightening.

I don't know that learning clojure was a good investment from a practical standpoint, but I took a deep dive into lisp-like languages and don't regret it.

(comment deleted)
I feel like there aren't really any good options in software development any more. It's always one big compromise with lots of possible decision fatigue. Every direction has drawbacks.

This has, literally always, been the case. You need to pick where you want to compromise, because there is no "one-fits-all" solution.

- Use Electron/Typescript/React/Tailwind or some similar stack if you want to pull together something quickly that works across multiple platforms

- Use Flutter if you want to do that but don't mind it's kinda poor re-implementation of platform-native widgets

- Use Qt if you don't mind the C++ dialect and complexity

- Keep it simple and use Dear Imgui

- Use something like Blazor to build a web app in C#

There are loads of options with different tradeoffs.

There is no purely fun way to build a production app. If there were everyone would do it. The hard part of building an app is the slog through the tedious parts. If you just want to build a toy app for fun, I recommend you just mess around with processing or pygame.
This! The fun of programming won't come out of a software project.

I find fun in programming by writing code solving small challenges. Something people really hate, e.g. LeetCode, is actually the fun place for me: I really enjoy writing some small size program to solve a made-up problem with my scattered time. I don't need to worry about language, library, framework, platform, UI, etc. The only thing matters is coding, and that's the thing makes me happy.

Note down the good things you find in programming languages, and build your own language writing its compiler. That will be a good exercise.
For UI I do think JS is your best option atm. You don't have to write JS to generate JS, you can use Typescript or go more exotic to things like Rescript.

In terms of CSS; you'll need some form of styling in whatever language, there are plenty of abstractions on top of CSS if you want [something not css].

I would suggest having a look at Next.js if a web app would work, React Native (use Expo) if you want mobile, or Tauri if you want to focus on desktop (Electron, but in Rust, more performant, smaller size, more secure).

Another thing worth checking out is Flutter. I'm personally not a huge fan for irrelevant reasons but it is cross platform, and it's compiled not-JS (Dart).

I also want to say FE has come a long way, the web platform is much more stable, there are great frameworks and libraries, the tooling is amazing, and above all it's really fun and productive. Give it a shot, you might enjoy it. (Do use TS, or Rescript, or something, JS is better with types).

Another option I forgot as it's so far away from my world; .NET, they have Xamarin and I think they just released .NET MAUI. That would be C# or F#.

It's not my jam, but it's def cross platform and used quite a bit afaik.

For front end, there are a ton of UI libraries and CSS frameworks out there that can minimize the amount of styling OP would need to do. I am a big fan of Tailwind, but that might be too much. Maybe some Bootstrap/Material UI React components would do the job.
I deal with web stuff all day every day at work, so that's definitely not what I would choose for a fun hobby project. It's not your best option if that's what you're trying to get away from.

Someone else mentioned .NET. There's also Delphi and Lazarus. Both are cross-platform and have full-fledged UI systems, without any of the web ecosystem nonsense. It's a totally different experience than web development.

>> I just want to have some fun writing something without headaches, and that is seemingly less and less easy to achieve today

Pick something that sounds refreshing and fun to you. A few recommendations for you: make a game for a fantasy console like pico8, walk through an adafruit embedded project, or get interested in the front end / design part of web development (look through dribbble for inspiration). You don't necessarily need much CSS and it's not hard to learn anyway.

>> I feel like there aren't really any good options in software development any more. It's always one big compromise with lots of possible decision fatigue. Every direction has drawbacks.

It seems most of your dissatisfaction comes from whining about the tech stack. Either focus less on the technology stack and more about the end product, or stop attaching emotion to decisions that are best made logically. It's okay if you choose options that have drawbacks if every option has drawbacks. There's no such thing as a silver bullet. Choosing the wrong option is rarely going to kill your project and you can always change directions later so breathe easy.

he has an idea for product - he is explicitly asking about the tech stack
Write some C for your own pleasure and fun on an undead platform, like AmigaOS.

Due to the constrained nature of the undead platform there is no real possibility of decision fatigue, since the ways of solving a problem are few.

I'm doing something similar with an old laptop I've repurposed as a web server. If I can't deploy it there, alongside my other applications, it will not get built.

I really like constraints. I also believe that's what made the early Internet so special.