Etarc Coders Club

A few weeks ago I said I was planning to learn programming, and asked for advice from the community.

The response was very positive, lots of people offered advice, and a number of people said they would also like to learn, or refresh skills they hadn’t used for many years. I half-jokingly suggested we could form a club, and share the experience - surprisingly, the idea wasn’t met with an absolute “No!”.

The more I thought about it, the more I thought it might be something people would actually like to do. We could share code, projects, experiences, problems, and advice, in a safe and non-critical environment. We could encourage and learn from each other. We could make some stuff. And I thought “Well, it’s not going to happen unless somebody makes it happen”. So I decided to try it out, and here it is. The Etarc Coder’s Club.

Whilst it’s specifically aimed at people who want to learn programming, anyone can join in. You don’t need to be a skilled programmer - I am certainly not, and the assumption is that neither are the rest of us. It will, however, be helpful if people have an interest, and are willing to learn.

13 Likes

Why Python?

I have chosen Python as the basis for my present studies. There are lots of other languages out there, all with their own benefits and drawbacks. So you may say “Nobody makes 3D open world games in Python - I want to learn C++”. And I wouldn’t argue with you. I, however, am studying Python. Once I feel reasonably proficient in that, then I’ll move on to other stuff - but for now, I want to get the basics down.

Python is free. Programs written in Python are largely free from copyright restrictions and other legal problems.

Python is available on Windows PCs, Linux PCs, Apple Macs, Rasperry Pi, tablets, and most mobile phones. Unfortunately it can’t be used on consoles, but AFAIK, there’s no programming language that can.

Python is a modern programming language. Unlike BASIC, Python is designed with object-oriented programming in mind. It’s much easier to transfer skills learned in Python to another modern language.

Python is widely used for teaching programming - which means there’s a huge amount of high-quality free teaching material out there. If you want to learn Python, there are thousands of organisations and individuals willing to help.

Python is also used in a lot of commercial and professional software - so it’s not like it’s a beginners language, with no practical application. Far from it.

Of course, there are a down sides. Compared to lower-level languages like the “C” derivatives, Python can be slow. For a lot of programs, that doesn’t matter so much, but for graphics-heavy games, it can be a problem.

The other down side is graphics. Native Python, the basic package, doesn’t really have any graphics capability at all. There are standard add-on modules like Turtle, Tkinter, and PyGame, which will add varying degrees of graphics capability, but at the expense of greater complexity. At the moment, I’m trying to learn Python. Add-ons can come later.

9 Likes

Thanks for starting! I have an idea that I should prototype in python. Not a full game but enough to entertain myself. I hope I’ll kick my own butt and get into gear. :persevere:

5 Likes

Thanks!

A couple of weeks ago, you suggested that I start by creating a text adventure game - and I thought that was a very good idea. So that’s what I’ve been doing. It’s not a full game - it’s more a test bed for ideas and techniques.

I thought about what the logic would have to do. It goes something like this:

  1. Move from starting location to intermediate location.
  2. Move from intermediate location to intermediate location.
  3. Move from intermediate location to end location.
  4. Move between locations with 1, 2, 3, and 4 exits.

The minimum map for testing all these conditions is one with 6 locations.

If the game logic can handle 6 locations, including all these conditions, then the same logic can handle 60 locations, or 600.

On that basis, this is the map I’m using:

I’ve worked up a couple of sets of code that more or less work with it, but use different logical concepts. Over the next couple of days I’ll try to post the code here, and people can play with it.

8 Likes

I want to know what the sign reads.

6 Likes

I must admit to severe pangs of nostalgia for the text adventure genre.

I will watch with extreme interest.

5 Likes

I did a text adventure in C++ when I was learning. Its a great way to learn many of the concepts that you will use abundantly. I later learned Java and I stuck with that and started developing apps on android. I never finished any app except a capstone project app that utilises everything I’ve learned so I had to finish it. I still have the app and its sort of neat. Its just a trivia game with a few questions and answers and gives you your score at the end.

I mentioned it before but I still recommend Codecademy to quickly learn the basics since its generally up to date and many if the lessons are free. I believe python is there too.

Moment of honesty(a little but of a rant too I guess, feel free to not read):
I stopped learning to make apps 1 year ago and havent touched it since. The reason being is that I spend a good 2 years learning and got very far but I have been discouraged to keep going. Its entertaining and I enjoy it and I would love to make a career out of it, or at least a side job out of it.

I am an EXTREMELY self motivated person. So I woke up at 5am every day to spend at least 1 hour learning something regarding Java and app development. And on the weekends I still woke up at 5am and spend 2-3 hours in the morning to learn and apply what ive learned into an app(an app that is essentially a “digital business card holder” where you can use the app to stay in contact with all your favorite local businesses and securely message and pay those individuals, loyalty to their business could result in discounts)

But, doing it alone made me feel… lonely. No one around me wants to learn app development. :confused:

If someone else would work on it with me, I would get motivated again. Heck, I have proven to myself that I can do anything if I just had some company, so I know that loneliness is the issue here… but at this point its just a login page that stores login credentials when you sign up on google firebase and takes you to an empty home activity with a very basic calendar.

8 Likes

“Flood Control Dam #3”?

5 Likes

So the cave to the east is damp. :ant: :cockroach: :bug: :snail:

4 Likes

A couple of observations on posts so far:

You’ll be able to find out in a day or two. I will post the code, and you can either read it or run it.

Alternatively, you could fire up your PC, load a Python IDE, and write your own dialogue. You could add locations, actions, characters, consequences… You don’t have to use my ideas - you can add your own. That’s what it’s for.

Well, you’re welcome to - but it would be a lot more fun if you joined in.

Perhaps I wasn’t clear in my introduction. I am learning Python, but you can discuss any language you like. If people want to kick around ideas about C++, Java, or anything else, that’s fine. That’s kind of the point.

I’m not the owner of the club. I’m just the guy who thought it might be nice. It’s a place for people to share ideas about learning programming.

If you’re developing code that you later hope to sell commercially, you should think twice about posting it here. You possibly shouldn’t even discuss the details. This is a public forum - anyone can read what we post here. If you do have an idea with commercial potential, you don’t want it stolen and copyrighted by someone else.

8 Likes

I am currently working for a tech startup called NuNet, a decentralized cloud computing network. Here is their Gitlab (similar to Github) where all the project’s open-source code is kept (they use Python I believe):

We are currently in the public alpha testnet phase. If you are interested in helping test and earning bug bounties, join our Discord and choose what you would like to participate in via the #role-assignment channel:

3 Likes

I sort of gave up on it and dont mind if anyone does it. :slightly_smiling_face: My idea was just for educational purposes but making a job out of it would be nice. It was never a secret and I believe its been done already a few times. The ideas I DO have are locked away in a special journal where I have verified that no one has done before. :wink:

As for my C++ mention, I was just implying that I did a text adventure once in it. I should learn python too at some point, however. :thinking:

Very interested in seeing your text adventure game. it might push me to take the time to learn python.

5 Likes

It’s not a text adventure - at least, not yet. At the moment I’m just kicking round some ideas, and testbedding different approaches.

Bear in mind, until two weeks ago, I hadn’t attempted any serious programming for more than 40 years. This is very much a learning journey.

6 Likes

For the people learning Python, do you know what a Jupyter Notebook is?

It’s an interactive Python environment that runs locally in a browser window. You type your lines of code and “press play” on them and it executes them and shows you the intermediate results. When you write code in a text editor, it doesn’t show the intermediate results, that’s the difference.

Say, you want to experiment and compare outputs of different arguments, you don’t have to save, switch from editor to command line, quit the previous run, and rerun the whole thing…

E.g. you could edit properties of your text adventure rooms and preview them in context while you type the next ones. I use it to quickly preview the effect of random numbers, and to visualise series of numbers as plotted lines or scatter plots. – The visualisation later in the game will be different and better, but we haven’t written that yet, have we.

Alternative, Goggle has a no-installation-needed web app with the same interactivity:

(Note: Just for us practicing. Don’t upload your proprietary code to Google’s research servers.) :wink:

6 Likes

You can do something very similar with Thonny - except you don’t need the internet connection. Everything is done on your local computer (You do need to have both Python and Thonny installed).

Thonny will also allow you to have the text editor and terminal screens open at the same time, so you can immediately see the effect of changes you make to the code.

https://thonny.org/

6 Likes

This is a test how we can post code samples here. Maybe attaching or linking to a file would be better?

Test 1:

Using only 'Hide Details'

I am a comment

A line wi.th * random[1]{2} special(3) characters
Indented with four spaces
With 8 spaces
“”"
Multiline comment syntax
“”"

Test 2:

Hide Detail + Preformatted (first and last line three ticks)
# I am a comment
A line wi.th * random[1]{2} special(3) characters
    Indented with four spaces 
        With 8 spaces
"""
Multiline comment syntax
"""

PS: Aha, a gardenfence # plus space followed by text is formatted as heading in this forum…

4 Likes

I don’t think this implementation of Discourse allows files, other than .jpg / .png

And I really don’t like Google. I don’t trust them at all.

I’ve been trying to use standard HTML tags for code blocks, but it seriously messes up the formatting.

4 Likes

It was also replacing my single tick quotes with curly quotes - which Python then didn’t recognise.
It was changing some single-line spacing / line wrap to double line spacing, which messed up all the dictionaries.

2 Likes

Does applying “preformatted” style and then pasting the whole code sample work for you? It worked for my tiny example anyway.

3 Likes

Just a couple of things I’d like to throw in here:

This actually applies to all programming languages. Proprietary programming languages are a thing of the very distant past, a concept that could not survive the industrialisation of software development. For the simple fact that if you want a language to succeed, you need a lot of people that are proficient with it, a goal impossible to attain if you’re gate-keeping access to your language.

The idea that there might be languages where you have to worry about copyright is that newcomers are often unable to separate the different layers of abstractions that you need to actually write modern software. That’s not a criticism, this shit be convoluted. In the interest of helping with that understanding a bit, let me pick this apart a bit, and also show where things like copyright may become a concern.

So, in modern software, there’s different layers of abstraction that often get convoluted. There is…

  1. The language you’re writing in
    This usually consists of a compiler/interpreter, and a standard library.
    There’s compiled languages and interpreted languages, and then there’s things in-between. In the earlier days these were called “real programming languages” and “scripting languages”, but the distinction has mostly vanished and interpreted languages are no longer being considered inherently inferior to compiled languages.
    The difference is, a compiled language gets compiled into an executable in machine code, and can be run by the OS it was compiled for without any further supporting infrastructure. An interpreted language is never actually compiled, programs are distributed in plain text (which makes protecting proprietary code damn near impossible), and the machine running it needs an interpreter installed that actually runs the program for it. Sometimes, some of these interpreters may be proprietary and you may not be allowed to distribute the interpreter with your code, meaning that you have to get people to install it separately.

The “standard library” of a programming language contains frequently used data structures and functions in that language. The language strictly on its own really just contains the necessary core sysntax to make it turing complete. Primitive data types, conditions, loops, function and class infrastructure, that stuff. Nowadays, most languages are effectively unusable without their standard libraries, which is why they’re usually distributed with the language by default and are most commonly open source, as are compilers (yes, even microsoft’s C# has been open-sourced like over a decade ago… Languages that try to gatekeep simply cannot survive)

  1. The runtime nevironment your program runs in
    Programs are designed to run in a certain environment. Here things can get very confusing. For interpreted languages, you’d assume this is just the interpreter, but that’s not really the case. Also, there’s the issue of compiled languages that don’t actually compile to machine code, but compile to code readable by a certain runtime environment. This includes most famously Java (which is compiled for the JVM) and C# (which is compiled for the CLR), but also a host of other languages like visual C++, Groovy, go, ruby, kotlin (though kotlin can also transpile to javascript or compile natively for GraalVM) etc. Quite frankly, languages that compile to actual machine code for a specific OS have become rare indeed, because multi-platform capability is a major consideration nowadays.
    But the problem is also that many things come with their own embedded runtime environments nowadays, making them effectively their own platform. Most famously this is the case for browsers with javascript. But it’s also the case for many game engines. If you’re using unity or godot for example, you’re writing C#, but your code will actually be run by a vritual machine embedded in the engine, so effectively constitutes its own runtime environment.
    And this is where things get most complicated in terms of who owes what to whom, really, and conditions vary wildly. Something like RoBlox is effectively “well, technically your code actually belongs to us”. Unity doesn’t lay claim to your code, but requires you to either display their logo or share some of your earnings. Some game engines are completely free, like Godot, and for some you have to pay a licensing fee, like unreal, etc. Which brings us to the next point:

  2. Engines and Frameworks
    Trying to exactly define what constitutes an engine has become damn near impossible nowadays. OpenGL is called an “engine”, even though it’s a library, something like LibGDX gets called an engine, even though it’s really a framework, etc. We’ll get to all of these. For our purposes right here and now, let’s define an engine like this:
    A program that provides abstractions for the most common taksk to solve, like graphics, sounds, physics etc., where modifying the code directly is not required nor usually possible. You are provided with a runtime environment in which you can run code that does stuff using the engine, without actually modifying the engine itself. Usually, the code you write for the engine is not in the language the engine is written in. Almost invariably, engines are natively written in C or C++.
    Engines are almost invariably proprietary. People usually want to make money with these, with Godot seeming one of the very few exceptions that are actually able to compete with proprietary engines.

  3. The framework
    A framework is a piece of software that wants to run your code… though in this case, the code you write is in the same language as the framework. When you compile, you compile both the framework and your application code. Frameworks are intended to give you some form of structure, an entry point into your program and a defined workflow, essentially be a “frame” around your application that does all the generic nitty-gritty stuff that needs to be done while leaving you free to write the actual code that makes your program your program. Frameworks have mostly come to prominence in web-development, where their number is legion, with microsoft’s .net framework leading the market on the CLR and Spring doing the smae on the JVM (and after those two runtime environments, there’s really not much of a market left in web-development…).
    Engines as per the above definition usually provide a framework within their runtime environment to make working in it easier. That framework may even be open source, which does not mean the engine is too. Something like LibGDX is not actually an engine by the above definition, it’s a framework (and a surprisingly unopinionated one as far as frameworks go…)

  4. Finally, we have Libraries
    Libraries are collections of code that do certain things. You pull them into your code to do those things. They may give you a workflow for how to exactly do the thing it is they do, but they don’t affect your program as much as a framework would. They just affect the one thing they do. Which can still be significant if you’re using something like Bullet for your physics, but almost negligible if you’re using something like jackson to read and write json. Effectively, libraries are what enables productivity as a programmer. You think I go and write a parser when I need to read some XML file? Yeah right, I’d never get anything done. No, there’s libraries in your language that can do that, probably multiple ones from multiple sources. If not, you should seriously consider switching languages. The available libraries around a language are what’s called its ecosystem, and it’s the single-most important indicator for whether a language is going to survive in the long run or not.
    Libraries are usually open source, but some bigger ones may be proprietary and require a license for inclusion in commercial products (like e.g. Spine).
    Here’s also another major difference between frameworks and engines. In an engine, no matter what language you’re writing in, it won’t be easy to just use any library written in that language. Engines usually have their own ecosystem of libraries specifically written for the engine. Frameworks, on the other hand, don’t have that issue and can use the full ecosystem of their language.

I’ll stop now, because your head may be spinning. What I haven’t mentioned yet are editors and IDEs (the programs you use to actually write your code in), which may also require a license fee for commercial products, but usually don’t.

10 Likes