r/learnprogramming • • 18h ago

What programming language should I focus on as an occasional hobbyist?

As in, I sit down to code for a few hours once a month, give or take.

I've been chugging along on a text-based game in TypeScript with Vue. I'm constantly running into quirks and hidden nuances of the languages. Spending my precious hours figuring out the difference between interfaces and types, only to learn that it's pretty much personal preference, makes me feel like I'm wasting time due to the language choice.

Also the fact that I have to juggle several languages with their idiosyncracies: HTML, CSS, TypeScript, JavaScript (when it offers its own quirk), Vue, JSON. Forgetting one language then having to get back into it.

Can I have a more straightforward language? Maybe I should go to just bare JavaScript? I've used several languages in the past, including Java, C#, Python, Lua.

6 Upvotes

20 comments sorted by

5

u/DannyDeKnito 18h ago

If you're struggling with concepts such as interfaces, might be time to take a step back and learn some theory/terminology

No programming language is without its own idiosyncracies, but where they show up is a matter of how you use them.

When it comes to "gaming" usecases i'd still stick with something strongly typed like typescript or even golang since you're (apparently? Might be wrong, but im seeing a lot of web stuff there) making it web-based

4

u/DragonfruitGrand5683 17h ago

Build something you enjoy building.

3

u/phatbili 16h ago

Just use Python and save your sanity.

1

u/xpusostomos 18h ago

One way to approach it, as a learner, is to start reading the book SICP, which is designed for learners, and you learn the language Scheme which is very simple at its heart, and a favorite of many. Because Scheme has code as data and data as code, it can replace every language you can think of, including json, etc, and there are even frameworks for building web apps in it. As a bonus, you'll be proficient in programming Emacs once you learn it. But at the end of the day, it's whatever floats your boat.

2

u/babaqewsawwwce 14h ago

This is the way…

Scheme is an incredible tool for learning. Most CS, CIS, and math students get exposed to it at some point. I came across is in my math degree and attribute my ability to learn new concepts quickly to it.

1

u/Dazzling_Music_2411 11h ago

start reading the book SICP, which is designed for learners,

Pff, puh-leez, I love SICP, but it's a book for "learners" only if your "learners" are first year EE engineers at the most prestigious/competitive uni in the world, and in the late 1970s. These days I would class it as a difficult, serious book for CS students looking to go deep, especially the last two chapters. Have you actually used it, or are you just repeating something you heard?

However, I do appreciate your spirit, so what I would do is recommend something like Racket, which is a full batteries-included learning and development environment (I think there's even a book on text adventures to go with it), but that is ONLY if the OP is brave and wants to venture into a Lisp environment at all. Absolutely brilliant if it works, but NOT for everybody. "How to Design Programs" by the Racket authors, is a great instructive book.
One thing OP could do is watch the first 5 or so lectures of SICP online, see if that speaks to him. You can do that in Racket, too, there's a special setup, no need to download MIT-Scheme.

Other than that, Lua would be the easiest most fun environment imho, as an occasional hobbyist, or Python, at a push, if you want something more for programming-in-the-large.

1

u/xpusostomos 10h ago

Yes, you should forget the last 2 chapters, but why denigrate the whole book, just because it eventually scales heights that few reach?

1

u/Dazzling_Music_2411 10h ago

Well I said I love the book, I've taught from it, including in school contexts with the early chapters and HOP stuff, so I'm not sure where you get your "denigrating" comment from. I am also realistic enough to know where it will pose problems for beginners. Which it will.

Further, I recommended the OP watch the first few lectures online, to see if it appeals to them, and recommended a modern environment wherein it could be used - don't see how much more "denigrating" I could be! 😂

1

u/PigDog4 9h ago

and in the late 1970s

My CS1 course was in scheme in 2010. The next year my uni changed it to python because why the fuck was it scheme for general CS1?? Also exams were typed in a text editor with no bracket matching. It was total ass. Put me off programming for years.

1

u/Dazzling_Music_2411 8h ago edited 8h ago

because why the fuck was it scheme for general CS1?

Haha, and now it turns out that all mainstream languages are taken over by AI, and what you need are things like OCaml or Lean which you would have precious little chance of ever understanding if you hadn't started with the easiest functional language, Scheme...

Love it when a plan comes together.

PS. Your uni using an editor with no bracket matching was criminal.

1

u/ookkroam 18h ago

honestly for once a month hobby coding i'd stay with typescript, but drop vue for a while and just use plain ts with the dom. most of the pain you describe comes from juggling the framework on top of everything, and a text game doesn't really need one. i did something similar and my hours stopped getting eaten by tooling quirks once i cut the stack down.

1

u/Comakip 18h ago

Maybe look into GameMaker.

1

u/W31337 14h ago

JavaScript is ass try c# or python or something more structured

1

u/jacksonanna373 12h ago

For a text game, TypeScript's `interface` and `type` overlap for object shapes; pick one and move on. Use a type alias when you need a union.

1

u/UhLittleLessDum 12h ago

Python is like the do-everything, but do-nothing-perfectly language...

If you're into UI, like you want to see something pretty, than probably Typescript is where you want to be (or maybe Kotlin for Android or Swift for Apple, but probably TS).

The types will help you, I promise. I use TS for everything... even little scripts over javascript because it makes the dev experience so much better.

1

u/DanKegel 9h ago

Golang has very few surprises, give it a shot.

1

u/betarage 6h ago

I think that using type script is not really worth it. I would just use JavaScript and html to make web pages and browser exentions. and maybe learn another language like lua or python for offline desktop programs

1

u/Relevant-Reward4302 18h ago

Lua was practically born for lightweight games and scripts. You already know it, so lean into it.

-2

u/Ill_Nebula_2419 18h ago

Claude code language 😂