Advertisement

What am I Looking for in a computer

Started by February 17, 2024 07:02 PM
41 comments, last by Juliean 9 months, 1 week ago

Seamus_Arian said:
So C is a sort of foundational language? Learn that language and it'll help you branch into others.

No. “Learn that language and it'll help you branch into others” - than can be said about pretty much any language. All programming-languages share common concepts - variables, functions, etc…. Some focus more on OOP, others have different paradigms. So having learnt on language, learning another is way easier.

That being said, please don't listen to anyone recommending you to start learning programming with C. It's an extremely low-level language, and a horrible choice to start learning to program. People will sometimes recommend it because that's what they used to learn programming with, mostly due to not many other choices (or worse, because they learned it after already knowing programming with another language and thus misjudging what it takes to start programming with C). Learn some high-level language to understand the basics - C#, java, python, doesn't matter. Those languages will take away lot of the overhead of what C(++) requires you to take care of. If you learn programming with C, you will spend a lot of time wrestling with low-level concepts that are in no way of importance for you at that stage. You will also run into issues like memory-leaks, crashes etc… that higher-level languages take care of.

You can always come back to a lower-level language to get a better understanding of how things works under the hood; or if you need more performance or whatever. Learning C(++) then can widen your horizon, and help you manage complex tasks better. But if you compare the task of learning C from scratch; with learning any other high-level language and then C, you will most likely end up with the same amount of knowledge, in a lot less time. It was similar for me, too. I started with C++ but checked out; then I learned programming with Ruby in the Rpg-Maker, and going back made C++ much easier to learn.

Seamus_Arian said:
So C is a sort of foundational language? Learn that language and it'll help you branch into others.

Yes. Exactly. Because they are all based on C.

It is a low level language, so it helps to understand two things in one batch: programming, and how a computer works.
If we abstract the latter away, you might never learn to care about low level performance, which is critically important for games.

But as you see, opinions diverge. I do agree to other points from Julieans post. To avoid the downsides, this is how i imagine a learning process:

Get started with C to keep it simple.
But eventually ignore macros, pointers, and memory allocation / management. That's low level stuff which higher level languages do differently, so it can be skipped if you feel so.

Follow tutorials, YT videos, whatever beginner resources you find and like.
A typical simple text based game is ‘guess the number’.
The user can enter a number, and the program tells if it is correct, too high, or too low.
Pretty simple, but already a program which has logic and user interaction.

While playing your game, you might come up with a certain strategy.
You might find the way to win the game as fast as possible.
If so, you have just invented your first algorithm.
You could extend your program to play itself, using this optimal strategy you came up with.

At this point you understand what programming is.
You can lookup some other languages here if you want, which will feel familiar.
You can study concepts such as OOP, which become useful as your programs grow in complexity.
You can also try game engines like Unity, which will force you to use C#, making the choice of language pretty easy.

You should not keep stuck at C. Even if you like it, it misses a lot of high level functionality which is useful. If you like C, level up to C++, which is the language all current games are made of. Engines like Unity or Unreal are all written in C++. Just gameplay logic is often written in scripting languages to make things easy for devs, accepting some performance loss.

But if you start with high level languages right away, e.g. C++ or Java, it's very likely you get concepts such as OOP wrong. And those concepts also don't help to learn how a computer works. Contrary,m they only add complexity at a time where you have no need for it yet. It's distraction and confusion, and should be rather learned gradually, when you feel motivated to go there.

But i do not think my opinion here is the majority. In schools people learn about ‘objects’ (OOP) before they learn what bits and bytes are, if at all. That's no good for a field where performance and efficiency matters much more than in others, imo.

Advertisement

Seamus_Arian said:

Is best buy the best choice for computers or is there a superior store?

The way to figure this out is to “comparison shop.” Take the info you've been given and see what prices you can find, check some reviews, make your own decision.

-- Tom Sloper -- sloperama.com

Seamus_Arian said:
So C is a sort of foundational language? Learn that language and it'll help you branch into others.

No. As parallels, ancient Latin is a root language for Spanish, French, Italian, and Portuguese, but you shouldn't start with Latin if your intention is to learn one of those. Old Germanic is a root language for modern German (Standard High German), for and English, Dutch, Swedish, and Danish language, but you are better off not learning ancient Old Germanic or West Germanic if you want to learn modern German.

The common language C and C++ branched from was K&R C or C78. That language has been dead for decades. By the time of the C89 standard, C++ implementations were quite incompatible although C++ wasn't standardized yet. By the time of the C++98 and C99 standards they were totally different with both moving far beyond their common 1978 ancestor and away from each other. Other programming languages that borrowed heavily from it, including C#, Java, Objective-C, JavaScript, Go, Rust, Ruby, Swift, and many more, all have elements that stem from their common roots but are their own language.

If you want to learn those old languages, there are certainly resources for them. You can learn Latin as it was spoken 1500 years ago, you can learn the K&R C version as it was used in the 1970s and 1980s that inspired the modern languages, but you won't be using much of either in modern communications.

If you want to learn C++, learn C++. If you want to learn C, learn C. However, it is nonsense to say “I want to learn C++, so I'll learn C.”

frob said:
it is nonsense to say “I want to learn C++, so I'll learn C.”

But if you learn C++, you learn C as well, if you want / realize or not.
So how can it be nonsense to say just that?

I would agree with saying ‘C is a different language than C++’.
But that's not true the other way around. Then we need to say ‘C++ is a superset of C’, which i remember reading on that tutorials site. Personally i think ‘C++ is an extension of C’. And i propose to take the first steps in C because, missing those extensions, it has less complexity.

frob said:
K&R C or C78. That language has been dead for decades.

But you can still take this famous K&R book, compile and learn all code with your modern C++ compiler.
Just because there were newer standards later, the original standard is not dead?

I mean, i know this book is really old now. But it still applies, and is so easy to learn. (Actually i only had code and maybe 20 textfiles. The real book seems thick and maybe is much more than that, so i might confuse.)

Do you think i should not recommend it? Does it cause some kind of ‘legacy harm’ these days i miss to see?

And I want to mention “No-code” tools for development. If I remember correctly there (among many others) GDevelop and Kodu.

No Code. wouldn't that inhibit learning.

Advertisement

Tom Sloper said:

Seamus_Arian said:

Is best buy the best choice for computers or is there a superior store?

The way to figure this out is to “comparison shop.” Take the info you've been given and see what prices you can find, check some reviews, make your own decision.

Makes sense. Thanks

JoeJ said:
But if you learn C++, you learn C as well, if you want / realize or not.

Partially. C++ and C share a similar foundation, you could say that. But first of all, this is a very specific case. This cannot be said for a lot of other languages. C and C# are as different as can get.

Then, say you learn C++. Will you understand C? Mostly. But you will not be able to code in C, as it uses different paradigms. From our previous discussions, my takeaway is that your own usage of C++ is more akin to what people call “C with classes”. In that sense, yes, the languages are even more similar. But if you actually use modern C++, as it's intended, then the similarities will be very superficial. Both languages have pointers, headers, similar syntax, but that's it. C++ has templates, inheritance, exceptions, just to name a few. Modules is the c++23 build system, and that one changes even how a c++ project is setup and used compared to C, entirely.

If you do not use those features, you are effectively, as you describe it, using an extension to C. If you use all of the c++ language features, I'd argue it's much closer to a modern high-level language than it is to C. And you don't really sacrifice much. Performance is still top-notch, you can still use all the benefits of the custom memory managment, and what not. But than your actual usage of both languages is drastically different. As somewhat of an expert, I personally would never code in C. I miss like 90% of what I like about C++. I would have to write more code, more often, all the time. If I couldn't use C++, I would use C#.

JoeJ said:
And i propose to take the first steps in C because, missing those extensions, it has less complexity.

I have to argue that point often, but I won't get tired of it until everyone agrees :D The new features in C++ don't make the language more complex. Well, using all of them certainly does. But there are more than enough features that make coding easier. Surely, template-metaprogramming is a field of study in and of itself, and learning it takes time. But things like range-based for loops, unique_ptr, and so on all make the process of learning easier. It's a bit of a paradox, I admit, and/or difficult to argue with someone who has that mindset that you do. But less tools doesn't necessary mean easier to learn. Sure it will take less time to to learn all the things the language has to offer, but every problem you face will then be more complex.

I think you forget that beginners won't often struggle with learning language features, but more often how to put those things into action, in larger blocks. I remember very destinctly when there was a time where I had to google everything I wanted to code, and had to copy/paste large blocks of code, even entire systems, to get things to work. That was back in C++98, and it was not due to being overwhelmed with this or that C++-feature, but a lack of experience that wouldn't allow me to put those things together. You will of course say, “well if there is less language-features than it's easier”. I say, those features make the overall code less verbose, easier to understand, the opposite is the case.

I'd be willing to agree to disagree, but keep in mind that you specifically commented on C and C++. Which again, is a much more special case. My original advice of using a high-level language like C# is an entirely different case. Those languages are very, very different in their core to C(++). You don't have to worry about memory managment at all. You won't get crashes, but meaningfull exceptions pinpointing the source of the problem.

Learning programming is always somewhat of a challenge, initially. It was kind of funny to see all the students at my university lacking behind years of programming experience. But modern tools, modern languages make the processes easier and easier.

JoeJ Juliean you both mention OOP. What is that?

Frob Juliean and JoeJ. So C is an older language that forms the elements of more modern languages like C++. However knowledge of C can help boost performance?(The disagreement comes from which one to learn first) Is this right?

I've seen C# mentioned. As being different from C Significantly?

Thank you all I appreciate the replies.

Juliean said:
Partially. C++ and C share a similar foundation, you could say that.

No. C++ was built on top of K&R C. C is the foundation of C++. Nothing from C was removed from C++.

So there is no similar foundation for both, one was extended to become the other.

Juliean said:
But if you actually use modern C++, as it's intended

Do you mean the modern way is the intended way to use C++?
If so, that's just an opinion. But from all C++ code i see, only a very small part is actually modern. (where modern means to me: code that i can not easily read : )

If you mean just ‘good modern C++’, then this does not change that C is still part of that.

Juliean said:
C and C# are as different as can get.

I've had some confusion with both C# and Objective-C, when using those languages without actually learning about them. But i got away with it. My knowledge about C and C++ was sufficient.

I've also used php and JavaScript, without learning anything about them, and i got paid a whole year for it. (Ofc. i did learn some things along the way by catching up stuff from code and talking with webdev, but no actual effort spent on learning.)

All those languages adopt basic syntax, math and logic operations, function calls from C.

I made a game in Java for cellphones. Java is C++, but for dummies. Same thing.
But actually i had to treat Java like C to get the game below 64 kB. I could not use classes for space reasons.

That's what i mean. Ignoring poorly defined topics such as ‘paradigms’ (well, ‘poorly’ because i don't know nor care what this means):
You can code C, you can code them all.

So what language should we suggest to somebody, who does not know anything about all those languages yet, so he can't make a choice? It does not help if we say throw a dice and pick C#, Java, plus four others.

Juliean said:
Modules is the c++23 build system, and that one changes even how a c++ project is setup and used compared to C, entirely.

Yes, but irrelevant to a beginner, who ideally should not care about project management yet.
He should learn how to solve a given problem with a program.
Features such as constructors, destructors, needing to know when they are called by magic, class hierarchies, templates… simply all the extensions are not helpful for this early and primary goal. It's too much bloat and distracting.
They should be introduced only after that, with the motivation to write less for doing more.

Juliean said:
If you use all of the c++ language features, I'd argue it's much closer to a modern high-level language than it is to C.

What is easier to learn: C, or C++23?

And what is a ‘modern high-level language’ at all? This does not mean something concrete, it sounds more like a marketing promise, or a goal. Even an ideology, in your case.

That's not how you get started with programming. This becomes relevant only so much later.
But maybe it has turned out learning higher level languages first to beginners works better. I can't imagine, but idk.

Juliean said:
But than your actual usage of both languages is drastically different.

Tbh, my adoption of newer features was so slow and smoothly, maybe i just did not notice how much my coding has changed. Maybe i just simplify the experience down to ‘it's still just C, basically’, while somebody else, having the same experience, would notice a large difference.

Juliean said:
The new features in C++ don't make the language more complex.

This is a straight lie! :O

but i'll read on…

Juliean said:
But things like range-based for loops, unique_ptr, and so on all make the process of learning easier.

Nah. You should code those things out manually initially. Otherwise, it's a bit like using std::sort and then assuming you're done with learning about sorting.

But we may differ on the observed range of the learning process. I talk about the first weeks maybe. Not about becoming good or more effective, just about figuring out if you can do programming or not.

Juliean said:
You will of course say, “well if there is less language-features than it's easier”. I say, those features make the overall code less verbose, easier to understand, the opposite is the case.

No, at this point i agree with you. That's where i say ‘look out for a more powerful language, no need to keep stuck at low level, cumbersome C.’

Juliean said:
My original advice of using a high-level language like C# is an entirely different case. Those languages are very, very different in their core to C(++). You don't have to worry about memory managment at all. You won't get crashes, but meaningfull exceptions pinpointing the source of the problem.

Agreed as well. No problem if somebody starts with C#, or with the advise to do so.
However, moving from C# to C++ is probably harder than from C to C++. You don't need to unlearn anything.

Juliean said:
But modern tools, modern languages make the processes easier and easier.

The process as a whole, but not the start. I would say. But well, it's all opinions.

Juliean said:
From our previous discussions, my takeaway is that your own usage of C++ is more akin to what people call “C with classes”

I thought this might describe me, but actually idk what association really sticks at the quote.

If i read about programming paradigms, i read one and think ‘yes, that’s what i'm doing'.
Then i read the next one, and think the same. Same for the next. And the next.
But i'm surely not a Tausendsassa about paradigms.
I just don't understand what those programming nerds try to explain with their given list.
Then i become bored, come back here, preferring to argue with you about Jimmy Page vs. Tim Henson, or something like that. :D

Seamus_Arian said:
OOP. What is that?

It is on that list i have just mentioned. ; )

This topic is closed to new replies.

Advertisement