r/CodingHelp • • Oct 27 '21

[Python] Can someone explain coding to me?

Doing some research on coding as an interest and it should be said that I have never done anything like it. Completely green to everything. I am more or less curious as to how much of coding is actually Google searches and stack overflow. I'm am also aware that coding is apparently beyond frustrating. To quote a meme, "An error on line 56 would have been fine, but an error on line 140 in a 70 line file???" This sums up my knowledge of coding. Any answers are appreciated and please let me know if this question should be asked elsewhere.

23 Upvotes

30 comments sorted by

17

u/Available_Ad_6021 Oct 27 '21

I dont get your question...

6

u/HeyTony94 Oct 27 '21

Ah, my bad. I guess I want to know what experienced coders would say about the actual learning processes of coding. Like how much do you actually use Google and stack overflow? If you don't use either, how difficult is it? I understand these are questions with broad spectrum answers but I don't know another way to word it.

9

u/Available_Ad_6021 Oct 27 '21

Alright ! Every programmers are using Google, but at a different pace depending on : wether it's a recent projet or not, if that's their project, if that's their main language, and so on... Talking about the sites used: it doesn't matter as long as the answer resolve your problem. I really think that those who dont use either have either a high self estimate or they're not allowed to do it. If you're not using Google, that must be because your program is short, because that's a hell of waste time to code a big program with only your knowledges. If you have other questions dont hesitate to Ask them !

3

u/HeyTony94 Oct 27 '21

Thanks for taking the time! What is the preferred language for game design and does the language change depending on what part of the project is currently being worked on? Is there a language that would be considered common sense to use over others and which languages should be avoided? What is the bare minimum of skill I would need before I begin to look at a first personal project? What would you say are the most reoccurring issues with coding in general?

2

u/DarkestStar77 Oct 27 '21

Game design does not have a preferred language. C, C++, Python, Ruby, Java, the list sort of goes on. I'd suggest picking a framework or engine to start with, and then learn the language it uses.

Check out Dragon Ruby, or PyGame, as good starting places.

2

u/HeyTony94 Oct 27 '21

Could you explain in depth a little more about frameworks and engines? I'm not familiar with the terminology.

2

u/[deleted] Oct 27 '21

A framework is a bit of code that provides some sort of generic functionality for you, allowing you to build your program off of it, as the name implies. A game engine is a framework designed for game design. Some of them can be pretty advances and provide most of the physics, model design, and rendering that you need for a game.

1

u/DarkestStar77 Oct 27 '21

A framework is a set of functions and libraries built on top of a language. Typically they provide some graphical short cuts and mechanisms to manage game specific chores, but otherwise it is up to you what you do with it. Dragon Ruby and PyGame are frameworks.

An engine is a framework but it encompasses a full render pipeline, tools for asset creation, specialized data formats. Sometimes they use a proprietary language as well. Generally you are programming game logic, and nothing else. Unreal engine, Unity engine, Godot engine, even the old Quake engine are examples of engines.

I'd recommend a framework if you actually want to learn coding. The two I recommended are both based on simpler languages with lots of tutorials and community support, while both are capable of making a basic 2d game like Asteroids fairly easily. I think my version of Asteroids in PyGame is less than 100 lines of code.

4

u/Nightcorex_ Oct 27 '21

Yes, language changes depending on what part you are working on.

Say you build a website: You need HTML and CSS to define how your website looks (both aren't actual coding languages but rather so called "descriptive languages").

Then you need JavaScript to actually make the website interactive (JavaScript basically just says: If a user presses this button, then add/delete this and this from the HTML and/or CSS, or go this completely different website, or load and play this video, etc.

These 3 languages are only the frontend (what the User sees).

If your project requires backend (most websites do), then you'll need some language like Java, Go, C, etc. for that backend-server.

Then you might need a database, for which you'll need SQL.

All of this then needs to be hosted on a server and depending on how big/safety relevant it is you'll need your own server(s) for which you will need to know not only the theory behind internet data transfer, but also Linux knowledge is required (put this paragraph in parentheses, because usually you don't need this, although some Linux knowledge is very helpful still).

0

u/Available_Ad_6021 Oct 27 '21

In video game's industry, the language used depend on : which platforms you plan to release your game. In PlayStation, the game engines used requires that the code written is in C/C++. In Android, it depend on your preferences, but you'll find : C++, Java, Kotlin or even Javascript. In IOS it's Swift and Objective-C. But in general, I'd recommend to learn the C++ for everything relating to video games because it's a language: close to hardware, cross-platform and powerful.

Most of the games are written in at least 2 languages. As long as your game engine support them 2 languages...

There're not really a language to avoid, but if you wanna write a game fully in one language, I wouldn't recommend you to use Python. Why ? Imagine doing debugging in a +200 lines of code program where you have no clue if the variable is new or not... (there's no "int" or "var" in behind variables to say : "Hey i'm new).

What's the requirements to start a project ? It can go from 0 requirements to a lot. Some poeples learn a language by directly doing a project. For example : you wanna do a tetris (assuming you know the basic syntax of the language used and the concept of OOP) , you can directly go to Google, search for the best library/game engines to use for you project, look at the documentations and search help on Google when you're stuck on something . That's the hard way but you'll learn a lot. But you can go through the easy way, by searching for books (try to avoid youtube videos) that'll teach you the blueprint to realise a project. I recommend Udacity as a good start.

The reoccuring issues are : the lack of organisation in your program. Sometimes, you just wanna go straight forward and develope a program with no plan, and that's when get stuck on errors that could've been easily avoided. So don't try to be the fastest programmer, but the more organised programmer. Always wonder :" How can I minimise this code ? How can I organise my code in a way that any programmers could read it easily ?". Also, the lack of comments lead to a lot of issues.

2

u/Cactus1105 Oct 28 '21

A lot are also written in c# but itโ€™s quasi the same thing as c++

2

u/Available_Ad_6021 Oct 28 '21

Yeah my bad ! It's ร  shame that I didn't mentionned it... Thanks !

10

u/Paul_Pedant Oct 27 '21

Coding is explaining to a machine controlled by a moron, how to accomplish a task you don't understand yourself, in a language that does not make sense.

5

u/HeyTony94 Oct 27 '21

Wonderful. Reminds me of another meme where coding was likened to arcane magics. You use very specific instructions to invoke mysterious happenings and if you get it even a little bit wrong, you risk destroying everything.

2

u/[deleted] Oct 28 '21

Per no specifications not provided by executives that don't know why they want this anyway

1

u/Paul_Pedant Oct 28 '21

They eventually figure out exactly what they want it to do. Pity it is always only two days before the release date.

4

u/skellious Intermediate Coder Oct 27 '21

Learning to code is like learning to walk. you'll fall over a lot when you first try, but over time you'll fall over less often and be able to accomplish more useful things with your new skill, like walking to your friends house instead of just across the room.

Similarly with programming when you first start you will forget things like the exact syntax to use in a certain circumstance but over time you'll find it starts coming to you without thinking about it. and you'll go from making projects that feel pointless like a script to add two numbers together to projects that actually feel awesome like writing a program to help your friend's business calculate the weight and packing density of their packages (sounds boring perhaps but it's the kind of thing that can make a LOT of money.)

1

u/HeyTony94 Oct 27 '21

What's an all around good starting point? I've seen Dragon Ruby and Pygame as suggestions. Do you agree? And can these be practiced with on a run-of-the-mill laptop from Walmart?

2

u/skellious Intermediate Coder Oct 27 '21 edited Oct 27 '21

Absolutely. If you're wanting to make some starter games pygame is a great option. If you want to do games more seriously it's worth learning either unity or Godot. (You could do Unreal Engine 4 but that's generally aimed at higher end games.)

If you're just wanting to do general coding, python is a great choice. Or if you want an easy way to make cross platform apps you could learn web technologies like HTML/CSS/JAVASCRIPT plus electron or similar to allow you to run the app on the desktop. That tech stack is what apps like discord, slack and VSCODE are made with.

Generally you don't need a powerful machine to make apps unless you are making something that does a lot of number crunching like a 3D game. Even then most basic hardware these days is pretty capable. You won't be able to make fallout 4 but you could with enough time and dedication make something like stardew valley or even factorio. It'll be a few years before you have the skills to really embark on a big project like that though. I'd highly advise starting will small projects with very limited scope that solve problems you or others around you have. Or just that do things you're interested in doing.

Some good starting websites that won't try to sell you things every five seconds are:

https://www.programiz.com/

https://www.w3schools.com/

1

u/Massive_Cable2333 Oct 27 '21

Coding is critical and methodical thinking expressed outward. We just delegate tasks to small machines, movement and creation of different data types to create an ecosystem that produces the sweetest fruit. And like math, we naturally go to the calculator even when we shouldn't. The goal is to create your own templates...after studying everyone else's. And green is full health ๐Ÿ˜†

1

u/coreeeeeeeey Oct 28 '21

Start with lisp

1

u/themidnightdev Oct 28 '21

Programming boils down to this :

Basics

-what kind of language am i using? Some languages are made for specific purposes, others try to be a cure-all, but fir every kind there are different rules to play by. OO (object oriented languages) are most common

  • syntax and notation

    How do i define things and execute basic operations in this language? What does a basic program look like? (Please note that Python isn't syntactically similar to most languages)

  • memory management

    Is this a 'low-level' language where i need to manage memory explicitly, or can i rely on a garbage collector to do that for me in most cases?

  • strongly typed

    Does this language require explicitly stating and/or converting data types (most C-like languages) or will it try to make the best out of any situation i present it with? (Javascript, LUA) What are the basic rules for these in this language?

If you have those down, you can program without having to climb into google every few minutes.

Advanced topics :

  • design patterns

    What logic is often used to solve specific problems (and does my language allow them?)

  • low level opererations

    What is this language doing 'under the hood' and how does it impact memory usage and performance?

  • mathematical topics

    How are mathematical problems that apply to what i am making commonly solved and how do i implement that in this language. (In game development for instance, trigonometry is a common subject)

If you have these down, googling becomes the exception rather than the rule.

1

u/themidnightdev Oct 28 '21

If you are lacking in any of these areas, coding is time consuming and may be frustrating.

Once you have a good understanding of things however, coding becomes more 'turning ideas into reality' than a canonical activity on its own.

The meme you quoted is basically an illustration of being presented with an error or situation that does not make sense to you (because you do not know what is happening) or even seems impossible (because your language or runtime is doing something funky that you cannot make sense of).

It is however not entirely outlandish ; scripts that modify themselves or assemble other bits of code into new scripts can totally do this.

1

u/SuspendedResolution Oct 27 '21

Well, coding is basically just logical processing. If you breakdown a process to its most basic elements, and wrote that out as instructions, you would basically have "coding". A computer is just a machine and code is just telling it what to do. You have to write out what you want it to do. Don't get me wrong, it's terrifying at first, but once you break it down, it's just instructions for a machine to do a thing. No different than you making a sandwich. The difference is you have to communicate how to "make a sandwich" to a device that speaks specific languages languages, is the smartest idiot on the planet, and you have to break things down for it piece by piece.

-2

u/AsuraTheGod Oct 27 '21

Coding is a combination of logic, maths and a little of imagination if you want to start to coding, you should start with C.

5

u/Available_Ad_6021 Oct 27 '21

Don't ever recommend someone to start with C. It suicidal type shit

-2

u/AsuraTheGod Oct 27 '21

Let me guess, bootcamp? lol

-3

u/ITZINFINITEOfficial Oct 27 '21

Start with Java