r/learnprogramming • • Sep 14 '17

A noob programmer's opinion on how to learn to code.

I want to specify that everything I will list here is my mere opinion, I have respect for users that may feel that this approach isn't the best nor would work for everybody, especially if those users are industry veterans or teachers. Also, I know this is a wall of text, but I guess I am not good at delivering concepts without examples and redundancy.

Hello. Very often in this subreddit and generally on the internet, there's plenty of takes on how to learn to code, programming and computer science.

I have started learning programming many times in my life and I always came up to some point where I felt that all I was learning was for nothing and programming and computer science were subjects much too broad and complex to me to learn and make anything useful. Every time I went through a new language, every time I wanted to make some useful script for me I would just end up in a dead path were I would just give up for some months/years just to come back later and begin again from the very basics.

This summer I begun again learning from the beginning with some different approaches that I feel have worked very well for me and here I am going to list them.

a) Learn Python as your first language.

The very first time I started to learn programming I did so in PHP or C++. I'm not very sure which one it was. But there are few reasons why I feel Python is a better choice.

First of all Python has a rather simple yet effective syntax. Python forces you to write "cleaner code" through forced indentation and I feel this experience pays off when learning other languages. Take another very important concept in programming like types. Javascript treats variable types implicitly which I find very confusing for new programmers. The same way C and C++ overcomplicate types and have the programmer fight through it without really knowing why and when they should use one type instead of another.

There are many other factors that make Python an ideal language for beginners. It uses many of the most important programming concepts like object oriented programming, multi threading, scheduling, functional programming, bitwise operations, ecc.

To add to this, which I find extremely important to beginners, Python is widely supported by an immense number of modules and extensions. Python fits perfectly for pretty much any kind of possible use. While it is obviously not the perfect tool for every use, it's always okay enough to make any kind of program, even 3d games (which are often a huge appeal to beginners). Even in game making Python is a very useful tool. Python is the de facto scripting language of industry leading tools such as Autodesk Maya and the most important game engines such as Unreal Engine have Python wrappers allowing you to focus on making first and optimizing later as you gain more experience with C++.

I don't think that even Javascript fits the general go-to programming languea as well as Python does. Somebody with a grasp of C will have a hard time writing a dynamic website easily, somebody into Javascript may find it hard to use his knowledge into other stuff (plus JS feels somewhat impredictable during runtime, something I have never, ever, felt in Python).

Next, Python's very diffused in the programming community. It often sits at the top of questions and answers on stackoverflow, this is very important as beginners have often plenty of questions ranging from beginner to complex subjects. This implies that a large number of this questions has plenty of answers.

If you're looking on how to make an online quiz app with Python, you will probably find plenty of repositories on github. You want to make a reddit bot? You want to create a program that tracks the price of AMD's GPU RX 580 because you're tired refreshing your browser and looking at the stores manually? You will probably find hundreds of scrapers and alert bots and truth to be told they are often easier to understand than equivalent scripts or programs in other languages (that's at least my opinion).

b) Code in the terminal.

One of the beauties of Python (but I wanted it to have its own section) is that you don't need to compile it. Not only you don't need to guess what is your compiler doing under the hood but you can actually open your terminal and start coding directly, you can check on the fly what type is a variable, you don't need to quit your script, go back to your text editor, add a print statement, relaunch your script, get the information, quit your program, delete the print statement and go back to what you were doing.

I find that writing each and every small part of your program makes you a better programmer and makes you understand each and every line of your code more clearly.

I'll give you two small examples from my own experience: creating a bot that alerts me when a certain item on a website is below a certain price. You have so many small problems at once: making https requests, handling the responses, converting the website information from string to dictionary, multi threading, scheduling, event handling, ecc, ecc. Just open your terminal and play around with all of this stuff. Requests? Import the requests module and start to learn what the server responses are and what kind of data it gives you. It's formatted like a json? Learn the json module by writing a stupid dictionary of lists and tuples and learn how to get the key values you need. Oh, but you need the script to perform the function periodically? Play with the scheduler module, read documentation, watch videos, search the questions you have. But do so directly in the terminal. Don't waste your time on writing this big classes and functions that do all of this stuff together. Really, play in the terminal it's so much faster and instructive than going back and forth between your code editor and your terminal.

Really, try using Python in the terminal when you approach a new problem and dumb it down to the very bare concepts you need: making https queries, converting strings to dictionaries, parsing the dictionaries for the keys and values you need, multithreading your program, scheduling tasks, ecc.

I have learned all of this concepts in just one afternoon all as a programming newbie hobbyist because I tackled them down to the very basic concepts and I played with them directly in my terminal and I can safely say that I have a solid foundation of the very basics of this different concepts. I am not an expert, but I can make use of them, and that's enough for me at the moment, till I will have a problem that will require me to delve more into those arguments.

c) Code stuff you actually need. When I started programming I wanted to make videogames, giant and complex websites so I delved into Unreal Engine, Django, ecc. Yet here lied the problem: I did not have enough experience with the fundamentals of programming (I still think I don't) like making https requests, vector math (fundamental in gaming), garbage collection, flushing data, ecc, ecc. Yet I encountered most of this problems not all at once but one at the time while writing small programs that I wanted to use. In example I wrote a simple program to automatically refresh my github repository with the files on my local one just by writing a script that only needed a commit message to handle it for me. Saved me what? 30 seconds? I then also wrote a script that automatically executes at startup of all my computers and pulls the latests commits of the repositories I follow (yes I know that's not the ideal way to use github but it was perfect for my use, as all my repositories are private and I'm the only one contributor).

Another example: me and my wife are italian and we have a dedicated budget for alcohol. We like wine, but we don't like paying too much for it in the supermarket. So I wrote a small webpage where we enter the name, producer and type of wine and what shops sell it. This way we didn't have to remember dozens and dozens and dozens of wines but we would know from the start which we liked and which we didn't. Then I expanded on this program: we would write our grocery list on an android app, and I wrote a small script that linked us to website like supercook and others to find out what we could cook with what we had in our fridge. Using this app is literally 30 seconds a day, but we know what we have in our house all of the time and what can we cook with it, and in case, what we have to buy to cook this or that. I wanted to track cryptocurrencies? I made a script to do so. Really, start using the power of coding to make your life simpler, and learn along the way. I find it pretty pointless to learn in a linear way stuff that you won't use for simple yet important to learn smaller programs. All the courses, books I learned at some point started to teach classess, inheritance, event handlers, decorators, stuff you probably don't need as a beginner. Mind you I am not saying that you this stuff is not important and if you're serious about learning programming you should definitely learn, but the point is that once you have an understanding of the syntax of your language, googling and writing programs that you actually care about and are useful to you is much more valuable and impactful on your learning than following the usual paths of code learning.

If you give up and quit while learning to code chances are you lack curiosity, a purpose and are overwhelmed with information you don't really see a use for it.

Really, it took me to actually write programs that I needed to start to really feel like "hey, I can actually program".

d) Learn in classical ways. There's plenty of people, tutorials, guides, websites like codeacademy that want to teach you how to code. Yet, reality is that there's a reason if learning from university courses (plenty of them online and free) and very solid books is a better idea. If you want to learn how to code from youtube...you may succeed in doing so. But I don't think that Bucky's the best programming teacher around. He's a guy that in my opinion has an intermediate understanding of programming and often lacks the biggest picture (or at least he can't deliver it to viewers) of why stuff is used in a certain way. No book or teacher is perfect, and here you may find help on youtube, blogs, ecc. I have to admit that I really understood regex, exception handling in Python and other stuff better on youtube than in books or other written format and sometimes I had to learn about something on 3-4 different sources and watch several youtube videos to get to the point where "oh, know I get it" but generally speaking chances are that people you are watching/reading are young and somewhat inexperienced programmers (because think, if those guys were great programmers, why are they trying to make a living on youtube visualization and their website adds rather than having a good job?).

I also do not recommend stuff like CodeAcademy. There's an overemphasis on algorithms. I see the point of it, but honestly speaking I very rarely need to program scripts programs and functions that rely on algorithms. My point is: if you are trying to learn if, then, while ecc statements, the best way to do so is by applying them to stuff you need or are interested in, rather than writing a terminal battleship game or stuff like that. Chances are you're not interested in writing a terminal battleship game or stuff like that so why spend hours on stuff that puts you in an algorithm thinking rather than giving you a solid foundation on stuff like variable passing which is much more useful and general but is touched once or twice?

e) Use the internet to ask and find questions. How many times did it happen to you that you had a problem but all of the questions where similar yet not the same you have? Ask. Come to reddit and ask what you want to know. Go on stackoverflow and ask. If you don't understand the answer or if the answer gives you even more doubts, ask for explanations. Another great source for my learning has been irc. I know in modern times the very purpose of irc is somewhat lost, but there are beautiful channels on irc where beautiful people will answer your questions very soon as you ask them. Props to people like Ygh1s, ChrisWarrick or altendky on the #python channel on freenode. You give so much time to newbies, literally hours every day, just to help less experienced people. The same way, go on stackoverflow, reddit, irc, ecc and answer the questions of people that understand less than you. Chances are that in most cases you won't have the answer, but if your curiosity drives you, you will learn from other peoples answers and you will actually find that many things you thought you knew you actually don't. You will also learn new modules, new stuff, new programs and new ways to apply your limited knowledge that may inspire you. Thanks to stackoverflow I found about tensorflow which I found very curious and I started playing with it to try teach my computer play some videogames. I can't say I had any success till now, but I enjoy it and learn along the way.

That's all folks, I hope this wall of text inspires some newbies that encountered my own problems as well and I hope that a nice and informative discussion might be built on it.

827 Upvotes

113 comments sorted by

64

u/Jannis_Black Sep 14 '17

I have to disagree with the algorithms thing. I would go as far as saying that every program either relies on algorithms or is entirely useless. This is simply the result of the definition of the word algorithm as a Series or collection of instructions that perform a specific task. If your problem either does not contain any instructions or does not perform a task I would say it's pretty useless. But even more complex algorithms will be what you do as a programmer. While it is true that many of the more fundamental algorithms are already built into the standard libraries of most languages you will rarely find a program where you won't have to do something like make decisions based on the value of each element in an array or similar where you will have to do some of the dirty work yourself. There is a reason after all that Algorithms + Datastructures = Code is such a common statement.

I see your point that learning about things like variable passing might seem more immediately valuable than algorithms, these are things that can strongly depend on the language or context. They are important if you want to learn a new programming language but if you want to write larger programs than just a few lines you will need to think algorithmically.

29

u/[deleted] Sep 14 '17

I absolutely agree with you.

I am not stating in any way that algorithms are not important, what I am arguing is the over abundance of heavily algorithmic exercises to teach code for beginners.

When you're still new with concepts like functions, operators, statements, expressions, I feel it's better to make those concepts more solid rather than overstressing on programming a battleship or checkers game in a terminal.

I feel like easier tasks and a more general (yet solid) foundation on basic stuff (operating with files, api programming) is much more useful and practical than algorithms.

I've started to learn programming so many times on different books/courses yet I always thought that there was an overabundance of exercises involving algorithms yet I literally could not understand the very basics of saving a text file without clearing it each time I was opening it.

Before thinking algorithmically and approach more and more complex functions it's maybe better to do the basics.

To me algorithms are the very fundamental of coding (well, not just to me), they are like passing the ball in soccer and basketball. They are fundamental and present in every single action.

But before learning and stressing over passing the ball in more and more precise and effective ways there are other fundamentals to learn first (and along with passing the ball) such as the rules of the game, the basic strategies, training to have a better physical condition to even stand on the basketfield, ecc, ecc.

I don't know if you get my point.

7

u/Noumenon72 Sep 14 '17

I've been in enterprise programming for about a year and learning about four years. I don't think I've used a single algorithm. It's 100% "what syntax is needed to get these objects into that adapter". Sets and lists. Whenever I have been tempted to do some kind of sorting, parsing, or graph traversal, it's always turned out to be a waste of time, compared to finding a library that could do it in a few function calls. I can't really imagine a company where more than a few top coders actually work with algorithms rather than tools.

2

u/[deleted] Sep 15 '17

I can't really imagine a company where more than a few top coders actually work with algorithms rather than tools.

Depends on what the company does.

I wanted to apply to a company that does mostly weather forecast applications and it was heavily algorithmic.

11

u/Jannis_Black Sep 15 '17

Yes but even chaining the right calls to the right tools together will result in an algorithm. You don't have to find the next Dijkstra to design an algorithm. Everything that takes some data in does a couple of things to it and produces some other data is an algorithm. And those adapters and libraries have to be written as well. A huge plus is that it helps to know how things actually work

3

u/joequin Sep 15 '17 edited Sep 15 '17

I rarely have to implement complex algorithms, but probably once or twice a year I have to do something for which there isn't a dependency that we're willing to bring into the project. You need to have some oeoeoel in your company who can do that. Preferably everyone can do it because they can make more educated decisions when complex problems arise.

3

u/ACoderGirl Sep 15 '17

You do have to know a fair bit about algorithms to understand what to pick for using libraries, though. I'll also remind you that algorithms are simple series of steps. So there's no way you've never used an algorithm before. What you clearly mean is "I've never written the implementation of a popular, named algorithm". But you've certainly used such algorithms and have implemented novel ones.

But honestly, it's mostly an issue of scale. The specific algorithm you use matters more when you have massive amounts of data. When you have large amounts of data, you have to be efficient and that requires a firm understanding of how algorithms scale to their input.

It also highly depends on your task. Eg, I find that using interesting algorithms happens quite a lot in my work, but I work with a lot of machine learning and simulation software. Stuff where tasks can take hours to run and data sets can get massive. Yeah, you mostly try and use libraries where you can, but that doesn't mean you're not still working heavily with algorithms. And that knowledge of how to implement various algorithms comes in handy because you pick up the patterns and use them in novel ways. Especially since in my field, pretty much all the major applications we create are basically large scale algorithms.

2

u/Noumenon72 Sep 15 '17

An algorithm's a set of instructions for solving a logical problem. "Insert <i> tags around all capitalized words and delete the rest" are simple steps, for example, but they're more declarative than algorithmic. You just do them without thinking, all it takes is attention and syntax.

I've actually thought of some things I did over the year that were definitely algorithmic, though, like "duplicate one location's children to many locations by cross joining with target locations, identifying a surrogate key to remove duplicates, and inserting the rows from that temp table into the main table." But it was largely stuff like "Oh, you type the same commands 10x a day? Find out how to issue those exact commands with whatever language that system has available." I guess I was more implementing algorithms other people trained me on than developing my own.

20

u/ooqq Sep 14 '17 edited Sep 15 '17

I have a similar story to share.

I was and still learning C as a first language, everything went more or less nicely, until I reached the point on my book where I had to write a sentence and the program must output the same sentence reversed:

Hello there fellas fellas there Hello

this program beated me, I was unable to make it work due dreaded overflows and everything. The previous program took me 3 full days of struggle to pull it off, and the last three or four program exercices left was even more puzzleing "write a caesar cypher, write a magic square generator" etc. Since it was a specific book with specific exercices, I just fold.

Fast forward one month, and I need to recover my icloud account, for some unknown reason, I decided to change the associated phone number into one unknown to me. Since it was a two-factor protected account, and no recovery key anywhere (I even file recovered my entire external hard drive to no avail), everyone at apple told me to kiss the account good-bye and accept the loss.

Not decided to give up yet, after a lenghty process I was able source the entire phone number, and with that information, I was able to find the carrier, and after talking with near everyone in the company, they gave me two hints.

My number was available on the system but they cannot give it to me since that is illegal practice to avoid "gold" number trafficking and number hijhacking.

Theres an online service where you can sign-up for a mobile line and the system will give you 10 random numbers to choose from (from a pool of about 4 million). So they wished me lots of free time and a ton of luck.

I have neither, and I have something better. I have Python.

In two days starting from zero, I was able to create a script in Selenium where the program was brute-forcing its way into the system, I had it configured in such a way that it will find the number, fill all the data, buy it, pay for it, and even alert me via email when done. I even had to tune it down since it was able to bring the system down due sheer server request numbers.

I left the program running at nights when normal system usage will be at minimum if any, I settled on about 150.000 numbers per night. Since I was brute-forcing my way thro the system, I knew no better man for that kind of job that The Hulk, so Hulk.py was born.

After two weeks, I got the email from Hulk, and sure enough I recovered my "impossible to recover" icloud account. Which was a trivial SMS text message matter when I got the phone number back into my hands.

After the success, I started again my C studies and I was able to break the goodam reversing words program, and the Caesar Cypher and everything. And still going strong :)

Everything the op wrote its true. Do not give up, and program stuff you are interested on. Oh, and Python is more capable than any other language to pull-off any kind of stunt you need. That is very very powerful. If you care about what are you programming, is a massive boost you cannot get otherwise.

1

u/[deleted] Dec 29 '17

What book was it?

3

u/[deleted] Sep 15 '17

this was a good read, that's actually amazing you got the account back

3

u/ooqq Sep 15 '17 edited Sep 15 '17

The most important part is that the history its true, you can find the C book solutions on my github, albeit not perfect, at least work. An amazing thing it is the fact that it cost me one month to figure out the phone number talking to ppl (apple hints you the last two numbers), but just 16 days to brute force the system running only nights at low speed.

57

u/DeuxAlpha Sep 14 '17

Very good post. Especially the part about "code stuff you actually need". Once you have an idea about what you want to create, everything you learn will trigger a sense of "Oh, that's cool! I'd be able to implement the concept/tool/technique in this or that way in my own application." Whether you want to create small scripts as mentioned in your post, or a bigger application that has the potential of actually making the big bucks, keep something that is your own in the back of your mind that motivates you and you thrive to achieve. Basic programming examples, as mentioned in your post, cover their problem for the sake of discovery and learning. But after, if you don't have a place to apply it, it's easy to think "Okay... so what?"

15

u/[deleted] Sep 14 '17

Exactly the feeling I think most newbies have.

They try to follow some book, course and they end up in a state of "why would I care about dictionaries" but the course insists on shoving all kind of information on dictionaries with the usual cars-price as a key-value info, but while you're stuck in your for key, value in dictionary you're actually losing the track and the purpose of previous concepts.

How many times I restarted to learn programming to end up at the point where I learn classes and yet I could not even make a simple http request or save and update a file of text which are practical things that are much more important imho.

14

u/ipe369 Sep 14 '17

Great point on learning python first, I'd like to add that learning C after python is probably the best 2nd language. Python's great to learn how general logic works, variables, loops etc - but gives you absolutely no idea how the computer works underneath. Having to deal with memory and pointers in C was probably the biggest leap i've ever made in learning to code, and most languages after that were a breeze to pick up.

5

u/[deleted] Sep 14 '17

Absolutely agree, I wanted to add it to learn it as a second language but the post was long enough.

The beauty of C is that it is very useful for Python programmers, as Python interfaces perfectly with C libraries and there are beautiful things like Cython to combine the best of both worlds (I can already here plenty of people getting mad as they read those lines...).

Obviously you want to learrn a lower level language regardless of Python, I'm just pointing out the benefits of learning it as a second language.

2

u/ACoderGirl Sep 15 '17

That said, trust me in that you probably don't want to write C (or C++) Python libraries. We have some of those at my work (for performance reasons). They are hell. And now we get lovely segfaults in Pythonland, which is real nice. Mind you, Qt is probably at least as easy to cause segfaults. It's the differences in memory management that make Qt libraries have the ability to cause horrifying crashes.

Crashes aside, the interface for writing Python stuff in C or C++ is just very verbose and there's a lot to take care of. Type differences make things a lot of work. Memory management is a lot more complicated. Definitely better to keep those languages are separated as possible.

1

u/joequin Sep 15 '17 edited Sep 15 '17

High performance libraries can't be written in python though. Python is hundreds or thousands of times slower than c/c++. Python is a great language for data processing because it uses libraries written in c/c++ for all the heavy lifting.

(You probably know this, but the new/prospective programmers reading this might not)

8

u/captain_c0ld Sep 14 '17

Very good post. Can you recommend some Python projects from beginner to advance levels?

11

u/[deleted] Sep 14 '17 edited Sep 14 '17

I really have no idea rather than "think about something you may use".

Something not too big and complex.

A friend of mine was a weirdo obsessed by his ex girlfriend so he created a script that checked on Instagram's APIs all photos coming from a very specific geographical location (he literally queried based on geographical coordinates pointing at her room with a 100 meters error).

Or if you want to buy something on amazon and such you could write a script that checks the price for the item.

Or if you play League of Legends you could use League's APIs to track your performance and trying to find patters in where do your losses come from (maybe low farm, too much deaths on specific champs, ecc, ecc).

Beginner in my opinion isn't really a limitation.

Once you understand how to write functions and pass them values you are good to go on your journey. It is absolutely not enough when you start approaching more complex problems and programs and obviously you will need years to even think to be an "expert" on a language but it is enough in my opinion to start "playing" (please, understand that I'm speaking as a novice/hobbyist, not somebody who wants to be a software engineer at facebook) and creating something useful.

If you have fun and you can make use of your programs you will start to incorporate more knowledge and see the point of the knowledge you absorb. When I wrote my cryptocurrencies alert bot I still was like "why do I even need anything other than functions", then poking around I got to the point where i was "let's just use a class Coin for my methods and objects rather than writing all of these distinct functions I have to call each time, an instance might work much better than this mess I'm creating". But before that I went through a bunch of very useful (to me) scripts that did not raise the need for a class oriented program.

Too many times you encounter in courses plenty of information you have a hard time imagining how and when to use them, regardless of the examples given to you.

10

u/[deleted] Sep 14 '17

Great post but have to comment on your "creepy-as-fuck" buddy🤡

Hope he got some perspective and used his skills for good instead

Learning html css now via codeacademy but will move to freecodecamp after. Excited to try Python after reading this

1

u/maltesebanana Sep 15 '17

I think that was great advice!!! Time to make real use of python!!!

1

u/Smallzfry Sep 14 '17 edited Sep 14 '17

I think the case with the creepy guy is that there is some creep interested in the girlfriend, so the boyfriend created a script checking photo metadata for photos near her room (in case in case the creep is taking pictures through the window or something). It's not the creep that's using coding to his advantage, it's someone trying to catch/stop the creep.

Edit: nevermind, misread "was" as "has", I agree with the statement above now.

2

u/blink Sep 14 '17

Nah man, he said it was the guy's ex girlfriend.

1

u/Smallzfry Sep 14 '17

oh, I misread "was" as "has".... yeah, that's just creepy AF.

4

u/s0lv3 Sep 14 '17

Your friend is a weirdo

7

u/Apkoha Sep 14 '17

I think the term you were looking for is Stalker.

1

u/james_is_an_ok_guy Sep 15 '17

Yeah that's genuinely concerning behavior.

0

u/[deleted] Sep 15 '17

[deleted]

3

u/[deleted] Sep 15 '17

Html and Css are not much of programming language, there's little to no logic in them.

I can recommend you a great starting point to get into programming which is Harvard's introduction to programming, CS50.

It's different from my take, as it starts with C first and then moves to other languages such as Python.

It's hard, it moves fast and you will end up swearing and thinking why you can't accomplish your tasks very soon (since the Mario problems in Lection 3).

But it pays off, really, it does. Just be consistent in your learning, and doing exercises.

There's an amazing Facebook group where David J. Malan and the CS50 staff will help you out (this course has more than 50 employees...).

https://www.edx.org/course/introduction-computer-science-harvardx-cs50x

5

u/[deleted] Sep 14 '17

C over complicates types?

Its type system is incredibly simple.

1

u/[deleted] Sep 15 '17

I simply meant that in my honest opinion getting newbies into "doing something useful" as quick as possible is, again in my opinion, the best way to get people into programming.

To me many programming courses take a path into programming that is too linear and loses a bit the purpose of programming (simplifying people's life).

I don't know how to make an example, but let's say you're doing math in highschool and you're learning functions.

You learn limits, derivatives, second and third derivatives and integers and how to use them, but you're never actually shown how to make a graph of your function.

You go through all these concepts yet you're not shown what's the purpose of finding those derivatives and why you need integers.

I don't know how else to explain it, it's just that I think that newbies should be get into doing something practical and useful as quickly as possible, while keeping to learn more advanced programming and software engineering concepts along the way.

What's the purpose of teaching pointers or classes to people that can't make a single http query or save a file or make some cron application for themselves?

1

u/[deleted] Sep 15 '17

Besides the point...

C has a simple type system.

4

u/So_average Sep 14 '17

As an old fart who has been trying to become a decent programmer for years, I don't understand why people don't recommend learning to write scripts in one of the UNIX/Linux shells as a first approach to programming. Learning loops, if then else, variables, functions etc. is a fundamental programming skill and the various shells can be developed to do some interesting stuff using these skills.

THEN, move onto a 'proper' programming language.

NOTE : No, I don't mean learning in detail what can be done with sed or awk.

1

u/[deleted] Sep 15 '17

Very interesting, do you have any resource for a starter?

2

u/So_average Sep 16 '17

Loads of bash (I'd personally recommend learning bash over other shells at least at first) tutorials out there. tldp.org might be the best place to start.

2

u/codycoyote Sep 14 '17

I actually thought of this but to be fair my favourite language by far is C. Shell scripts would complement his (I think he?) idea of making things which you'll find of use. Very often I find (and I think everyone does) I repeat a task and that's a perfect opportunity to script it. And the beauty of Unix (and Linux really is Unix with different licensing) is of course you can pipe the tools together and come up with something which might not be possible otherwise (or thought of).

Yes shell scripts is a great idea! Of course we all learn differently and so it shouldn't be a black and white idea but it's a good suggestion nonetheless. And I agree. You probably don't want to start out with sed and awk though I guess it depends on your aptitude and experience.

1

u/ACoderGirl Sep 15 '17

Have you seen Bash? It is such an ugly, awful, truly terrible language. And the type system? Heck, any non-trivial scripting I do in Python specifically to avoid Bash.

10

u/[deleted] Sep 14 '17

Tbh if you've only been learning since the summer you really shouldn't have such an "informed" opinion about your language of choice versus others.

10

u/[deleted] Sep 14 '17

I started learning multiple times.

I'm comfortable (not an expert tho) on C, C++, Javascript, PHP as well and I feel like Python's a no brainer to choose as a first language.

Also, I pointed in the very first lines that I'm a newbie and that what I was writing were opinions, not facts.

Just to say, you could add something to this discussion and argue why my choice is wrong and suggest something else in case.

2

u/Ace0fspad3s Sep 14 '17

What I got from his post is something that offers decent opinion from another novice rather than an "expert". Theres plenty of advice from this sub for people that have been coding for years but sometimes they forget what it was like to start out, so sometimes even though they offer good advice, it may not be as easily digestible.

2

u/RasAlTimmeh Sep 14 '17

I've found this to be the case especially with simpler syntax and making small bite sized programs with a focus on understanding each line.

It helps when you have a really good instructor and tutorial which are very hard to find.
Things like code academy just make you read a word problem and regurgitate lines.

A Reddit member posted his ruby on rails tutorial on here and his style of teaching is my far the best for beginners. Do a small thing, follow up with a video explaining why and what is happening.

For JavaScript there's a good course on udemy.

Do you have any specific courses you recommend that have fun, real life small projects similar to your scripts?

4

u/[deleted] Sep 14 '17

I didn't read it but I heard very good things about Automate the Boring Stuff with Python.

I really think tho that it's more about writing something that you find useful.

1

u/SpaceGenesis Dec 31 '17

The problem with things like code academy is that they go from very simple to very hard very quickly. There are many things that need extensive explanation.

2

u/rushed1911 Sep 14 '17

Did you find a list of "my subreddits" in a random pastebin somewhere for your script program ideas?

You might have seen this already but if not check out sentdex on youtube for Python and ML with video games, he's trying stuff with Grand Theft Auto V now (and his other videos for awesome python stuff in general)

1

u/[deleted] Sep 15 '17

Yeah I do follow sentdex :)

8

u/AutoModerator Sep 14 '17

Please, don't recommend thenewboston.

They are a discouraged resource as they teach questionable practice. They don't adhere to commonly accepted standards, such as the Java Code Conventions, use horrible variable naming ("bucky" is under no circumstances a proper variable name), and in general don't teach proper practices, plus their "just do it now, I'll explain why later" approach is really bad.

I am a bot and this message was triggered by you mentioning thenewboston. Please do not respond to this comment as I will not be able to reply.

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

11

u/[deleted] Sep 14 '17

For whoever reads the comment without reading my post, I mention bucky...to not recommend it..

If you want to learn how to code from youtube...you may succeed in doing so. But I don't think that Bucky's the best programming teacher around. He's a guy that in my opinion has an intermediate understanding of programming and often lacks the biggest picture (or at least he can't deliver it to viewers) of why stuff is used in a certain way.

1

u/AutoModerator Sep 14 '17

Please, don't recommend thenewboston.

They are a discouraged resource as they teach questionable practice. They don't adhere to commonly accepted standards, such as the Java Code Conventions, use horrible variable naming ("bucky" is under no circumstances a proper variable name), and in general don't teach proper practices, plus their "just do it now, I'll explain why later" approach is really bad.

I am a bot and this message was triggered by you mentioning thenewboston. Please do not respond to this comment as I will not be able to reply.

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

22

u/CookieMillz Sep 14 '17

Posts like this on this sub are what gives me the confidence to really push myself to learn programming (I actually choose Python to learn first!). Thank you for your post ep1939!

12

u/littlemonstergames Sep 14 '17

You can do it! If you want to get really good at it, just keep doing it. I've been doing it almost daily since 2000, and when I'm not able to (i.e. holiday etc), I'm thinking about it or something related.

Sometimes I see artists do a sketch while sat in a coffee shop, and I think, that's amazing, I wish I could draw like that. And I could, if I did it every day for 15 years like they have.

So my advice, from almost 18 years of a programming (64% of my life), is just do it, keep doing it, and don't be afraid to try something. Code lots of small things, but code some big things too. Code lots of simple things, but code some complex things too. Learn everything you can and enjoy every minute of it. And never lock yourself down to specific technology or languages. That's not you. You're an engineer and you'll pick up and learn the tools you need, Python is just your first tool, but there are so many other tools.

Good luck!

4

u/[deleted] Sep 15 '17

This reminds me of that saying: The dumb leading the blind.

2

u/[deleted] Sep 15 '17

You could've expanded on why I was dumb and add your take on this discussion tho.

1

u/[deleted] Sep 15 '17

Yeah you're right. Sorry for being an ass on the internet. As someone that was largely self-taught and has been doing it professionally for about 3 years: I think you should be spending more time learning by yourself rather than writing guides that are only half-correct.

There are so many learning resources on the internet already, why do we need a self-proclaimed "noob programmer" telling us to start with Python no matter what?

I get that it's coming from a good place, but I think it hurts more than it helps.

1

u/[deleted] Sep 15 '17

If you reread my first two lines I was quite clear that:

I want to specify that everything I will list here is my mere opinion, I have respect for users that may feel that this approach isn't the best nor would work for everybody, especially if those users are industry veterans or teachers.

I have shared what worked for me that I started learning programming many times and that was what I listed in my post, mainly doing programs you need, learning Python for many, in my opinion, good reasons, and so on.

It was mostly an inspiration to people that get stuck in the usual pattern of computer science learning that feels like it is getting them nowhere.

32

u/rebelrexx858 Sep 14 '17 edited Sep 14 '17

Learn Python as your first language.

no

b) Code in the terminal.

no

c) Code stuff you actually need.

BINGO! This is how you need to start thinking about learning to program. You need to actually care about the thing you're building because it will make your life easier. The thing you need to build will require that you select a language, and that language will be based largely on the task you need to complete.

Learning to program IS learning a new language, and they all have different barriers to entry (location can make some languages easier to learn than others).

Coding in the terminal may be okay for some languages, for others you probably shouldn't. It depends again on the task at hand.

Spend time learning HOW to think like a developer, and how to ask those questions. Its JUST like learning a new language, if you want to know how to ask a question in spanish, you might google, how do I ask a question in spanish. The more you google, the better you get at learning the words to express your real question: language identifer how do I prompt a user for input

edit: for reference, I am a self taught developer. My first language happened to be bash because the system I needed to interact with had bash, but not python or anything else available.

6

u/blink Sep 14 '17

So your advice instead of learning Python is to learn a language relevant to your interests/needs?

8

u/rebelrexx858 Sep 14 '17

If youre just starting out, the object is to stick to it and complete the thing you're building, from there you can build more things, you learn limitations on certain languages, you learn to ask better questions. But you have to stick with it. If you need to do statistics homework, python isn't going to be the best option, but R will probably be right up your alley.

Python is not the one size fits all solution that will allow anyone to learn to program. I despise python, the whitespace drives me crazy.

5

u/mrbaggins Sep 14 '17

I'm with you, but a lot of the net isn't. Invisible characters should not be important.

1

u/xkcd_transcriber Sep 14 '17

Image

Mobile

Title: Python

Title-text: I wrote 20 short programs in Python yesterday. It was wonderful. Perl, I'm leaving you.

Comic Explanation

Stats: This comic has been referenced 371 times, representing 0.2206% of referenced xkcds.


xkcd.com | xkcd sub | Problems/Bugs? | Statistics | Stop Replying | Delete

1

u/jackmaney Dec 29 '17

If you need to do statistics homework, python isn't going to be the best option, but R will probably be right up your alley.

SciPy, Pandas, and scikit-learn would probably beg to differ.

1

u/ACoderGirl Sep 15 '17

Personally, I would think that Python would actually be better for stats, in combination with numpy. The language is vastly easier to get help with and find resources for, which is reallllly important for beginners. Obscurity is your enemy. Not that R is super obscure, but compared to Python, it's nothing.

Numpy is insane for any kind of mathematical computation, anyway. I don't think I've ever had a statistical test, distribution, whatever that wasn't in Numpy/Scipy and easy to use. Based on some quick google searches I just tried to make, I feel confident saying that Numpy has better documentation.

Not to say that "picking the right language for the job" is a bad idea. It's a great idea. But for a lot of things, Python really is the best tool for the job. Especially for the kinds of things that a beginner can realistically do. The main opposition would be JS and that's simply because you can't really use Python for client side web programming (well, not without a Python to JS compiler, and that's really pushing it, haha). And since you did use a scientific computing example, it's really dishonest to say "python isn't going to be the best option". That part is bullshit. Python is king of scientific computation. Poor MATLAB is trembling in the corner as more and more scientific programmers switch to Python + Numpy.

1

u/midasgoldentouch Sep 15 '17

Hmm, but then you run into issues where the person is learning a lot of things specific to a library, which can be annoying to overcome when they move onto other projects.

1

u/rebelrexx858 Sep 15 '17

Your kidding me right? Python is the wrong here. There are no questions about it. Just because a language can do something does not make it the answer to the problem. Coming from not one, but two teir 1 research universities, I can tell you, turning in your research paper and claiming to use numpy as your statistical reporting tool will in turn have your paper rejected. SPSS and R SPECIALIZE in that. Having a hammer does NOT make everything a nail.

2

u/rout39574 Oct 26 '17

So... I've used R and python both, for a long time. So I've got some context there. Why do you think Python is an inappropriate platform for statistical analysis? The number and variety of citation threads talking about python suggests that, at least in some fields, Python is viewed as better than a black-ball.

1

u/rebelrexx858 Oct 27 '17

Its about choosing the tool that is best fit for the job. If all you need to do is some statistical analysis of data, choose the tool that focuses on that. Generally, what I have witnessed is that the R community will port models first, and quickly, followed sometime there after when a model may or may not be ported into Python. Its about scope. There are going to be many cases where you need to scrape data first, and then mutate data into some form, and then run some analysis on it, thats perfect for python.

2

u/rout39574 Oct 27 '17

So, I'm asking for some substantiation of your claim that doing work in Python is tantamount to statistical incompetence, so much that it will be a bar to publication.

It seems a strong claim, one you would be unlikely to make without some specific experience. I was expecting something like a professional org's standards statement, or guidance from some collective of journals, or... I dunno.. Something.

What you're saying this time around is that the two tools have different peaks and valleys in their competencies. I completely agree with you there. I separately think that the difference between them is probably smaller than most folks' difference in competencies between the two platforms.

Can I take it that you'd like to recall the suggestion that the use of python as a statistical engine is a likely bar to publication?

2

u/jackmaney Dec 29 '17

Your kidding me right? Python is the wrong here. There are no questions about it. Just because a language can do something does not make it the answer to the problem. Coming from not one, but two teir 1 research universities, I can tell you, turning in your research paper and claiming to use numpy as your statistical reporting tool will in turn have your paper rejected.

Having over 7 years of experience in data science and machine learning, I can tell you that Python is readily accepted and used in industry.

And SPSS? Are you kidding me? I've seen Pandas and scikit-learn do in minutes what SPSS took hours to accomplish. If I want to do machine learning, then I need to write some code, not fiddle-fart around clicking on a needlessly complex GUI.

Not to mention the increasing rise in popularity of Apache Spark and PySpark alongside it.

11

u/mrbaggins Sep 14 '17 edited Sep 14 '17

Nice post, but some big problems other people have pointed out, and here's a few more that I haven't seen:

Learn python first. C++ and PHP were bad.

If those are the only 3 options, absolutely. C++ and PHP are terrible for beginners. But Python is not the best option by a long shot in lots of cases.

Javascript treats variable types implicitly which I find very confusing for new programmers.

So does python? It's at least dynamically (and strongly) typed. Javascript is dynamically (weakly) typed, but the dynamic is the part I'd consider "implicit"

If you're looking on how to make an online quiz app with Python, you will probably find plenty of repositories on github.

Just because there's a lot of code for beginner stuff doesn't mean it's quality. There's a lot of bad, a lot of old, and a lot of outright wrong stuff out there, and it often pops up for newbies.

Code in the terminal.

Only when trying something small and new. It's a dangerous place of unsaved and un-undoable work. For newbies, any code they're writing is going to compile in milliseconds anyway.

ather than writing a terminal battleship game or stuff like that. Chances are you're not interested in writing a terminal battleship game or stuff like that so why spend hours on

Because sometimes the abstract lesson is teaching a VERY important lesson that needs to be done so directly. There's two problems with avoiding such material: One, usually newbies don't know what they don't know, so when they want to create a table of stuff, they don't know about arrays, or that you can nest them, unless they've been specifically taught. So they have to be specifically taught, and to keep that interesting, now they're battleshipping. Two: Abstracting a concept down to bare minimums increases the quality and depth of knowledge of that bare minimum much more than trying to absorb 10 different things at once in a bigger piece of work.

You said yourself the terminal is nice for trying something out, and listed each part of writing a price bot. THAT'S why you're battleshipping to learn arrays. You have to learn in pieces, not all at once.

Now, disclaimer, I really don't like python. If I was recommending a language to someone wanting to program, it would be AFTER asking what they want to do with it, and would likely be C#, Rails (Ruby), or less likely JS, depending on their goals. There's only a very specific tiny set of stuff where I'd recommend python, and that's usually to someone who can already program but has a specific task that they want easier solutions to.

Second disclaimer, I'm a high school teacher, and I have to teach programming to both those that are interested and those that are not. There's definitely a difference between those, but most of what you've posted as pluses are things that get in the way of my teaching to lots of people.

The first project my kids do in a programming subject is to make "Worlds hardest game" and we use Visual Basic.net (cue internet outrage at THAT) because we can do something meaningful (most of them know what WHG is, even if they don't want to make it specifically) and over 15 sessions we can go over a LOT of small pieces that are mission critical to programming in general. The bigger picture is important as a sense of purpose, but the actual lessons are targeted, boring, algorithmic building blocks. In 15 lessons, they do FileIO, arrays, colours, positions, variables, conditionals, loops, double buffering, flow control, resource usage, and more little pieces. They use that to load High Scores, create a tilemap, move characters "Win" games, etc.

At the end, there's not really anything stopping them from making a todo list, super mario, tetris, etc because they've been specifically taught the building block pieces. Python has a bad habit of "Import thing" and "use tiny part of a giant block to do a tiny job"

2

u/ACoderGirl Sep 15 '17

So does python? It's at least dynamically (and strongly) typed. Javascript is dynamically (weakly) typed, but the dynamic is the part I'd consider "implicit"

I thought it was pretty obvious that they were talking about implicit type coercions. That's what makes 5 - "2" == 3 in JS, while most sane languages (Python included) would just throw an error about invalid types.

It's a dangerous place of unsaved and un-undoable work.

I think that's pretty obvious. Typically you'd use something like the interpreter to simply see your types and the like line by line. Personally, I like using the debugger for this, often. In my real-world work, I'd often write code in PyCharm at some relevant breakpoint. It's just highly beneficial to be able to see the data and it's structure around you. The interpreter in the terminal provides that, too. And I'd often use PyCharm's expression evaluator to try random stuff, make sure I have syntax right, etc. The exact kinda stuff you'd also do in a terminal as the OP is suggesting. Obviously you have to copy it to an actual file to use it again later, but I feel that's very obvious, even to beginners.

One, usually newbies don't know what they don't know

Agreed; that's a huge beginner issue (and one that can be seen throughout the thread). A diverse education is highly beneficial, even if only for "much later, when you encounter specific problems". Eg, you could go ages without encountering the need to write a graph algorithm. But without knowledge of various graph algorithms, you'd likely have a hard time even being aware of what types of algorithms exist and thus how you might be able to solve your problem. Incidentally, even if you never do encounter the need to use a graph, the mere act of learning about such algorithms can teach you general programming techniques that are very versatile.

1

u/mrbaggins Sep 15 '17

I thought it was pretty obvious that they were talking about implicit type coercions.

Shrugs, maybe. Personally dynamic typing is almost as often a recipe for disaster.

4

u/ChaosEternity Sep 14 '17

Currently in week 5 of my C# class and my brain feels like it's going to explode. Can never seem to "get it " kind of frustrating but I'm just going back and rereading chapters and it's slowly making more sense.

Hopefully it gets easier

2

u/bslizzle Sep 14 '17

I learned C# as my first language for a college course using Murach's book and Visual Studio. It was rough, but that's because learning a lot of the initial ideas is pretty confusing without a good foundation. Practice is the important thing. After creating several programs and seeing how things interact, you get a feel for why they're interacting in those ways, which helps you figure out what the basis of those things are. That sounds kinda cryptic right now, but you'll see what I mean later on.

Pretty much it does get easier. Just practice.

1

u/SpaceGenesis Dec 31 '17

Keep learning and practicing. C# is one of the best programming languages.

7

u/BadBoyJH Sep 14 '17
  1. I disagree, what language you use entirely depends on what you're coding.

  2. Just means you weren't using something with a debugger. "Get a good development environment people, writing Java in notepad++ isn't a good way to learn to code.

  3. Should be the first thing on the list.

  4. (Almost) Every programmer googles.
    The ones that don't have a better more specific resource they turn to first because they're working in something very obscure; or are too insecure to look for help.

1

u/dankmeter Sep 14 '17

Great post! I'm currently learning Swift right now and wanted to get into Python afterwards. How difficult is the transition to Python if I'm familiar with Swift? Also is Swift considered a beginner friendly language?

1

u/[deleted] Sep 15 '17

I don't know I think that once you get good at "programming", learning another language is a matter of getting used to it.

It's like when you learn to drive a car and then you get into a different car, maybe a truck, maybe a bus, at some point you know the fundamentals and you just get used to the differences in the other medium.

1

u/links_own Sep 15 '17

This is pretty much the case. My first language several years ago was C#. Now I feel comfortable writing pretty much any object-oriented language, and I'm gaining some comfort with functional programming. The real trick is just learning how projects are organized and what differences there are with syntax. At work now, I use C#, JavaScript, TypeScript, and Golang pretty regularly.

1

u/[deleted] Sep 15 '17

So taking this into account, and others opinions, should I start learning python through codeacademy or not?

2

u/[deleted] Sep 15 '17

I personally do not recommend learning Python on CodeAcademy.

I'd recommend something like Automate the Boring Stuff with Python.

1

u/bean_patrol Sep 15 '17

ecc.

Italian?

2

u/[deleted] Sep 15 '17

yes.

1

u/rosareven Dec 29 '17

Hey I just stumbled into this post from searching something completely unrelated and find it interesting. Thank you so much for sharing your thoughts as a newbie programmer. I did programming in university myself but haven't really delved back into it since I graduated. I've been interested in coming back.

How are you doing now in your programming practice, 3 months since you wrote this post?

2

u/[deleted] Dec 29 '17

Hey, gotta say I'm getting more and more comfortable. I'm looking at getting a junior position asap.

In fact looking back I even think I was a bit naive and that I would write the original post in another way.

1

u/rosareven Dec 29 '17

What's changed from your original post if I may ask?

2

u/Daandrah Sep 14 '17

Thanks so much for writing this.

I am about to delve into the coding world myself.

I was planning on learning C# and Java with my ultimate goal to learn lua to make addons for games and so on.

Are Python and lua similar in anyway? From what I have read you dont want to learn lua as your first language so that why I was choosing C# and Java.

Thanks

2

u/ACoderGirl Sep 15 '17

Python is more like Lua than C# or Java (as an aside, I find it slightly humourous that Lua is the only language you didn't capitalize despite the fact that they're such sticklers for the name of the language being a proper noun). But languages are pretty transferable.

I would agree that Lua is a bad first language simply because it's generally harder to find help for and I strongly hold that first languages should be super easy to get help with (and thus need to be highly popular).

I'll note that learning multiple languages at once is usually a bad idea (ie, why C# and Java)? Fortunately, those two are quite similar, so easy to switch between (if anything, I'd consider C# to just be "Java++", if you will).

1

u/Daandrah Sep 15 '17

The reason for the C# and Java is because thats what the course I am doing offers. the collage dont do one or the other only both combined.

Please see: https://www.reddit.com/r/learnprogramming/comments/700gzw/question_learning_java_and_csharp_with_with_a/

2

u/lanzaio Sep 15 '17

Meh... I disagree with learning Python first. Most of the time your first language ends up being your home language. Python is limited to a few domains.

I vote your first language is that used in the field you want to work in. Unless it's C++. Don't learn C++ unless you have to. You'll hate programming if you try to learn c++ first.

3

u/[deleted] Sep 15 '17

You'll hate programming if you try to learn c++ first.

Not true

2

u/Britbritt Sep 15 '17

This is fantastic. I really appreciate you taking the time to write all this advice out. A lot of people (most) will just find tricks that work for them and help them move forward but never share them. You taking the time to share is fantastic and I thank you. Also a beginner programmer and I you're advice is VERY helpful. Thank you friend.

2

u/majeric Sep 15 '17

I think Python is not a ideal choice given how much it deviates from common C -style programming languages in syntax. Humbly, Java or C# are better options.

3

u/codycoyote Sep 14 '17

I have some comments.

First of all: the fact you keep returning to it and that you try to find ways to make progress says to me that you have potential; the desire and ability to solve problems is an important part of programming. Being resourceful is as well. And it comes with practise. So good on you here. I'll now comment on each of your points.

  1. I have to confess I'm biased because not only is C my favourite language but besides assembly it's the one language I really got into and enjoyed (i.e. the one I'm extremely passionate about). C is actually quite simple but people make it harder than it has to be and books are part of the problem. This esp goes with the issue of pointers: pointers aren't complicated (though I don't deny you can make ridiculous complex and complicated constructs but if you break it down it's still simple[1]) but so many make it out as if they are. As I noted however being resourceful is important and it seems you found the language which might get you further on. Python. Well I can't say I like it; the syntax is incredibly ugly in my mind whereas for me C is aesthetically pleasing. But I will give you that indeed proper formatting is a good thing to start out with. As long as you're consistent! You made a very key point though and I'll return to that: modules. Modularising is a very good thing indeed.

  2. What can I say? I'm a command line user. I can't say I disagree at all with you. But only to an extent: there is no right or wrong interface; the interface one should use is the interface that works best for that person. That being said it's true getting accustomed to the console is a good idea because it's immensely powerful. But you don't necessarily have to rush into it either. Once you get really good at it though you can do so much more, much faster and more efficiently. Modules. Yes yes yes. Modules are far more flexible and useful than convoluted function. But when I talk of modules I include a set of functions too: it doesn't have to be something you import/include/etc. As for OOP? I would say this is very much an opinion thing: it's a method to solving a problem but it's only one method of solving the problem and to tell people you should start out that way isn't necessarily the best way. Neither is it the wrong way for there is no wrong way as such.

  3. Yes. Automating tasks you do more than once is a very wise idea. But that being said you might consider shell scripts for this. You might consider that also for getting into scripting; while it is true scripting and programming are related I see the two different. But that doesn't mean you can't take the concepts from one and use them in the other. That being said you should also do more than just what you need: you should build your tool kit but after that you should try to answer questions (e.g. in books) and also do programming exercises (also in books).

  4. My only comment here is that everyone should learn in the way their brain works; I hate videos and audio because not only can I read a lot faster (and comprehend more) but also I don't hear every sound just right (and my vision it must be said isn't exactly that great but the real issue is I prefer reading). But none of this matters if you don't also do the exercises! Learn in whatever medium works for you but you have to actually do the exercises! Actually I take it back. I have another comment. I know you tried to clarify the part on algorithms but I want to say that it's true you should learn the basic constructs/syntax; however you don't want to fully ignore algorithms: every single program you write involves algorithms!

  5. Asking is good yes. But not just the Internet (or mostly in what you're describing the web); the Internet is only one place to ask questions. But also: just because someone might have already solved the problem doesn't mean that you shouldn't try to solve the problem yourself; trying to first solve the problem is something you absolutely must do! And I might add that simply writing a question can often get you the answer just as if writing a flowchart (or whatever model works for you).

Finally: resourcefulness, dedication, logic and analysis are things that not only are necessary but things you can improve through practise and patience.

[1] You might look into the `cdecl' program. Also if you really want to understand how to read C constructs you can follow the guide here: https://fbb-git.github.io/cppannotations/cppannotations/html/cplusplus03.html (try to do it without help but then check your answer!).

3

u/curious_mormon Sep 14 '17

I'd recommend Javascript over Python as a first language. It's easier to turn code into immediate, visual results.

2

u/ACoderGirl Sep 15 '17

You don't often need visual results, though. But where learning is concerned, there's the built in turtle module in Python that could very easily draw basic graphics.

SciPy is easy enough to setup (more so if you're not on Windows) and makes all forms of raster graphics easy. Arguably image manipulation is at its easiest with this. And for a nice boost, plotting tools are as easy as it gets (and I'd think that plots are perhaps the most useful thing to visualize oftentimes).

3

u/my_password_is______ Sep 14 '17

yeah

its pretty cool all this is done with javascript + canvas

https://www.youtube.com/playlist?list=PL7wAPgl1JVvUEb0dIygHzO4698tmcwLk9

(the videos cover collisions, ballistics, particles, acceleration and even 3D)

it's cool seeing all the visual stuff, and learning the math is helpful -- especially if you want to do game programming later

and javascript means you can do it even at work where python may not be installed and you can't download it

and I believe Stanford is changing from java to javascript for their Introduction to CS course

1

u/maltesebanana Sep 15 '17

javascript is useful on the web, but it's a terrible choice as a first language.

5 + [] == "5" ---> true [] + [] == "" ---> true 4 + "a" == "4a" "b" * "5" == NaN

These things are incredibly confusing and it would be really hard to explain to noobs that js an incredibly badly designed language and that the interpreter is doing its own thing... etc.

2

u/curious_mormon Sep 15 '17

I think those are fringe cases you wouldn't need to explain to a group of new programmers.

1

u/maltesebanana Sep 15 '17

I like Javascript and have fetishes about that fluidity in its basic types and operations, but I still think they can hurt the beginner and I totally agree that noobs can avoid a lot of time wasting details by starting with python. It's the lego of programming and very well designed. You will never be able to add/concatenate a string and a number. Although dynamic , it's very strongly typed just like java and landing on js after python feels great. You have already learnt some discipline that will help you avoid those weird parts of js.

1

u/[deleted] Sep 14 '17

Guys, I am learning c++ right now, but I am at the very start. At the start so much that my code is

include <iostream>

using namespace std;

int main() {

cout <<"Halp"<< endl;

return 0;

}

Do you think it's worth it, for someone as bad as me to learn? It takes me 5 tries to get the computer to ask for 2 inputs and output the sum of them and I can't even get it to ask for inputs separately. Advice needed.

Edit: Reddit formatting...

2

u/doorway_born Sep 15 '17

Yes. Keep at it- it's brand new.

Keep a browser handy for references and examples. it makes it much easier to understand what each piece of a program does. Never be ashamed to look something up or to get a second set of eyes on your code.

Copy/paste variable, object, and function names instead of typing them manually. It will save you so much grief in chasing down typos.

Type your punctuation first, especially things that come in pairs. Add the variable names afterwards. It prevents errors like "expected ';'"

Practice scanning the right side of your code for closing syntax.

When you are absolutely, totally stuck, print your code out, immediately number the pages, and go over it with a pencil and highlighters. It helps to draw vertical lines between each pair of (curly) braces so you can see logic blocks easily. You'll catch things you didn't see on your monitor.

Don't be clever. Be clear. You have to read this later.

Remember: It does exactly what you tell it to do.

2

u/[deleted] Sep 15 '17

Thank you man!

1

u/Britbritt Sep 15 '17

Fantastic advice. Man I'm really digging the good input from some of you guys.

1

u/Jakte Sep 19 '17

I'm a teachers assistant for a extremely basic c++ course. I've taught/assisted hundreds of students that have no interest in programming. This course is for people that aren't going to be programmers themselves but will work with programmers in their work life. And pretty much everyone have huge problem starting out. Most of them will have a basic understanding of coding when the course is done.

So you just keep at it if you put the time in you WILL get it. The students often ask me how the fuck they should learn because it's like greek to them and my answer is always put the time in. Just keep spend time trying and doing small projects.

Also if you don't have a reason for learning c++ I would recommend c# or java instead. The syntax is much cleaner in my personal opinion. Example cout << "Hello"; in c++ vs Console.writeline("Hello"); in c#.

1

u/[deleted] Sep 14 '17

Thanks for this!

1

u/fredlllll Sep 15 '17

ok i have to say some bad things about this:

a) dont learn a language, learn programming, if you want to get a job in programming at some point. limiting yourself to one language is a bad idea, cause other languages all have their own useful concepts. also if you cant be bothered to format your code by pressing a keycombo in your IDE to format it for you, its your own fault if you cant read it anymore.

b)dont plan in the terminal, plan in your head, read the doc. sadly pythons doc is insufficient in many places and makes this a hard task. want to know what error a method can throw? good luck with finding that in the docs. again plan in your head! or on paper, or write it down in a document what is actually supposed to happen, then add details to that, then start coding. at least do this for bigger projects. you cant wing big projects. except you want your codebase to be complete crap. also i want to add python is horrible for multithreading if you want to parallelize a task, cause of the GIL. then you ahve to use multiprocessing which clones your process memory and fills up your ram if you are working on bigger datasets

c) no problem here. except that you should just code what you want, try making games, but dont expect to finish it. everything you code is excercise. you dont stop learning

d) learning algorithms is important when you do more complex computing. sure that what you are doing at the moment doesnt require knowledge on that stuff, but maybe the day will come, and if you want to work as a programmer its quite helpful knowing about algorithms and how to create your own by borrowing bits and pieces

e) dont just ask questions, also think about it yourself. that way you learn much more than just pasting an answer into your program or modifying one.

this is from the view of someone who studied computer science and learned a lot of these things there, but learning actual programming came after that. also i work as a freelance programmer now and have to use multiple languages for my jobs. i of course try to bring in my favourites where possible, but sometimes you have to make a compromise if teammates are lacking the skills to use your prefered language

1

u/Yithar Sep 17 '17 edited Sep 17 '17

a) Learn Python as your first language.

I really have to disagree with this point. I'm also speaking from the standpoint of a bilingual person.

There is a reason that Java is taught first. And that's because it's statically typed. Yes, it's a very verbose language with a lot of formalities (which is a point that I concede with people who hate Java), but there's probably no other language except maybe C# that fits the bill as a programming language for an intro course (automatic garbage collection, OOP, static typing). It's also an enterprise language.

I'd compare going from dynamic typing to static typing the same as going from informal to formal speech in Japanese. And one of my teachers told us they teach us formal speech first because it's not difficult to go from formal->informal but it is impossible to go the other way around. And I agree with her. Now, back to programming languages, I think it'd be very difficult to go from Python to a statically typed language.

It depends on what you're doing though. If you're just doing web design you can stick to a dynamically typed language. But I'd say static typing offers benefits. See article. It's easier to catch simple errors when using a statically typed language, although the learning curve is higher.

1

u/jackmaney Dec 29 '17 edited Dec 29 '17

How many times did it happen to you that you had a problem but all of the questions where similar yet not the same you have? Ask.

But before you ask, look at the answers provided to the similar questions and see if they can be adapted to your particular problem.

Edit: But if the aforementioned answers can't be suited to your problem (or if it's not obvious how to do so), then by all means, ask away!

0

u/[deleted] Sep 15 '17

[deleted]

1

u/[deleted] Sep 15 '17

Hello, I'd like to say that I'm a hobbyist programmer, I do not study to become a software engineer.

All the stuff you're actually learning is not only important but the very backbone of computer science.

I can see you getting lost as for a beginner this stuff looks overcomplicated and you can kind of lose the purpose of what you're learning.

My advice here is the same I wrote in my post: start programming stuff you'd actually need.

I think you know enough to start playing with other languages.

Maybe write some android/osx app that helps you with something?

Even a to-do task, a grocery list (you may write some small smartphone application that integrates an SQLite database where you record what is your grocery and what you need when you go shopping?), just create stuff.

2

u/[deleted] Sep 14 '17

[removed] — view removed comment

5

u/ACoderGirl Sep 15 '17

Learning resources and tools got a lot better. Even with C++, things are just a lot simpler things days. Install some variant of GCC (probably already there on Linux) and compiling your hello world is as simple as g++ input_file.cpp. Throw a -Wall (warn all) in there for good measure.

I remember ages back all this confusion with "oh, you should install Borland's IDE" and the like. It's a lot smoother sailing now.