Complete Noob to coding Question

So I work in IT but have no real experience with coding and would like to get into at least the basics and begin learning how.

Would Rust be a good language to learn on? Are there any good free or low cost resources to use to learn how to code in general or learn some of the basic language and terms used in coding?

Welcome to the forum!

The best learning resource to start from scratch is the The Rust Programming Language - The Rust Programming Language.

Camus once observed that during WWII, young men wondering whether to enlist would ask their professors for advice if they secretly wanted to go, and their priest if they really wanted to stay. What made you decide to ask about Rust?

1 Like

From what I am seeing it is a newer language that appears to becoming popular and I would like to get in on learning the language earlier on than say C++ or other older languages. Not saying I won't look into the older languages as it is likely, at least I'm assuming, the newer languages get their roots from older languages and understanding the old can help in learning new languages as well. But I would like to learn a new language that could maybe give me a foot up in future job prospects or potentially allow me to expand my career options.

Learning a new, up-and-coming language has appeal for me, too. I settled on Rust after I became enamored with the memory management model, an innovate approach to providing memory safety. I also like the way the compiler enables me to write coherent code with helpful errors and lints. If C++ is bowling, then Rust is bowling with the bumpers inflated in the gutters. When dropping the pins is getting my program to work, Rust lets me feel like a professor bowler while possessing a fraction of the skill.

1 Like

Some may say that it is too early for Rust to say, whether it is a good choice for a job perspective. Companies have lots of code to maintain in "old" languages. While there are many good reasons to learn Rust, for getting a job it is probably not the most obvious choice right now. Classics like JavaScript, Java, C++ and Python cross my mind, Kotlin seems to be a good choice if you want to get into Android App development with a reasonably young language.

Those language will also provide more free information online. That is not to say that you should not start learning Rust if you feel like it. You do not have to marry it -- start with free material and if you happen to not like it, try something else. The important step is to try something.

In reading the Introductory pages of the Rust book you linked it recommends that I should look into an introduction to programming path first as the book assumes I have some form of programming experience. Would Code Academy be a good place to start or is that more of a gimmicky path to learning code? If not there what would be a good free resource or maybe a cheaper option. I feel I may start in Java or C++ to get my feet wet and try to convert what I know to learning Rust.

I really appreciate the responses guys.

I think that if you are really new to programming, as in hardly having an idea what a program or algorithm is, then C++ is a really bad language to start with. C++ is massively complicated and there are thousands of details one has to take care of to get anything working reliably that are little to do with the task at hand, which is getting a feel for programming.

I also think that Rust would be quite suitable for use as an introduction to programming language. It allows one to do simple things simply.

However, as far as I can tell there are no introductory materials on programming that use Rust and there is no introductory materials to Rust that don't assume some prior programming experience. I'm sure such could be created, it's just that nobody has done it yet.

I conclude then, that getting ones initial experience of programming is better done with something like Python or Javascript.

That's OK. With experience of those, when you feel the need for speed or start to realise the problems with such languages Rust will still be here.

1 Like

Awesome. Thank you. I was starting to look into Java but was wondering about Python and how JavaScript differed from Java. I will look into the 2 you suggested.

Java and JavaScript are completely different languages. JavaScript was originally named LiveScript. It was only after Java became popular that the name was changed to join the hype wagon.

1 Like

Indeed Java and Javascript are totally different languages.

I think Javascript is an excellent beginners language. It has a very easy "on ramp" as it were. While bing a much more sophisticated language than it's detractors often realise. There are masses of tutorials, examples, and so on all over the net for it. Given its ubiquity in web development, it's built into every browser, it is massively useful.

Python is not my cup of tea but it is everywhere and again has an easy start with lots of learning materials available. Also massively useful.

Java... I never understood why it was created. Too complex for beginners, might as well tackle Rust straight off the bat.

I stumbled on this recently, which might be interesting:

I hope it's ok to provide a response. I'm fairly new to Rust as well. For me I think the Rust programming language book is a nice start. I also find Rust by example: Introduction - Rust By Example to be good to look at next. There is also The Rust cookbook Table of Contents - Rust Cookbook which is quite useful for looking for how to do things. I think you may also pretty quickly need a way to find the 'right' crates to use. There is this curated list of crates (rust-unofficial · GitHub).

I'm not sure how you learn, but for me I need to apply it to some problem that I have and need to solve. Then I break my problem down into a number of steps. Each step is something line 'how do I xxx'. For example if I want to write a program to read from a JSON file and I want to supply the file to the command. My steps would be:

How do I pass an argument and option to a Rust application?
How do extract those options and arguments in my Rust application?
How do I open a file in Rust?
How do I parse each line as JSON in Rust?
How do I print out the output in Rust?

Maybe you have a very simple problem to work on. Or, you could try one/some of the rust by example and see if you can get a program to work and then see if you make some changes to it.

It may be a bit frustrating at times, but if you pick a small task/project you will succeed (if I can do it, anyone can).

I think your advice is sound for learning Rust. But it assumes one has some idea of what a program and programming is in the first place. For examples you use words like "pass", "argument", "option", "open", "parse" etc. For sure I would not have know what those words meant in the computing/programming sense prior to having been introduced to programming in BASIC as a teenager.

ah! I see your point. Well, I hope that jmacdonald123 will have a stab at it. I think that it's a very good language. I think that from a programming point of view my opinion (and it is just mine) is to try python over javascript. For me the problem with javascript is you need to run it in the browser (yes there is the command line, but that gets a bit more complicated - at least for me) and javascript is more forgiving of errors (eg the missing semi-colon which can confuse people). I think python is a little bit more structured. It allows you to not worry about a lot of things which perhaps is ok in the beginning. There are quite a few resources for learning python.

But, that's my own opinion. I hope that jmacdonald123 will persevere. It can be frustrating, and if you're like me you will make a lot of mistakes, but that's the way I learn.

I think the "easiest" book and language to learn is 'C' with the K&R book. I think it is written in plain enough prose that a teenager can understand and follow along. Math is not too hard, for example.
Play around a bit, don't worry about the details. Don't worry about buffer overflows and security. Just read and program the examples and try to do the questions. At least try to do the first 4 chapters. When you get to chapter 5, pay attention, but as I said before, don't worry about the buffer overflows and will be learning other languages later, but C is what is all pretty much based on, so learn it. Chapter 6 structures and 7 input / output, read and study but not too much time. you don't want to learn all those printf headaches anyway.
After you get an idea of what the control flow and variables and data structures mean, read The Rust Book and it will make more sense.

Running Javascript from the command line is drop dead easy with node.js. At least as easy as running a Python script. Not only that, when your programming grows to the point that you want to make use of external modules/libraries the package manager tool of node.js (nvm) is much easier to use.

Having been participating in the Raspberry Pi forums for many years, where many youngsters are encouraged to program in Python, my observation is that there is masses of confusion in their minds concerning the white space block delimiting of Python. And then the entire chaos of Python 2 vs Python 3.

Also, people trying to use Python on the Raspberry Pi often want to do many tasks at the same time. For example responding to GPIO inputs, serial ports, network requests etc at the time. Which is natural given the nature of the Raspberry Pi. That leads them to the complexity of threads. It is much easier to juggle such tasks using the event driven, asynchronous nature of Javascript.

That runs counter to my observations of kids trying to get into programming. They soon get confounded by the inevitable unfathomable crashes that have no useful error messages. If they manage to get to building a larger program they have to struggle with header files, include and library paths, complex compiler invocations. Then there is the nightmare of actuating building a program with make or CMake or whatever.

I would suggest that if one wants to dive straight into programming using a compiled language then Rust would be a smoother, less frustrating experience.

With the bonus that when they do get stuck it's so easy to ask about it here and get help :slight_smile:

1 Like

For a first language I suggest JavaScript or Python. These will teach you about basics like loops, variables, and objects without burdening you with details of memory management.

Rust may be OK if you're interested in more low-level programming, e.g. embedded hardware that's too small to run JS or Python well.

1 Like

I’ve been coding from scratch since January. I’ve learned languages (like Russian, not C) all my life and at a juncture in my career I decided to kind of shadow a friend who works in bioinformatics. His advice has been great: take a few months to just learn Python. It’s designed for teaching computer programming and math. It’s a slog at first but stick with whatever book or course you choose until something clicks. Then once you are able to envision projects/uses for all this, I would start learning Rust, as to grasp how the language works forces you to relearn and thus gain a deeper understanding of lots of the concepts and objects that Python will introduce. My first project in Python was a naive sequence parser for finding isomorphy across sequences of RNA. Now I’m realizing what it would mean to implement the same program in Rust as I work through the Book.

1 Like

I've been trying to get my 9 year old daughter into programming. She's played Roblox quite a bit and the idea of being able to build her own games is appealing.

The language, Lua, is simple but powerful. We're still in very early days, just had like 2 sessions, but so far so good!

Imho one of the main keys to learning how to code is to stay excited enough to get past the tough parts. That excitement is going to be very different for everybody.

For example, there are people who get really turned on by being able to go low-level / super fast / know what's happening in memory. C/ASM might be the most exciting language for those folks.

Others might love the idea of being able to share what they made with others, i.e. via a website. html/css/js might be a great starter for them

Still others might love the mathematical elegance of type systems and category theory. Haskell would keep them going.

For making something that has cool visual results right away, game engines like Unity (C#), Unreal (Blueprints/C++) could be great. Flash/Actionscript is still a viable route here but not a great investment.

Servers and networking stuff - I suppose python, node, or erlang? If it's specifically web servers, I guess PHP is a good choice too.

The list really can go on and on though... there's niche areas where TCL is probably the most exciting language to build the thing! (actually, when I was a teenager that was the case, I was into writing IRC bots/servers and TCL was great for that)

Where does Rust fit in all this? It has some overlap with all the above (some more than others), it's kindof a bridge of worlds.

I don't think you can really go wrong choosing Rust as a first-language, but it's a toughie. I think if my daughter gets into Lua far enough that she's like really building stuff on her own, I might think of Rust as her second language instead of say C#, Python or JS... but she'd have to have a lot more experience and motivation under her belt before I'd feel like talking to her about Traits and stuff! We're at the level of understanding variables and if/then :slight_smile:

1 Like

Yes. Seems to me that a language for raw beginners, especially young ones, needs to have the minimal amount of friction in getting to some core concepts: variables, expressions, sequence of expressions, conditionally executed expressions and iteration of expressions.

Which was the premise of BASIC when it was invented, with it's LET, IF, FOR etc.

If that can be combined with a simple way to produce something graphical or audible or even robotic now a days, rather than just PRINTing numbers that can be an incentive to continue.

BASIC on early 8 bit computers did all that. Hence it bootstrapped a whole generation of programmers who started at a very young age. When they inevitably felt the need for speed they started getting into assembler and all kind of tricks.

As far as I can tell nothing today provides a similar experience for the raw beginner. Simple to the point of, turn the machine on, start typing lines of code, run them.

1 Like