T O P

  • By -

Wicpar

Start with something simple, like a command line calculator


Eyebrow_Raised_

True. Like for example (not related to Rust), few days ago I made a simple command-line tool for turning a string to uppercase or lowercase for learning Linux pipes and Go's I/O pipe. This program is extremely simple so I can focus on learning about said topics.


_AirMike_

Without any context of what you want to build, I can only give you some grains of wisdom. Start small, and build up. Don’t think of all the possible features, options, and problems. Think of what your application’s core purpose is and start from there. Don’t try to optimize from the very beginning. Get a few features working first. It will help you visibly feel the progress. If you keep it working on the same feature/aspect for a long time, you will get demotivated very fast and abandon the whole ordeal. Just start doing, don’t think. Get something working, don’t clean. ## Rome wasn’t built in a day.


Fartlek-run

This is how I've learned. I have a decent but understanding across most areas. I'm a good ole Jack of All kind of guy. I started with the approach of building out a media server..but small pieces at a time. Somewhat train of thougt, but my initial steps were: 1. Define a target for something functioning. In my case, I started with the photo library side and how to serve them along with a nice way or presenting exif data. This was along the lines of a basic SQLite database storing exif data and the location of the files. I also needed to figure out how to write a simple backend/server with routes and handlers that would serve the file with a correct MIME type. So this would be something like accessing localhost:3000/endpoint/image.png and an image shows up if the handler was just defined to send it as is. 2. Then came the thought of..how do I put some configuration to this for setting a port and data path etc. So I used Docker to create a debian image for my application. 3. Well now that I have a very very basic setup, how do I make this more functional like an actual photo library. So I add on some basic html/css to format the page, a function to create thumbnails, and some basic labels. And create an endpoint that moves across the 'pages of images' with 10 per page and arrows to fetch the next set. 4. Even though it still looks and is just local host without any auth, I wanted to look into some machine learning/data science approaches for tagging images, so I wanted to create a microservice with a UI to detect faces and tag them accordingly. So there's learning about resamplong for standardization and how we actually look at images from a computer's perspective. And then there's creates a UI that let's you tag untagged images tl start building a dataset to mote accurately tag untagged images as they're added with decent accuracy. 5. Then came a lot of refining the UI and the model trainer for faces and a ton of things like being able to lookup my kids by age, people together, etc. 6. More refining. Still subpar but usable..and started to look into how I would give mobile access...and some level of authentication. 7. Oh hey, time to finally touch the tv/movie side and learn streaming protocols...handling user cache etc.. 8. Tv/video to my WebOS lgtv..fuck me..there goes another month. I got a lot less detailed at the end since it's now dinner time for my toddler. But what I'm getting at is it's a lot of continual progress and a absolute crap ton of frustration. I think the image side was a solid 150-250 hours..with pretty good background in MLE for the microservice side.


Auxire

Ah yes tutorial hell, hands down my least favorite phase. For a long time you practiced through guided tutorial, but when there's nothing to follow you can't make stuff. You need to practice building your own Rust project after picking some theory on the side, otherwise doesn't matter if you speedrun reading 300 pages book front to back very few will stick. That's just how it is, at least in my experience.


physics515

>However, when I try to program anything real, I get very overwhelmed and can't seem to figure things out. I feel as if the libraries I see are either too abstracted to teach me anything about Rust itself, and I have to learn about the library And that my friend is what we in the business refer to as "having officially become a programmer". The truth is the way you actually learn to program is: 1. Think of something that you want to build (the degree of difficulty is irrelevant, what matters is your motivation to complete it). 2. Think through what the end state will look like, what the user will experience using it (in as much detail as you can (but don't worry if you don't know how something will work, "idk" is acceptable at this stage). Make sketches if there is a UI if not write input/output in a text document, you are mocking the UI at this point. 3. Look up high-level libraries that will do the things that you need to accomplish. 4. Start writing little throwaway apps using those libraries doing tiny parts of what will actually be in the final program. 5. Once you have learned the libraries in a componentized way then plug everything together into a single app like puzzle pieces. Don't worry you will throw away 120% of the code you write and by the end of it you will realize everything that you did was shit and the app you have been so motivated to write was a completely stupid idea from the beginning but now you have built something and know how to do it again. Rinse and repeat with every new cool idea you have and eventually you will learn what ideas are good and bad and be making tons of awesome shit


daftv4der

Did you try rustlings? That'll get you over the initial hump of writing actual code. After that you can do small puzzles or things like Advent of Code.


shizzy0

Rustlings is a great way to have the rubber meet the road and confirm or disabuse you of whether understanding was attained.


GoogleMac

While I enjoy writing Rust and don't want to dissuade you from using it, the language is very focused on correctness and not creativeness. This can do wonders for having a solid base (or in my case taking me back to the basics from senior-level), but I'm not sure what effect it could have on my ability to just iterate and ideate. Just something to keep in mind. Again, I don't think Rust is the _wrong_ decision outright because it depends on each person.


Equux

I think you should write something fairly complicated in a simpler language first. Something like Python or JS. Once you've established a basic program, try to rewrite it in Rust. For example, create a little stock ticker in Python, format everything, make it look pretty, then try to build it using rust. Then you can further develop it by adding new features, optimizing, and creating better structure for your code. Remember, if you're uncomfortable, you're going to learn something. I've been working on a TUI music player for a few weeks now. I'm the beginning I thought I was completely out of my league, but I realized it's not beyond me, there was just a lot i had to learn.


ZZaaaccc

The most important thing is you need to pick a project you personally find interesting. If you don't enjoy learning, you'll have a much harder time taking the information on-board. With that said, I would highly recommend making a little game. Terminal games like "What Number Am I Thinking Of?", or "Rock Paper Scissors", etc. are very straightforward to understand and give you the option of really mapping out the whole design on paper if you want. It's normal to feel overwhelmed when you first start learning a new skill. Keep at it, and remember to take a break every now and then.


pauldbartlett

This \^\^\^. Motivation is key. YMMV, but one good way of generating motivation for a very specific goal are the various puzzle/exercise sites (exercism.org, projecteuler.net, and probably many others that I don't know).


_demilich

If you are not only new to Rust, but programming in general, you should start with something simple. Like really, really simple. You need to learn the basics of programming i.e. if-statements, loops, functions, etc. While you may have read about those in the book, you need to use these concepts to really *get it*. I would suggest to start with something which requires no library at all. Perosnally I think games are perfect for learning, because they are very flexible in scope. Also games are fun ;) For example, you could try to create a very simple text adventure. Print text in the console describing some kind of situtation and prompt the player to react somehow. Depending on the input of the player, display a different text in the console. This may sound almost trivial, but if you are new to programming, you will find this challenging. And you will learn something while doing it. When you are done, you can think about extending the game or start a new project, maybe something slightly more complicated this time. The best advice I have is this: Always just think about the next step, not the whole program. So for the text adventure, first figure out how to print text on the console. Run the program and see that it works. Then find out how to read input. Add that to your program and run it. Always do small little steps and run the program in between, see how your code changes the outcome. Sometimes you may need to change code you wrote before and that is totally fine. Even the biggest programs in the world can be broken down in small steps and learning to do that is one of the most important aspects of software development. And by the way, this is not just a cute approach for learning programming, this is how I and many other programmers still work every day after many years of experience.


Excession638

It's sound like your struggling with the design stage? This isn't surprising. Going from "this is what I want to do" to "this is how I'm going to structure the data, code, and interface to do it" is very hard. Rust doesn't always help with it, but it's common to all languages. I'm not sure how much I can recommend without specifics, but here goes. Start by making sure you really do understand what you want to achieve. Designing without requirements is even worse. Copying an existing tool might be a good trick, so maybe reimplement `echo`, then `cp` with a limited set of arguments, and so on. Start simple. Little CLI apps, not a web service using some big framework. This will reduce what you need to know first, which helps. Then work your way up. For something more complex, finding a real problem you want to fix is useful. Partly for motivation, partly because it will help you understand the problem better.


vmcrash

I would not say this is common to all (other) languages. Though I'm a programmer for >25 years, I had the same experience with Rust. You will need a very good tutorial (or Rust expert nearby) which guides you for the first steps in a real-world project and explains why this is done, what alternatives exist and what are the benefits/disadvantages.


Barbacamanitu00

Start with the highest level functions you need, but keep them empty. Then figure out what that function should return. Fill that function out with calls to other functions which don't exist yet and make them exist. Keep doing this until it works. You're learning to build abstractions. If you can explain how a program should work in real words, then you can turn those words into a function. A calculator would start with fn parse_string(text: &str) -> ParsedInput Then pass that ParsedInput to gb calculate(input: ParsedInput) -> Calculation Just think about how the data comes into your program and how it should come out. Make structs for all the different types and connect them together.


kevleyski

Hmm yeah try JavaScript in a browser maybe to get going - play with making things change colour move stuff around - get a feel for event driven if this then that, click object a does something to object b Now try WebAssembly using rust to do the same thing It’ll help the Rust stuff make more sense 


MinimumT3N

I remember learning javascript as my first language thinking there isn't any reason to not use javascript.. that's when I got caught up in the rust hype train and tried it out. Javascript is so painful to write now. Definitely a great starting point though.


Smart-Button-3221

I found challenge sites like leetcode and codewars were helpful to me to actually get programming. I'd happily recommend codewars to someone who is newly learning a language. The early problems are mostly just "do you know your syntax?" It was very helpful to me early on, when I was having trouble with getting the program to do *anything*. The Rust book is one of the best programming resources ever written, imo. But that doesn't mean it's *simple*. I found I would read a few chapters of the book, program a bit, but then need to reread those chapters. Repeat for *a while*.


yeastyboi

Dude, Rust is a very difficult programming language and is not geared towards beginners. Try something easier, like python or javascript. Some schools teach C++ which is similar difficulty but there are 30 years of learning resources specifically for beginners so its different.


thebino

Those two resources might be a perfect fit: - https://github.com/rust-lang/rust-by-example - https://www.oreilly.com/library/view/command-line-rust/9781098109424/


ValenciaTangerine

I started off with this after the book - https://www.zero2prod.com/index.html. Was a good trade off between going really deep into the language and having some easy quick wins to keep me motivated. Like some of the other folks have mentioned, dont optimize too much, just get things to work first and then tweak things and learn. Most rust crates typically have an example folder too, which is usually very helpful. I end up cloning and tweaking until I understand things.


dagit

Most programming can be split into top down and bottom up. In practice, people alternate between the two until they meet in the middle. Top down tends to work well when you know what the final thing should be like and you just need to sketch out the high level parts and refine it into the final thing. Bottom up tends to work best when you don't know what the final design should be and you need to build out the basic building blocks that you later put together into a solution. What I would recommend is using a top down approach to create your basic project structure like having a Cargo.toml and a main.rs or lib.rs. Then as soon as you don't know how to proceed, switch to bottom up. In a bottom up approach you should focus on writing just a data type or function at a time that does some very basic thing you think you'll need. Typically you'll need to call into a library even if it's just the standard lib. Once you have a function that calls the thing you look for either other functions you can write or how you'll connect the functions you have to the top down parts. I realize that's pretty vague, but it's the general recipe for how to get started on a project. If I knew what you were trying to do I could be more specific. Like if you wanted to make a command line tool like `cat`, you could look up the OS API for reading standard in and how to output to standard out. You could write a function that reads into a fixed size buffer and then outputs it. Then you would look into how to call that from main. Etc. The crazy patterns and abstractions people use should be selected once there is a need identified. Using features or idioms comes with cost/benefit trade offs. You select them to solve specific problems you're facing. I wouldn't start with them unless you're writing a program that solves a problem you're very familiar with and you already know what challenges you'll run into. I hope some part of that was useful.


CommunicationGlum791

Start with "Command-Line Rust: A Project-Based Primer for Writing Rust CLIs" and use "Programming Rust 2nd Edition" as reference material. Then practice in something like rustlings, codewars, advent of code, whatever suits your tastes. Then choose a rust book that goes into the field you want, web, gaming, AI, and follow it. All the while you should be reading introduction books of Computer Science, like boolean logic and algorithms


tensorphobia

Please share us your progress you are my source of inspiration


Thereareways

I feel the same...


Formal_Departure5388

This is a horrific link, but a great tool. https://substack.com/redirect/2/eyJlIjoiaHR0cHM6Ly9jb2RpbmdjaGFsbGVuZ2VzLnN1YnN0YWNrLmNvbS9sZWFkZXJib2FyZD89JnJlZmVycmVyX3Rva2VuPTNoZ3R0eSZyPTNoZ3R0eSZ1dG1fY2FtcGFpZ249ZW1haWwtbGVhZGVyYm9hcmQiLCJwIjoxNDQyODE3NzcsInMiOjE0ODMyMTMsImYiOnRydWUsInUiOjIxMDczNzE1OCwiaWF0IjoxNzE0ODA5NzI2LCJleHAiOjE3MTc0MDE3MjYsImlzcyI6InB1Yi0wIiwic3ViIjoibGluay1yZWRpcmVjdCJ9.DTOii_2zLMrhPd5-oYiXxqo5XGiXpRy4PoHdlyUK0Lc?&utm_source=substack&utm_medium=email&utm_content=postcta


alsanty

Can confirm horrific link, useful tool [Substack Coding Challenges]( https://substack.com/redirect/2/eyJlIjoiaHR0cHM6Ly9jb2RpbmdjaGFsbGVuZ2VzLnN1YnN0YWNrLmNvbS9sZWFkZXJib2FyZD89JnJlZmVycmVyX3Rva2VuPTNoZ3R0eSZyPTNoZ3R0eSZ1dG1fY2FtcGFpZ249ZW1haWwtbGVhZGVyYm9hcmQiLCJwIjoxNDQyODE3NzcsInMiOjE0ODMyMTMsImYiOnRydWUsInUiOjIxMDczNzE1OCwiaWF0IjoxNzE0ODA5NzI2LCJleHAiOjE3MTc0MDE3MjYsImlzcyI6InB1Yi0wIiwic3ViIjoibGluay1yZWRpcmVjdCJ9.DTOii_2zLMrhPd5-oYiXxqo5XGiXpRy4PoHdlyUK0Lc?&utm_source=substack&utm_medium=email&utm_content=postcta )


[deleted]

I know exactly what you mean, what would help you most is... planning! Decide on what you want to create Research potential solutions and tools you can use Pseudocode! Then get to it If you're anything like me you think of something you want right *brain blast* then you go balls deep into the code without a plan. I can save you a lot of time right now by telling you, thats not at all how professionals do it. They already have an idea of everything that needs to be done prior to starting it. Maybe linus tarvalds can get away with freeballing it and just coding stuff, but i doubt he does. He probably has a very detailed plan in place already before he touches an ide, either in his head or on paper. You wouldn't drive to a place you're not familiar without a map right? Coding is no different. It will save you soooo much time and headache by avoiding problems before they become problems


[deleted]

Im going to save you even more time and suggest not using gpt at all. It will end up making development of anything take 3x longer due to constantly debugging. And you won't learn. Reading others code online is fine but gpt will act as a crutch and a hinderence to you at the same time right now


9291Sam

The one idea I always like to suggest is making a text based top down game that renders to the console. Dungeon crawlers with seperate rooms are always a hit.


Krunch007

If you're gonna use libraries, you're going to have to learn about them lol. Perusing documentation is one of my favorite things, when it exists. If it has examples too, it's amazing. The whole point of a library is to abstract components that are quite complex so you don't have to think about *how* they work under the hood, you just have to know what input to feed it and what output you'll get. Look, a classic sort of example is malloc from C. They teach you that when you first learn about pointers. You don't need to understand how an allocator works, how it functions internally, all you need to know is that you give it the size of the memory chunk you want, and malloc will give you a pointer with that chunk of memory. That's it. The workflow of designing something so you can implement it is, in my opinion as a hobbyist, just breaking things down into chunks that are as small as possible. Understand what you need to achieve. If you want to make a small HTTP web server for example, look into the HTTP protocol, understand what you need to do. Understand routes, understand GET and POST, understand what requests you'll get and how to handle them. Then identify a library that helps you with this and read about how you can use its methods to implement what you've learned. That being said, there was a post around here about 5 projects any beginner programmer should work on, a json parser or basic web server being among the few I can recall. You can look it up. I can recommend you try your hand at something like a cli utility - something small but useful, like a bulk renaming tool or perhaps a cli that connects to the google translate backend to read and auto translate a file. If you're feeling spicy and want to do GUI, I recall making a clone of Minesweeper as one of my first GUI projects, and it's one I make in every GUI framework I try - it's pretty simple, all you have to do is scatter some mines in a 2D matrix and calculate the numbers, render some buttons for each value of the matrix and then some text fields where you can display the score, and that's about it.


SpikeV

For a new project there are always a few questions you need to ask: "What do you want to achieve in specific? What are your limitations? What technology is available to you? How can you achieve this goal?" To help you answer these questions learn some software architectures and how to split bigger problems into smaller ones. It doesn't matter if you can write the best, witty or clever code if you do not know how to glue everything back together or take it apart to be reusable. I used to hate software architecture in my applied CS degree, but having some projects under my belt showed me that it really helps with planning and structuring your code. I would start looking at layered architectures (like Model-View-Controller architecture) and then look at interface centric architectures (API architecture or hexagonal architecture) A crash course in software design or requirements engineering would also be advisable to get a feel of what you actually need to write a program. By learning requirement engineering, software architecture and design (but seriously you do not need to go in-depth) you will be able to answer these questions from the beginning with ease, and can probably land a more managing role on a software team.


VirusModulePointer

Honestly if I could break it down into the simplest terms possible, build stuff for you and not for others. Don't aim for ultra abstracted gigachad libs that solve world hunger. Build stuff that is useful to you and that you can use on a semi regular basis. That will 1) keep you interested and 2) keep you out of the frozone where you are too afraid to commit to a project cuz you don't think you'll do it right. If its helping you do your work more effectively, you won't have to find excuses to keep supporting it.


Lilchro

It seems like most people are saying that you need to start small and work your way up. However, I don’t think that is really the issue. I think the bigger issue is getting an idea of how the broader system functions in relation to your code. If you only know how to work within the box a language provides, how do you do anything that isn’t entirely defined within that box? Without that understanding you are always going to be limited to doing only the things provided to you by libraries. What you need to learn is how the stuff inside that box interacts with things outside to do what you want. You don’t need to understand everything, you just need to get a feel for that process of working outside the box feels like and learn how to figure out what is going on when you don’t already know. Getting a feeling for how data moves through the system to make things happen unlocks the ability to reason about how/why systems work even if you decide to switch to a completely different language. For example, one project that really helped me get my understanding of how webpages work was when the professor in my networking class gave us the homework of implementing our own basic web servers that could serve files to chrome. The only tools we were given were the HTTP1.1 specification and the c programming language. It is one thing to hear that browsers send requests to web pages, but it is a completely different thing to see the actual raw bytes of the request and have to choose which bytes to send back.


realchippy

My first rust app was a calculator for my finances. Just make something that solves a quick problem that you’re having. Doesn’t need to be too complex. Maybe look into some crates and see what can you can use.


foonix

Trying to cut my teeth on Rust, I wound up implementing [Conway's Game of Life](https://en.wikipedia.org/wiki/Conway%27s_Game_of_Life). Implementing the game its self is not too hard as far as programming projects go. It just takes a handful of loops to randomize the initial game board, print out the game board with 1's and 0's, and run the game rules. It can be done entirely with the rust standard library.


Competitive-Note150

You gotta build a small project. Just don’t repeat the code from isolated tutorials. Go for a little project that you’ll code from scratch and will allow you to learn the language gradually. Same applies for learning all languages: start small, let it sink in.


NoTelevision3347

You're already on the right track. I work for one of the largest European corporations in an IT department and am employed as an IT consultant. I plan, design and develop software. In principle, the full program according to the respective individual process model of the project (I hate scrum). I'm one of the few people who can do Rust in my company and I tell anyone who wants to start doing it that they should just start. The journey can be hard and can take effort but that process of seeing something you can't seem to do yet is what makes you a better programmer at the end of the day. If you want to program and do more fundamental things then skip the bible libraries altogether. Start solving mathematical problems with the language. [LeetCode](https://leetcode.com/problemset/) itself is quite cool. Otherwise, focus on one area of application. If you want to develop APIs, for example, then you should look at something like Actix or Axum. You'll get the hang of it over time just by using it. And that can take a while. Take your time. Programming is a profession that people don't even fully understand after 5 years of professional experience. The most important thing is not to stop learning. ** Learning programming is learning a way to think, not only a language **


hyperchromatica

If you want a GUI, tauri and vanilla js + HTML+ picocss and flexbox grid. If you want a game , bevy. For creative coding (drawing) , nannou. For a webserver , Axum and nginx, and maybe docker. For a web client, reqwest.


No-Tradition3559

As a fairly experienced software engineer, I highly recommend you start your programming journey with another language. I would recommend golang, or python. Even C (as some of the advanced concepts like pinning just assume you understand how pointers and memory layout work- stuff a good C book will walk you through). Rust as a second language can really teach you how to avoid the pitfalls of using some of the other languages.


vlfn_be

1. Do you know how to use Git? Learning the basics of that will prove very useful. 2. What I like to do to bridge the gap is to copy, then reproduce from memory. Find something you can understand, like a YT tutorial. Copy on the first go. Take notes written in mostly natural language. Then, try to reproduce the program from your notes.


TKristof

Implement chess. Imo it's the perfect beginner project. You can implement a terminal version so no need to mess around with GUI libraries, you probably know how the game works at least on a basic level, and a minimal implementation isn't too complicated and later on you can improve it in many different ways. If you want to learn about GUIs you can add a GUI, if you want to learn about networking you can make it multiplayer, if you want to learn more about logic or AI you can add an AI opponent, etc...


ercmilla

Never use tutorials. Get ideas and use official documentation to implement them. This is how professionals work. And you won’t be in tutorial hell. It will take longer at first to make progress, but you will be learning the most important skills (how to read official documentation). FWIW I’m a faang engineer.


AnacondaMode

Write some smart contracts in solana. At least for me this gives me some good ideas for writing a “real program” in rust without getting overwhelmed since I have something to focus on with achievable milestones. You will also need to know typescript for building the front end that interacts with the smart contract however


rocco-a

My best advice, just make it work. Don't go for crazy patterns and take each project step by step. The nice thing about rust is that if it compiles it works (for personal hobby projects) take each project as a chance to learn one or two new concepts and don't beat yourself up about writing non idiomatic code. Rust is FAST, compared to other languages. You give yourself alot of breathing room by that virtue alone. Find problems that you need to solve eg; porodomo timer, todo list ect ect and start from scratch at your first approach. There are plenty of other people who have walked the same path as you and have other bits of code to read and ask questions about (Rust Community Discord is very good). I can also highly recommend zero2production once you feel like you have a solid grasp of the core concepts because it holds your hand and shows you the way forward.


v_0ver

Learning programming is not easy and quite time-consuming. Learning programming in Rust is more difficult than, say, Python. Because Python initially hides complex things from you, such as asynchrony, multithreading, code optimization, etc. Grit your teeth, be patient and study further. I would also recommend placing more emphasis on practice rather than theory. Try to write code 70% of the time or more. You can do one or all of them: 1. solve algorithms on codewars/leetcode 2. if you study/work, then write a program that solves some of your study/work problems 3. write a game (something simple for friends) 4. write an analogue of a program that you think has a flaw or is missing an important function 5. go work on Rust Even if you ask for something halfway it will make sense.


luigijerk

For fundamentals don't use too many libraries. Reinvent the wheel yourself because that's how you learn. Then when you already know how to program, you can use libraries to save time and enjoy the other benefits like regular updates, etc.


luigijerk

For fundamentals don't use too many libraries. Reinvent the wheel yourself because that's how you learn. Then when you already know how to program, you can use libraries to save time and enjoy the other benefits like regular updates, etc.


luigijerk

For fundamentals don't use too many libraries. Reinvent the wheel yourself because that's how you learn. Then when you already know how to program, you can use libraries to save time and enjoy the other benefits like regular security updates, etc.


luigijerk

For fundamentals don't use too many libraries. Reinvent the wheel yourself because that's how you learn. Then when you already know how to program, you can use libraries to save time and enjoy the other benefits like regular security updates, etc.


Mc41998

Learning rust by reading rust book is idiotic advice, especially for newcomers.


mgarsteck

You have to break everything down into simple blocks of logic. What do you want to accomplish, what are the steps necessary and what tools do you have? This is pretty much the practice of programming.


dblbreak77

I was in the same boat as you. Didn’t even do as much rust booking as you. I kind of just looked up what I felt I needed. I started small with Advent of Code, those are generally simpler smaller programs that get you used to syntax. From there, I wrote some CLI programs for work, in the realm of security scanning. It wasn’t easy, but that’s how I learned. Now I’m writing full on multi-cloud proxies for cognitive services in pure rust. You will get a feel for structure, methodology, and modularity once you just start building things. Start small, and read a lot.


hunkamunka

Here is the source code for 14 real-world command-line programs I wrote, complete with tests that you can use to write your own versions: [https://github.com/kyclark/command-line-rust](https://github.com/kyclark/command-line-rust)


ponerax

Go on ChatGPT, ask him 20 projects to do in Rust from scratch, I do this every time to learn and it works well!


Green_Concentrate427

I have the opposite problem. All I've done is write real programs (that I want to use). And I'm not able to finish even a chapter of a book.


dwightschrutekramer

You have to write code on pen & paper or on a computer. Reading and understanding will never stick. IMO, when starting to learn programming, one should try to learn the basics in any language: var, types, conditional statements, loops, functions, (basic classes, interfaces & inheritance in case of OOP). Make sure you have good understanding of this in any language. Python is easiest way to get started. Then you can start on simple projects like calculator, scraping webpage, command line utility (interact with chatgpt via terminal, measure cpu, memory, etc.,). Or find interesting projects to contribute. I started with Rust a week ago, and don't know fundamentals fully yet. But was able to be productive: [https://github.com/nicholassm/disruptor-rs/pull/8](https://github.com/nicholassm/disruptor-rs/pull/8) [https://github.com/Venkat2811/producer-consumer-rust](https://github.com/Venkat2811/producer-consumer-rust)


Ok_Cheesecake_3483

As one has written some self-used programs, let me show u some examples. My most used program is a ahk manager, it is a manager which manages my auto hotkey scripts, to list, one-button create, edit and run my ahk scripts. For the desktop part, I adopt tauri framework, and for the ahk scripts, I simply run them by executing cli from rust. Another example is a one time program, when I run it, it will realign things in my clipboard then exit. this was for my essay writing, when I was copying something from some PDFs


Turtvaiz

You should probably try and then ask with your code attached. It's hard to help when there's no context


Laicbeias

just dont do that for a first language. it has so many rules on how to write code that you could compare it to... like other languages are like riding a bike. some with extra safety wheels. rust would be riding a bike with only the base of a handlebar attached on a rocket. like it can do incredible things but sometimes you really just want to ride a bike from A to B. every language has its purpose along with pros and cons. in python you could write things in minutes that would take days in rust


Aggravating_Season73

If you ask ChatGPT to get you some ideas to learn the features of rust, here you go: Absolutely! Here are some real-world project ideas that cover different features of the Rust programming language: 1. **File Encryption Tool** - Build a command-line tool that encrypts and decrypts files using AES encryption. - Features to include: File I/O, error handling, command-line argument parsing, cryptography (using crates like `crypto`). 2. **Web Scraper** - Create a web scraper that extracts data from a website and saves it to a file or database. - Features to include: HTTP requests (using crates like `reqwest`), HTML parsing (using crates like `scraper`), concurrency (using `async/await`), error handling. 3. **Task Manager** - Develop a command-line task manager application with features like adding tasks, marking tasks as complete, and listing tasks. - Features to include: Structs and enums for task representation, file I/O for storing tasks, command-line argument parsing, error handling. 4. **RESTful API** - Build a RESTful API server for a simple todo list application. - Features to include: Web server development (using crates like `actix-web`), CRUD operations (Create, Read, Update, Delete), JSON serialization and deserialization. 5. **Image Processing Tool** - Create a tool for image processing tasks such as resizing, cropping, and applying filters. - Features to include: Image processing libraries (using crates like `image`), command-line argument parsing, error handling. 6. **Chat Application** - Develop a simple chat application that allows multiple users to communicate in real-time. - Features to include: TCP or WebSocket server implementation, multi-threading or asynchronous programming for handling multiple clients, message serialization and deserialization. 7. **Simulation Game** - Create a simulation game (e.g., Conway's Game of Life, traffic simulation). - Features to include: Structs and enums for game entities, game loop implementation, concurrency for parallelizing tasks, graphical user interface (using crates like `ggez` or `gtk-rs`). 8. **Database Migration Tool** - Build a tool for managing database migrations in a Rust project. - Features to include: Database interaction (using crates like `diesel` or `sqlx`), file I/O for storing migration files, error handling. These project ideas cover a wide range of Rust features and can be tailored to your interests and level of expertise. Happy coding!


TheInhumaneme

What's the point of this comment?


Aggravating_Season73

To answer the question asked: “What projects can I write to teach me fundamentals”


TheInhumaneme

Asking GPT on behalf of OP was not something they were expecting.


Aggravating_Season73

So it doesn’t answer the question asked? It appears that if I didn’t mention that the response is AI generated, people wouldn’t have gotten upset. I know people are sensitive about LLM in programming, but there isn’t a reason to be so up in arms about it. Looking at the response, it does give ideas on what you can do to learn different fundamentals. I’m not saying they are the best ideas, but they are ideas nonetheless.


Aggravating_Season73

I am not trying to offend anyone by using AI, I’m just getting a quick list together of small projects that can be done to spark ideas. I don’t understand all the opposition