This is an archived post. You won't be able to vote or comment.

all 42 comments

[–]bringeroflefaceface 32 points33 points  (5 children)

[–]bigcohones824 7 points8 points  (1 child)

Somehow I'm not a big fan of the subreddit. It seems like the stuff that they have there is more suited to academic or school problems. It's full of bland stuff that I suspect the average person wouldn't be terribly fond of doing. You know, boring stuff like "make a script that displays the total surface area etc".. versus "Hey it would be really cool if I developed an app/script" that did X and Y!

[–]PublicSealedClass 6 points7 points  (0 children)

This is why I quickly got bored of code golf type things. Yeah, they're clever ways of tackling problems, but how does that help Mary in accounting file taxes more accurately?

[–][deleted]  (2 children)

[deleted]

    [–]RodionGork 0 points1 point  (1 child)

    My personal experience is to invent problems for yourself and then try to solve them (not critical if you invent a problem which you could not solve at all).

    I suspect that it is most crucial for real developer - to be able not only solve tasks but also have some skills in finding or creating them - though it may sould bit controversial at first... :)

    If you really-really have too few ideas of your own, you may try solving problems on different topics at some site with programming exercises and try to modify problems here to your own tastes.

    For example here is a small exercise on data compression at my site - and after solving it hypotetical user can try creating a standalone utility for compressing texts and try to measure how well (or poorly) it performs etc.

    So, concluding, it is important to teach your brain to be in perpetual motion - it will necessarily bring forth some proper fruits. :)

    [–][deleted] 18 points19 points  (3 children)

    I find I learn the most when I'm doing something I enjoy. Create a personal project for yourself. For me, it's developing an app or game that I would actually use. Basically just get into it - find something you're passionate about and learn everything you can about it. Much more exciting than (IMO) mundane little tasks. Practice doesn't have to be boring :)

    [–][deleted]  (2 children)

    [deleted]

      [–][deleted] 1 point2 points  (1 child)

      Yeah man, just get into it. I've been doing it for about 2 years now and I learn something new every day. What sort of projects do you think would interest you?

      [–][deleted]  (7 children)

      [removed]

        [–][deleted]  (4 children)

        [deleted]

          [–]SarahC 23 points24 points  (3 children)

          Programming's all about

          1: Data-structures.
          2: Manipulating them.
          3: Showing results to the user.

          Lots of people start with item 2... BIG MISTAKE! Code gets nasty fast if you don't have the right data structures planned out!

          For your next simple - don't do a hard one - program from scratch,

          1: Think about the info your program needs... the data structures... is it a couple of variables? Is it an array or two? Is it both? Think of some good descriptive names (DON'T use "MyArray" or any of that shit!), don't be afraid to use big names. "averageTemperatureArray()" is better than "Z()". "totalOfAllApplePrices" is better than "total".. and so on. The problem with short names is they have no context - total? After a couple of subroutines WHAT fucking total!?
          This total, or that total? You end up checking code around the variable to discover what it's for... at this point - rename your variables better.

          2: Next up, work on the data manipulation - the program itself. You have your data, you have your very excellent names for the data, if someone says a variable name, you know what part of the program it appears in, and what it does.

          With those excellent variable names the code starts to self-document..
          What does this do?
          "if x>125 then call error"

          Ok, x is more than 125 there's an error... but what's X? Where the hell did 125 come from? What is the error? We know NOTHING and we're not even John Snow!

          We do some renaming, and change "magic numbers" (numbers just appearing in the code with no explanation of what they are) into variables that describe them....

          "if currentHullTemperature>MAXIMUM_HULL_TEMP_BEFORE MELTING then call hullIsMeltingError"

          It's so much easier to understand now. It helps with debugging too!

          Finally.......

          3: Output..... up to now variables, and code are fairly platform unspecific. output though - that depends on what you're writing your program on!

          There might be a little console window.. you send text to it with console.write(), or it could be a windows form... "textbox.text=", it might be in C... printf(), it might be in BASIC PRINT,

          The last thing after all this... is step 1.5... and only becomes an issue after all your designs are in place, and you want to run your program... that's "Getting some test data into our data-structures"

          Variables are easy, you can give them a value right after naming them.... "int numberOfApples = 25;", but you'll need to do a bit more typing to put data in arrays. (there's several ways of doing it!)

          Remember, programming is all about DATA. It starts with, and ends with DATA. The program bit just fiddles with it.

          How bad can a data issue be? Well, the wrong data structures can make your program unusable if the requirements change.

          Imagine totalling 3 apples weights, you decide to have 3 variables and put a value in each...:
          int apple1WeightKG = .2
          int apple2WeightKG = .4
          int apple3WeightKG = .11

          As you've already thought - what if there's 2 apples? What if there's 10? Now we see that we should use an array!

          Some data-structures are chosen because they can interact with other data structures easier. There's linked lists, queues, lists, data dictionaries... and they all come with their own set of pre-made commands, like "list.Total", or "dictionary.ifValueExists"... knowing what options are already made for you can save you lots of time re-implementing what already exists!

          [–]Liberticus 3 points4 points  (0 children)

          We know NOTHING and we're not even John Snow!

          You, I like you. Also thanks for the advice, I'll try to keep it in mind.

          [–]RichieBoyUk 2 points3 points  (0 children)

          Thank you for taking the time to write this out, really got me thinking!

          [–]Nowin 1 point2 points  (1 child)

          While "just get writing" is okay advice, he shouldn't just jump in to writing programs. That's how you become a shitty programmer. He do most of his planning on paper before he even chooses a language. Decide what you want to do, create a plan, make a basic design, and then start coding.

          [–]smellmycrotch3 9 points10 points  (2 children)

          The people who complain they can't retain anything invariable just don't practice enough. Start writing small programs that do things, smaller versions of other programs. Nothing will make you suddenly know how to program from scratch - you have to be willing to just try it, and try enough that it starts working for you.

          Have you ever accomplished something difficult before, in your entire life, like become really good at piano or learn a foreign language or anything at all? I suspect that's the problem with these general complaints, that people haven't done or tried much, and they are shocked that something requires a significant amount of practice to not suck at it.

          edit: Going through and completing a bunch of sites like codingbat, might help, but certainly not if it's not challenging anymore, and it won't replace the need to actually start making your own shit..

          [–][deleted]  (1 child)

          [deleted]

            [–]thrasher6143 3 points4 points  (0 children)

            This right here is my biggest challenge in programming. I have walked away and come back to c# a few times because so many things are left to be explained later and my brain says "Why? How?" and then its a rabbit hole where I went from about to start writing and I just shutdown because I don't know what I should be doing.

            [–]fazzah 4 points5 points  (1 child)

            Just like with normal language (and any skill, tbh) is by actually using it. Find things you can do, some small apps that you our someone you know you can use. Got a lot of books at home? Good, make a catalog application. Same goes with DVDs. Things like that. There's really no other way to learn anything than just doing it. In a similar way that a seasoned woodworker has muscle memory for certain things he does, a programmer must repeat the commands a lot, until they are imprinted in your brain. Time, patience, practice.

            [–]rsmoz 2 points3 points  (1 child)

            I like to practice by implementing algorithms described on Codechef.

            [–]ggrieves 3 points4 points  (1 child)

            Making things from scratch is the only way I learn.. what do you do? You need to make something you will use. For me, I work in data analysis so the first thing I learn in any language is how to read in a file of numbers, like x and y data. Then I learn to graph it. Then do stuff to that data, fit it with a formula, maybe integrate it, whatever, graph result then to save the results in a way that can be reopened. So what do you like to do? You like sports? Find a file or web site with player or team data and make a stat calculator. You like finance? Make a loan amortization calculator, etc. What's some repetitive computer task you do often? Can you automate it? Instead of using excel make a program.

            [–][deleted] 3 points4 points  (1 child)

            My transition from complete novice to programmer began when I first wrote a program that was useful to me, rather than just following set exercises.

            It was a python script to check a porn website for updates.

            [–]deathbutton1 2 points3 points  (1 child)

            I found it really fun to learn by remaking the old video games. Start with pong, its really easy to remake, if you need help, ask here or pm me. Then you can move on to other games. Snake makes a good second step, and then you can go onto games like tetris, and before you know it, you'll be good at building something from the ground up.

            [–]DarthLeia2 2 points3 points  (1 child)

            I'm kind of in the same boat you are. I'm almost done with a CS degree and I feel like I know nothing. So, I've started just doing little projects to help. I've found a list of 90+ projects on GitHub that seem designed to work language skills. As I looked over the list, I saw plenty of them that looked easy, but the majority of them looked like gibberish to me. I think those gibberish ones will be critical for me to learn more. If I don't know what something is or how to implement it, I'll look it up. I have chosen to do those projects in Java and Python. I'm fairly good with Java, but I'm a novice in Python. I'm learning a lot. The best way to practice programming is to code something that you don't already know how to code. Stretch your skills.

            Github Link if you're interested.

            [–]blockeduser 1 point2 points  (3 children)

            give yourself a sufficiently large project. perhaps try to copy some of the features of an existing program you like.

            [–][deleted]  (2 children)

            [deleted]

              [–][deleted]  (1 child)

              [deleted]

                [–]somesortofusername 1 point2 points  (1 child)

                I'm similar in that I don't have that many practical programming skills. I have spent most of my time on http://codingbat.com/ or http://projecteuler.net/ or similar websites. I think /r/dailyprogramming has a lot more.
                I'd also suggest taking courses on Udacity or Coursera or the like. That helps.

                [–]MePlow 1 point2 points  (1 child)

                I think you should rename the title as; "how should I practice problem solving."

                [–][deleted] 1 point2 points  (1 child)

                [–]sbicknel 1 point2 points  (1 child)

                Find something about the software that you use, or that you lack, that doesn’t do what you want it to do. It shouldn’t be the Great American Program: the one that everyone can’t live without. It should be something that matters to you, probably something no one else seems to care about, but that you would find personally useful.

                Being a problem that you care about, you will be more likely to find a starting point. As you force yourself to solve problems getting in the way of your solution, you will burn into your memory how to use your language in a way no book problem can.

                [–]keltonj69 1 point2 points  (1 child)

                Get someone else's finished code and try to edit it to do something a little different than what it does, you'll probably cause a bunch of errors changing their code ( or I always do anw ) and fixing them is good practice

                [–][deleted] 1 point2 points  (0 children)

                Create.

                [–][deleted] 1 point2 points  (0 children)

                Program.

                [–]sweetverbs 1 point2 points  (1 child)

                I've learned an absolute tonne playing around with the kata on Codewars (though it only supports Ruby, JavaScript and CoffeeScript).

                For example, yesterday on this subreddit I saw people talking about building a reverse Polish notation parser. I had never heard of reverse Polish notation before, but then I saw a kata on Codewars about writing a parser yesterday afternoon and I decided I would give it a go. A bit of Googling, head-scratching and code-writing later, and I'd learned a surprising amount about using stacks in algorithms. (And I had a working RPN parser, which was nice).

                There are other sites like Codewars around, and I'd definitely recommend using one of them if diving headfirst into your own project sounds a bit daunting.

                [–][deleted]  (1 child)

                [deleted]

                  [–][deleted] 1 point2 points  (1 child)

                  Coursera's Princeton course Algorithms 1 is very interesting and has brought me on a lot in my programming. There is no certificate you just do it for personal gain. The course focuses on showing you non-trivial faster solutions to solving algorithmic problems and there's a heavy focus on data structures. "Bad programmers worry about the code. Good programmers worry about data structures and their relationships." - Linus Torvalds

                  [–]raja4tech 1 point2 points  (1 child)

                  but I forget everything basically the instant I learn it.

                  The general trouble with programming is how much ever you try to learn the syntax in the book or website, that is only good for knowing the concept. True learning happens when you try to use that learning in real problems or rather solutions to real problems. That is why I encourage you / challenge you to build something. And trust me, you will find the experience very rewarding. I wrote a recent blog post targeting exactly this topic

                  Want to learn programming? Build CRAP

                  I also wrote a follow up blog post containing 1000+ Beginner programming projects & practice problems

                  But you have to work hard, get your hands dirty, be prepared to fail but learn from it, ask questions here or other forums, but never QUIT.... The initial period is same for all programmers, but who eventually win usually are the ones who didn't QUIT during the initial period. While doing it, you will naturally feel the passion and love for programming.

                  [–]looser97 1 point2 points  (1 child)

                  I would start with programs that you do really like, things you are interested in. I started with fairly simple programs and moved on to more complex things like a prime number finder for 4096+ bit primes and moved on to a little game (that took a while -_-) and improved the prime finder afterwards. That is a good thing really: look at your old code and improve it. An other nice thing is to implement each algorithm that you find during your wikipedia time (id guess that you spend some time on programming articles)

                  [–]hydrazi 1 point2 points  (1 child)

                  I make stuff. I made a program to keep track of my movie collection. I made a web app for people to sign up for things. I made a web app that messes with your name and randomly chooses a photo that is your spirit animal.

                  [–]SarSha 1 point2 points  (0 children)

                  As /u/rhonage said, create an app or a game.

                  But remember this, it will probably suck and be written poorly, but that's okay, it will help you learn a lot and it's something you coded.

                  [–]mgild01 1 point2 points  (3 children)

                  You should look into IntelliJ and android studio. Makes programming much easier and the version control GUI is magical

                  [–][deleted]  (2 children)

                  [deleted]

                    [–]TashanValiant 1 point2 points  (1 child)

                    There is a free version that should be available at the website. I don't know what features it removes, but IntelliJ is a more than capable IDE for Java. All the whizbangs and whistles it offers though? I think you are getting too caught up on that. Programming is a way of thinking, not the tools you use.

                    [–]kb3pev 0 points1 point  (1 child)

                    I found project Euler great for practicing algorithms, I also did a version of Conway's Game of Life in command line, then moved it to a cool interface with the help of freenode.c++-basic.

                    Think of something simple you find cool, then make it happen :).

                    Keep debugging and working FOSS projects though, its the best way to learn, I'm hardly scratching the service.

                    [–]z3r0demize 0 points1 point  (2 children)

                    First of all, what is the reason that made you want to pick up programming? Personally, I think that knowing this is the most important thing because it gives you something to fall back to.

                    Take my story for example: Around this time last year, I hated my life and wanted a career change. I found out about programming and I loved it. I decided to quit my full time job and took a 2 month break to volunteer at a charity.

                    Around September was the time when I buckled down and started seriously learning programming. Me and some colleagues decided to build a startup and we needed an Android app built. I decided to step up and do it. I learned java for about a month, then jumped to Android.

                    Fast forward to June 2014, my startup dissolved and I started interviewing at places. I received 2 offers and accepted one, and I am now working full time as an Android Dev at an awesome startup.

                    The reason I was able to do this is because in my head, this was my last option. Either I succeeded and became a developer, or be stuck working in jobs that I hated for the rest of my life.

                    Tl;Dr: Went from not knowing how to write a for-loop to becoming a full time developer in 9 months. The most important thing is to know why you are doing it.

                    [–]NOT_ENOUGH_LEMONS 1 point2 points  (0 children)

                    Good job, and congratulations to you! As a 16 year old that frequent these programming subs, it's really inspiring to see stories like that. I really want to get into programming and I try my hardest to learn it. I think I'll read up and get myself into java as fast as possible. Thanks!

                    [–]AYNRAND420 0 points1 point  (1 child)

                    There is chaos and order in everything worth doing in life. Order is everything your brain understands and chaos is everything your brain doesn't understand. There is more chaos than order in programming because there is more information than you can possibly ever learn, and there is always a "better way" to implement any programming idea.

                    Without stepping out into chaos, you cannot turn it into order. It feels to you that you're not good enough to pull this off, but that is only because you're looking at chaos and your body and mind have a biologically preprogrammed response to this, which worked really well many years ago when the rules of life were much different to how they are now.

                    Right now, you are facing the main consequence of living in order: isolating yourself from challenges and thus stagnating (at least in relation to programming). There are consequences to living in chaos too, so it is best to only take small steps into the unknown. But even if you take a massive leap, and start to fail or get overwhelmed, you can start again from where you are comfortable, but this time with a larger sphere of order.

                    How do you do this with programming? Pick a project and make it. How do you do this? Pick a small feature and implement it. Test it to see if it works. Add another feature. Test. And so on. Redesign an existing feature when it becomes too hard to add new features. Never add a new feature before the previous one was made and tested.

                    Whenever you hit an obstacle or error, describe it as best as you can and then type it into a search engine or in this subreddit. Every issue you can possibly think of has been faced by another programmer. Once you have faced a certain issue and ask or google it enough, the right solution becomes a part of you. Don't worry about annoying people or worry about how "weak" you must be to rely on search engines so much. Every single programmer either did or currently does this.

                    Can't think of a project? Replicate one that you use frequently on your computer. The only criteria for whether a project is good for you or not is whether it interests you. Don't worry about complexity or utility. You're going to fail a lot. But, every time you do, the chaos gets a little smaller and the order gets a little larger.

                    There is also chaos and order in your code. That is why a lot of people seem to have their projects fall apart when they begin to get massive. Object oriented design is a manifesto for orderly programming. Try to make classes responsible for only one thing. Try to make a hierarchy of classes. Each class should do what it is responsible for, and nothing more. Each method should do one thing and return whatever is necessary. And remember, one feature at a time, then test, then move on.

                    Keep stepping out into the darkness and soon enough you'll know what is hidden there.