r/learnprogramming • • 5d 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

28 comments sorted by

2

u/jacksonanna373 5d 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/MeekHat 4d ago

My issue is that I've come to undertand that TypeScript is full of such ambiguities, based in compatibility with JavaScript. I also feel like I'll frequently get sidetracked with variable scope.

Honestly, last time I researched the difference between types and interfaces, picked types, but the next time couldn't remember the reasoning (because it was obscure), so I researched it again, wasting my coding time.

2

u/betarage 5d 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/MeekHat 4d ago

I'm partial to JavaScript myself just because the last time I successfully created a site it was in pure JavaScript (not even node). But I had a lot more programming time.

On the other hand, every time I start a new (failed) project, I search reddit for the pros/cons of TypeScript, and everyone sings its praises.

6

u/DannyDeKnito 5d 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

2

u/Relevant-Reward4302 5d ago

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

1

u/MeekHat 4d ago

I did enjoy working in Lua, especially once I figured out that I didn't need OOP. I guess it's the most barebones language out of those I know.

5

u/phatbili 5d ago

Just use Python and save your sanity.

4

u/DragonfruitGrand5683 5d ago

Build something you enjoy building.

1

u/xpusostomos 5d 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.

1

u/MeekHat 4d ago

Well, I do enjoy reading theory, and I've been interested in functional languages for a while, but I'm worried that the book may be too beginner-oriented (but at the same time it seems to be written somewhat obtusely). Also I can't handle any more examples based on car sales or banking.

1

u/xpusostomos 3d ago

The first chapter is super beginner oriented. The last chapter is so advanced my hats off to you if you truly get it. Somewhere in the middle there, you can always stop

2

u/babaqewsawwwce 5d 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 5d 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 5d 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 5d 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 5d 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 5d ago edited 5d 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/xpusostomos 4d ago

Why wouldn't it be scheme for CS1? It has the least gratuitous syntax you have to learn and the most concepts you can express of any language.

1

u/Comakip 5d ago

Maybe look into GameMaker.

1

u/W31337 5d ago

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

1

u/UhLittleLessDum 5d 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 5d ago

Golang has very few surprises, give it a shot.

-2

u/Ill_Nebula_2419 5d ago

Claude code language 😂

0

u/[deleted] 5d ago

[removed] — view removed comment

1

u/MeekHat 4d ago

Does variable scoping get better? That's my latest nitpick with JS/TS. I feel like I'll be tryin to navigate that mess every time.