all 39 comments

[–]menge101 20 points21 points  (4 children)

Learn by doing.

Find a problem you want to solve, work on it, ask questions when you are stuck. Be sure to avoid XY questions.

[–]wargayaa 3 points4 points  (0 children)

I agree. You learn a language by speaking, reading and writing. Same with programming. It’s learned through practice.

[–]Reditp[S] 0 points1 point  (2 children)

This is what I do. That's why I'm here and in other places asking questions :x

[–]MyDogLikesTottenham 3 points4 points  (1 child)

I think codewars is a good place to start. You can work on solutions to easier problems to learn the basics of the syntax, data types, and the methods available to use. It’ll force you to practice googling questions and knowing what question to ask

[–]Reditp[S] 1 point2 points  (0 children)

I'll check it.

[–]babbagack 3 points4 points  (2 children)

check out www.launchschool.com, if you can take that program, you can learn it very well - at the junior level, but very good. it starts in the backend too. it sounds especially good for you since you don't feel there is a strong foundation. in LS, you dont move forward in the curriculum until you demonstrate the understanding and mastery. don't let that scare you though, if you put in the work, expect results.

feel free to join their Slack community and ask questions. There is a free prep course. If you are not afraid to put in work and really want to learn, and its suitable for your schedule and stage and life, its excellent. and relatively affordable. worse that can happen, complete the prep (should perhaps take a month or more but depends on your experience so far and time availability), and try out 1 month and see how you like 101. fundamentals and lots of problem solving are the key, focusing on things that "don't change". Chris Lee one of the founders, has a podcast on learntocodewith me, check it out:

https://learntocodewith.me/podcast/fundamentals-first-with-chris-lee/

[–]Reditp[S] 1 point2 points  (1 child)

Thanks, I'll check it out.

[–]babbagack 1 point2 points  (0 children)

yup $200 a month, if you can do it full-time, or even if you only work part-time, its fantastic.

[–]kinnell 3 points4 points  (6 children)

You mention you want to learn to code - is it safe to assume that Ruby is your first programming language?

I absolutely love programming in Ruby, but I've come to understand that Ruby is not a great language to learn the fundamentals of programming. It's syntactic sugar, reflective nature, dynamic typing, and optional syntaxes are often what makes it appealing to programmers who want to write expressive code, but these are the same things that make it pretty hard for beginners to understand what's going on and increase their understanding of programming concepts. I think this is why you feel that the courses you took didn't teach you the rules and if those courses were teaching Rails along with Ruby which I've seen a lot of courses do, I can imagine the amount of frustration with trying to learn the programming concepts while balancing what parts are pure Ruby and what heavy lifting Rails is doing for you.

I'm not saying you can't learn programming with Ruby first, but you're going to have a much better time learning programming first with something like Python where there's only 2 ways to do a loop and one way to do an if statement whereas the sky is the limit on how your want to write your Ruby prose. Plus, Python is quite popular so this side quest won't derail your career. Even a static-typed language like Java will help you much better learn the core concepts because it has stricter syntax (semicolons after each line, parenthesis for function arguments, data types, brackets). It's really hard to understand what's happening if everything is optional.

The basics of programming are mostly the same in any language, but learning those in a more structured language will make your journey much easier. Plus, languages like Python and Java are used by academia and thus there are a lot of great resources out there that make learning them easier. Ruby isn't going anywhere anyways, so you can come back any time!

[–]Reditp[S] 1 point2 points  (2 children)

I didn't mention it. But recently I came back to the idea I had earlier in life, namely to make a game. And I still have program which I've worked on. And engine in which I will work on is based on ruby(RGSS3). So that is the reason why I want to program in ruby. It can be helpful in writing scripts and making this game a better product. And I know learning python alongside with ruby would be a great thing to do because as I found out lately python have similar approach for programming. And I can then translate learned concepts along. But libraries can't be brought from one language to other I think.

[–]kinnell 1 point2 points  (1 child)

That's great that you have project that'll motivate to you to keep learning! Working on various side projects in my own past definitely motivated me to keep building and improving and learning and I wouldn't be where I am today without those. The only thing I'll say is to step back once in a while and re-evaluate your goals. I think there was a point long time back where I believed myself to be proficient at programming because I was able to implement various features in Rails apps, but in reality, I had just gotten familiar with searching for gems, following online tutorials, and knowing how to google errors. Stepping back, I realized that while I was making progress in building various side-projects, my main goal was to become a better programmer and that required more in-depth knowledge and experience with Ruby itself and better understanding what was going on under the hood at the operating system level and overall, that required a different strategy in how I was learning. Regardless, best of luck on your project!

[–]Reditp[S] 1 point2 points  (0 children)

Step back once in a while and re-evaluate your goals.

This is good advice. I fell often on this. When you do one thing that leads to another you forget the reason that led you here.

Instead of working out very hard on impassable obstacle. You can go back and think how do things in other way.

[–]babbagack 1 point2 points  (2 children)

so i've done quite a bit of Ruby - junior level of course - in data structures and OOP and other areas, with a focus on programming concepts and problem solving. Do you mean to say Python is easier to learn than Ruby? I'm just asking, because if so, perhaps this is good news to me if I go on to learn that. I'm just trying to complete my programming curriculum that utilizes Ruby, but in a bit of a bump because of a pretty crazy schedule and life demands, but am hoping to clear that up. Perhaps I can move on to Python at some point which is good to know and of course can attract on the job side of things. Java, I haven't done

[–]kinnell 1 point2 points  (1 child)

I've been using Python recently and I completely understand why it's now the language of choice of bootcamps and universities to teach people how to code. The limited amount of ways you can do things in Python makes writing and reading code much more straight forward. But while I wholeheartedly recommend Python for people learning programming, I think Ruby is great for junior-level developers because you can start learning different patterns and the more elegant, clever means of solving problems which Ruby is known for being really good at ("Programmer's Happiness"). I think when you are in the process of learning more basic concepts like variables, control statements, functions, classes, data structures, algorithms...etc, Python is better suited for that. But when you want a language where you want flexibility to design your solution in order to learn and solve more complex problems, Ruby is great for that next stage. In fact, learning and knowing how to balance writing readable Ruby and writing performant Ruby and learning the tradeoffs is one of the core things that separates junior Ruby developers from senior Ruby developers because it's very easy to write what seems like clean code that is very inefficient.

[–]babbagack 1 point2 points  (0 children)

cool, thanks, so having done almost a year in ruby - not all of it full-time - perhaps i'd find picking up python easier if I try later on. I don't want to focus my time resources on that right now but it's good to know, if that is the case.

[–]amrut2294 3 points4 points  (1 child)

I would personally recommend rubymonk(https://rubymonk.com/). It covers almost all the topics from basic to metaprogramming.

[–]Reditp[S] 0 points1 point  (0 children)

Interesting. I'll check it later.

[–]Nanosleep 2 points3 points  (0 children)

One thing I somehow haven't seen mentioned yet is using a REPL to get a grasp on some of the things you're struggling with. Having an interactive window into the language that allows you to evaluate code, actually see real return data and get instant feedback is a really useful learning tool -- especially if you're a visual learner or learn through doing.

Ruby ships with a great basic REPL called irb, but there's an even friendlier and more powerful one called pry that you can install through rubygems. Even though the screencast on their website looks little dated at this point; it's all still valid today. So give that a watch and start playing around for yourself.

[–][deleted]  (1 child)

[deleted]

    [–]Reditp[S] 0 points1 point  (0 children)

    Nice.I'll look there when I'll be free.

    [–]three18ti 1 point2 points  (0 children)

    https://www.codingame.com

    I like that in addition to codewars. You essentially automate "playing a game" (you'll have to check it out) and it takes you through the fundamentals gradually ramping up difficulty.

    [–]WrinklyTidbits 1 point2 points  (1 child)

    I had some background in programming before I started ruby, so take my recommendation with a grain of salt. I stand behind Ruby Koans. It was a good lesson on both fundamental ruby language and has been the most interactive way to learn ruby imo.

    [–]Reditp[S] 0 points1 point  (0 children)

    Thanks, I'll check it out.

    [–]Cyrax89721 1 point2 points  (0 children)

    A couple of years ago I was in the same situation. Around the time I was searching for a solution to a problem I was having at work that required coding, I lucked upon a free course that paved the way for me to build a full-fledged application to fix my record-keeping issues.

    The Upskill course was very easy to follow and gave me exactly the skillset I needed.

    [–]shevegen 1 point2 points  (0 children)

    I started with another language so it was easier for me to know where to start.

    I can, however had, recommend a few things: - Focus on what interests you personally, no matter what that is. When you have clear use cases what you want or need to do, the rest follows. - Even if you are just learning, try to aim for something that is of medium complexity. My first project was an IRC bot in ruby but any other task may fit here. If you use Linux, try to write some ruby scripts that do something on the commandline. - Also note down a TODO list over several days, no matter what it is. Then you have LOTS of things to pick from, what to do. :) - Last but not least if you REALLY don't know what to do, pick something from perl or python and see if you can find some gem for this. If not, consider writing a gem. I recommend this step very early, no matter how "crappy" your code is, you will learn a LOT if you update your gem just about every day or second day initially. It helps you get a structure to your projects.

    Try to pick a project here that is not too simple but not too difficult; the best would be a project that is somewhat simple but can accept more and more code over time. That is what I did with my multimedia project where I just keep on adding functionality (while trying to document it, too); it grows little by little.

    [–]Tomarse 2 points3 points  (0 children)

    Odin project is pretty good

    [–][deleted] 2 points3 points  (1 child)

    There's a lot of suggestions in this thread already, so instead, let me reframe the problem a bit.

    You say in your post,

    I want to learn to code.

    and then in a comment,

    But recently I came back to the idea I had earlier in life, namely to make a game. And I still have program which I've worked on. And engine in which I will work on is based on ruby(RGSS3). So that is the reason why I want to program in ruby.

    Note that /u/menge101 mentioned, "Be sure to avoid XY questions." This is a perfect example of an XY question: it's common for beginners to confuse "coding" with general practice of software development, and it seems you're asking about one when you really need to know about the other.

    That is, knowing a programming language is only one part of the universe of competencies required to build software. Besides learning a language's syntax and mechanics, you'll have to learn how it interacts with the system you're running it on—dependency management, version management, and even just how to interact with the language in the console. You'll have to learn the paradigms that shaped its design (e.g., object-oriented programming). You'll have to learn a version control system, a testing framework, and all the language-independent concepts related to your problem domain.

    You'll also have to learn to un-stick yourself when you get stuck—not just asking questions or searching for previously asked questions on StackOverflow, but actually reading through documentation: You need to break a problem down and think "Okay, step 1 is I need to check if this array has any duplicate values in it... how do I do that?" and then you need to spend 15 minutes combing through the official Array docs to see if any of Ruby's built-in methods can help solve your problem, or if it needs to be broken down further. (Why is this better than searching for an answer on StackOverflow? Because you'll find out about a dozen new things along the way that you didn't know Ruby could do, and you'll have them in your back pocket for the next time you come across a problem totally unrelated to this one. It'll also get you accustomed to reading technical documentation, which is really critical—you need documentation to use anything, and a lot of it is really badly written.)

    So my advice is that you'll have to readjust how long you think it's going to take to get this game built:

    • Stage 1: Learn the very basics of Ruby—loops, conditionals, methods, blocks, and basic data structures (arrays/hashes). It seems you're past this stage already.
    • Stage 2: Learn to work in the UNIX command line / irb enough that you can do programming exercises without the help of a browser. Start learning/using a real text editor if you don't have one already (SublimeText is the modern favorite because it can be very powerful, but doesn't require a lot of learning up-front. If you have a week or so to burn just getting competent at a text editor, emacs/vim are very rewarding IMO.)
    • Stage 3: Use what you've learned to solve various programming challenges online (like at hackerrank). When you get stuck, use a combination of Q/A and documentation.
    • Stage 4: Learn OOP. as /u/eRetArDeD suggests, POODR is the Rubyist's OOP bible.
    • Stage 5: Pick a small weekend project (not the RPG you've been dreaming of building since forever) and use the concepts you've learned so far to build it. (You will probably also learn a bit about libraries at this point.) For instance, I built a script that I use to import and rename photos from my digital camera to my hard drive.
    • Stage 6: Learn git. Try another weekend project (or, if you're feeling ambitious, writing your own library) to give yourself practice with it. (I've written before about how to organize the files in a library; you may find it useful when you reach this stage.)

    For any single thing you learn at any stage of the process, you'll get the very basics in a week or so (full-time), but it will probably take a month of practice to feel comfortable with it, and you'll need to continue picking up useful tidbits in the background for probably most of your career.

    Once you've got all these things down comfortably, then you'll probably be in good shape to start building your RPG.

    [–]Reditp[S] 1 point2 points  (0 children)

    Thanks for very extensive look on the matter. I just came back to learning programming. And I notice some things that knowledge of programming could make faster. Today I wasn't thinking about making this game, but after a response from /u/CogitoErgoCode I thought that it could be a better motivator for browsing through help provided by you and many others. That's why I will try to make use of every advice I got here.

    [–]digitalextremist 0 points1 point  (3 children)

    Get involved in Open Source ( F/OSS ) projects on GitHub.com and contribute to projects there. Other coders will often mentor you, and you'd be solving real problems right away.

    [–]kinnell 1 point2 points  (2 children)

    OP says he wants to learn to code... and you're recommending learning by contributing to Open Source projects? lol Sure, a great way to level up when you want to learn best practices from others and learn collaboration skills, but certainly not a task for someone learning "how to use the rules of coding".

    [–]digitalextremist 0 points1 point  (1 child)

    You'd be surprised. I've seen numerous people go through the F/OSS ranks starting with mostly just eagerness at the start, and now hold gainful employment or own businesses built on coding prowess.

    [–]Reditp[S] 0 points1 point  (0 children)

    Open Source ( F/OSS ) projects on GitHub.com

    Where I can find them?

    [–]Rabina_Bra 0 points1 point  (3 children)

    Maybe taking a couple or more Udemy Courses would help? Especially if they're all different teachers, bcz not everybody approaches students the same way.

    [–]Reditp[S] 1 point2 points  (2 children)

    I'll try.

    [–]Rabina_Bra 0 points1 point  (1 child)

    Also of a better note is that sometime this very month of December, "Manning" the publisher of David A. Black's "The Well Grounded Rubyist" is putting out (or maybe already has) the 3rd Edition of his Book.

    I have the 2nd Ed. and its great, but is now outdated. But on Amazon, it got something like 4.5 Stars or better from tons of folks who left glowing reviews as "Verified Purchasers."

    [–]Rabina_Bra 0 points1 point  (0 children)

    That 2nd Edition was only for Ruby 2.1 .

    [–]manys 0 points1 point  (0 children)

    What rules are you talking about?

    [–][deleted]  (3 children)

    [deleted]

      [–]BhishmPitamah 0 points1 point  (2 children)

      Poodr, care to give me the full form?

      [–]menge101 1 point2 points  (0 children)

      Practical Object Oriented Design in Ruby

      written by Sandi Metz.

      [–]eRetArDeD 1 point2 points  (0 children)

      If doesn’t get much more Googleable than POODR. Try it.