• He/Him

30s || πŸ‡§πŸ‡· || Plenty of smut repost so πŸ”ž|| Occasionally random thoughts and/or games

Last.FM


programming side of cohost, is there a good resource list/explanation on what each language is good/excels at?

I've picked up HTML and PHP a lifetime ago (pre-pandemic) and a thing I enjoyed about HTML/CSS/JS is that it was very objective about what you do with it. All other languages are for more expansive and vague, which gives me both major anxiety paralysis and also simply not knowing what the end game goal of learning one is supposed to be.


You must log in to comment.

in reply to @Adell's post:

Most of the time it's the other way around. Once you know the basic concepts of programming, to grow further you have to pick a goal and work backwards. Like, if you want to mod Minecraft, you would start by finding an open source mod and taking it apart to see how it works, then make changes and see what happens.

most mainstream languages are good enough at everything. there are dazzling high-performance web servers written in lua, there are extremely popular robust 3d games written in java

the differences are huge and irreconcilable, but broadly a matter of taste. what ways of structuring data/code best suit your mind and workflow, etc.

i would say the best way to move forward is to decide on a very small project -- like a rock-paper-scissors game or a to-do list or something -- and write it in a few of the heavy hitters (like say c# and python which are wildly different and very popular languages) to see what you prefer

Thanks!

I know a lot of language names but not really anything that has been done with them, so I'm going to assume (especially given from your post) that I could, in theory, pick up Python and attempt to make something game-y with it?

Also, can I make 'joke-y' executables in Python (or any of those)? For example, I've been thinking about making a dice-roller that gives me different results, but as a computer .exe rather than something hosted online

Oh I think Python might not be the best choice for that because it's an interpreted language. Meaning you don't make executables with it, you run a language interpreter and give it the file.

There are probably ways to go around that to create an .exe but that's not what it's made for, you know? It's like PHP, you need to have PHP installed to run it's scripts.

What you want is a language that can be compiled. I learned a lot through C++ but I'm not sure if it's the best choice... But (most) compiled languages let you create a .exe

Oh, I see! I've done an .exe in the past with Pascal with a little toying around, but I'm not sure which popular languages could be used to do something similar.

I get that there's specific uses tho, yea, it makes sense!

I don't think there is a single resource that can properly compare programming languages quite to that degree, but there are a lot of descriptors a given language can have (static/dynamic/duck typing, strong/weak types, compiled/interpreted execution, imperative/functional/declarative syntax, etc;)- developing a good intuition for what these descriptors mean is a huge part of that. After you have those figured out, when someone describes a "strongly and dynamically typed, interpreted language with imperitive syntax", you can say - oh! Like python! I know what python is good at, so how is this different from python?

Also important to note, as long a language is turing-complete, you can express any computationally-possible idea with it! Some languages might be better at a particular task than others, but that's not always obvious from the outside- it takes a lot of experience to know how to apply some of the more complex language features.

And that means doing a lot of programming with a lot of languages! You can try to reason about some of these properties all you like, but it takes working with them to really understand them well. I'd also recommend reading Madhadron's newly-minted canon, the seven programming ur-languages - this will give you a great overview of the major syntax styles and how they effect the way you program. But also go play with these languages! It's the best way to learn.

I'll save that page, thanks!

I've been getting the idea that I should work backwards with a goal in mind rather than forward, but that's an odd way of thinking that will take some time to get used to.

If I were to make a vague goal of 'making a game' for example, could I still pick a random language (I've been thinking about Python, since its one that there are courses readily avaiable and I've toyed with it in the past) and work from there, or is that still too vague and too ample and I should try to narrow down my scope?

edit: Also, can I make 'joke-y' executables in Python (or any of those)? For example, I've been thinking about making a dice-roller that gives me different results, but as a computer .exe rather than something hosted online

Making a game is a fun starting project! It's really common for folks to get into programming in order to make games. One thing to keep in mind is that games as we know them are actually quite complex and multidisciplinary- they involve a lot of logic around the game mechanics, managing inputs and control, graphics programming, sound design- and those increase in complexity and scope for 3d projects. If you decide to make a game, just keep in mind that they're quite difficult, so don't feel bad about a lot of early failures (because there will be a lot!)

It can help to reduce the scope of your first few projects- so if you're making your first-ever game, try skipping complex 2d/3d graphics, and just printing characters out to a terminal screen- you mentioned the dice roller, so maybe try recreating a dice game like Greed or Pig. That will reduce the complexity to just the game logic and some very simple console printing, so you can still learn about game loops, input handling, etc; without getting bogged down on some of the more complex details.

I think your background in web programming will be useful, but it can also make some of the terminology that you'll see around general-purpose programming a bit more confusing! I hope this might fill some of those gaps:

  • a file extension (.exe, .txt, .pdf) does not actually guarantee the contents of the file- you can change the extension to whatever you'd like. File extensions are intended to let you know what's inside and give your operating system some clues on how to interact with it, but at the end of the day, a "file" is really just a place to put a bunch of bytes.

  • how you execute a program depends on whether it's written in a compiled or interpreted language.

** In a compiled language, you need a rather complex program (the compiler!) to translate that source code into something your machine can actually run- so eventually, binary code. This means that all the source code has to be processed up front to create that target, which will be a separate binary file. C/C++, Go, and Rust are compiled languages.

** In an interpreted language, you would use a different kind of program (an interpreter!) to process your input file at runtime. So instead of creating a binary up front, the interpreted program is just the source code file, passed as input to the interpreter, which executes the instructions as it reads them from the file. Most interpreted languages will process the source file line-by-line. Javascript and Python are interpreted languages.

** HTML and CSS are also interpreted (by your browser!), but they are not independently turing-complete (individually, they cannot be used to solve all computationally-possible problems), so they aren't considered true programming languages. You would not choose them for general-purpose programming- they have a more specific use case.

  • Compiled programs are typically faster to execute than interpreted programs, but they also require a (sometimes lengthy) compilation step before they can be ran. Interpreted languages tend to be a bit more flexible, and you can run them the moment you've stopped typing the source code- but if your code has an error, they'll just stop running halfway through the file!

  • There are a lot of tradeoffs here, and it's a bit more complex than my introduction. Keep in mind that, especially as a beginning programmer, speed is ultimately not an important factor for choosing a language. If your program is running slowly, it's far more likely that you just need to approach a problem in a different way, like using fewer nested loops.

  • an exe file is just a program that has been packaged to run on windows. That can mean a binary file targeting the windows runtime, in the case of C++, or that can mean a python file bundled with the python interpreter! I wouldn't worry so much about creating an exe specifically- nicely packaging a program is important for distributing it to run on other people's machines, but when you're learning like this, just use the easiest method to execute your program on the development machine. Invoking the interpreter on a python file directly with a desktop shortcut is usually fine for personal use.

  • but yes, you can create silly little programs, and run them whenever you want, however you want, and have a lot of fun doing so! Every language will give you some way to do that- some are easier to use with Windows than others. Python is a very good starting spot.

I see, this is an extended, interesting response!

I'll try to pick up Python and/or a C language, though I'm wondering if there's a preference for C++ or C#, if either is more modern or more used. I'll probably get C#, but still curious.

C# is probably the easiest to get started with in windows! It has more in common with Java than C++ or C, but it's also very popular and has a growing ecosystem. C++ and C are much more focused on performance and memory management- you'll find them more in robotics programming, embedded systems, some game engines.

This is I think contradictory advice a little bit, but very often I've found that as soon as you drill down what you want to build to specific kinds of technologies you'd like to build it in, then the language to do it in stops becoming a choice and starts becoming "no you have to use this language". examples:

Games! if you want to use Unity, you have to use C#. if you want to do Godot the best choice is GDScript, and so on. there are technically alternatives, but it's generally not a good idea to start with those as a beginner; after all, 99% of the tutorials and online resources are going to be in that main language.

Ditto for native UI development. For android you should be using kotlin, on ios it's Swift, for cross platform desktop it's qt with C++. there are other choices, but those are clearly the "best" choices when you start from that angle, if that makes sense.

less specific things, like "backend app development" or "data processing" are going to be much more open-ended though. I've found that if I want to learn a language for it's own sake, doing something like writing an HTTP server or a compiler is a great way to do that without needing like a giant API or infrastructure to make that possible

Games! if you want to use Unity, you have to use C#. if you want to do Godot the best choice is GDScript, and so on. there are technically alternatives, but it's generally not a good idea to start with those as a beginner; after all, 99% of the tutorials and online resources are going to be in that main language.

Ditto for native UI development. For android you should be using kotlin, on ios it's Swift, for cross platform desktop it's qt with C++. there are other choices, but those are clearly the "best" choices when you start from that angle, if that makes sense.

No, no, this is exactly the kind of answer I was looking for, thanks for that! I want the "You have to use these languages" type of ideas, because that narrows it down and helps me understand a path better

if you want to make a prototype (because you're not sure what you want to make!) then python is an excellent choice. search "python (thing you're trying to do)" and there's like a 90% chance someone's written a library for it.

A little secret is that once you pass "basic code literacy", you stop finding tutorials for languages and start finding tutorials for libraries and frameworks. Websites aren't written "in javascript" they're written in React, a core library that extends javascript. Visual novels aren't written "in python" they're written in RenPy, platformers aren't written "in C#" they're made with Unity (or Godot), etc.

I think the problem is that you're expecting that, like, since PHP is a "language for writing interactive web forms", that there must also be a "language for writing rpgs", but it turns out that purpose-specific-languages are actually pretty rare! What's more common is to take a general-purpose language and customize it with tools and libraries built on top. So the reason I say to look at a finished project is that you don't just need the language, you need the little pile of stuff strapped on top, the "software stack" as its sometimes known.

If you want my recommendation for a minimalist 'stack', I'd say look into Electron. It gets some hate for being a memory hog but it will let you write a .exe using the html and js skills you already have. If you want to try something new, Deno + Webkit looks like a neat up-and-coming stack for making a .exe out of js.

Oh yea, I've used Bootstrap libraries for HTML so I'm aware that learning the basics of a language is really a tutorial to know what libraries do and how to use them, but thanks.

Despite bringing up the HTML/CSS/JS before, I'm not terribly fond of it and really wish to branch into something else; I liked PHP better, but felt really aimless when doing OOP because at the end of the day I didn't knew what I was supposed to do with all that; When doing front-end, I can easily visualize the changes I'm doing and what I can use that for, but back-end wasn't that simple.

In the end I think I'll take either Python or C++/C#; There's also a question about that, are all the "C" type languages branches of each other, or upgrades? I see C++ and C# brought up often, especially when its about game developing. Would picking up C# straight away be too complex, or is starting with C the intended path?

I would start with C since it's simpler, C++ started as a "mod" for C but now its its own thing, and C# is completely unrelated, the name is just marketing, its actually a Java clone.