Learning to code

Martin

A monoid in the category of endofunctors
is a Smogon Discord Contributoris a Forum Moderator Alumnusis a Community Contributor Alumnusis a Contributor Alumnus
Think of this as a general thread for discussion wrt coding, learning to code etc. There is technically already is a thread about coding, but the last post is from April 2014 so I think it's probably safe to post a new thread.

Anyway, I've just got a Raspberry Pi mini-computer up and running earlier today and am working through a book which gives an introduction into a load of stuff that I can do with it (sections in the book are animating with scratch, programming with python, importing modules, producing games, developing windowed apps and driving header pins). Anyway, I was wondering if anyone knows of any other useful resources for learning to code, any tips for what languages I should aim to learn (and in what order) etc.? I've worked through two of the HTML lessons on CodeAcademy already but outside of those and this book I'm a bit stumped for where to look for additional resources and such.
 
my first attempt at learning a language was by reading this book called eloquent javascript a few years ago. i had 0 background knowledge so very quickly i found it very difficult and gave up after only learning the basics. I haven't read it since but supposedly it's good for learning JS. Other than that i've done classes both IRL and on codeacademy but in retrospect i think i've learned the most from continuous practise, either for my own projects, other peoples projects or just for fun.

if anyones interested you can read it for yourself for free here (im not being paid for this): www.eloquentjavascript.net/
 

Lemonade

WOOPAGGING
is a Site Content Manager Alumnusis a Team Rater Alumnusis a Social Media Contributor Alumnusis an Artist Alumnusis a Forum Moderator Alumnusis a Top Contributor Alumnusis a Smogon Media Contributor Alumnus
Obviously depends on what you want to do with what you learn, but python (please, pronounce packages with "pie" and not "pee", eg numpy = num pie) is a solid choice since it's used a lot and has a lot of resources. If you want to "make apps", I would recommend javascript though, since running functional things in browser is relatively simple (great for starting) and convenient (people don't like downloading things). Books are "proper" but first I would recommend following a tutorial on some small-scope project (I believe todo lists are common), and then coming up with a small-scope project of your own where you can modify some of the code from the tutorial. Obviously, google is great for finding out what basic functions and such do. I more or less learned javascript on my own, so if you want to chat about my thoughts on learning it send me a pm or find me on discord or something.

You will probably get a lot of suggestions for what language, but I recommend not stressing over which to learn since within a paradigm everything is pretty similar.
 
I've had to pick up bits and pieces of coding knowledge over the years and I find I'm most successful when I have a project to work toward.

Usually you can get away with one entry level book in some language and looking up documentation for things you don't know but it can be a struggle sometimes. (But the kind of struggle that rewards you in the long run)

I personally really like Scala even though i never get to use it much because functional prgramming is intuitive to me.

Good luck!
 
I learn best by looking at the source code of existing programs. When I joined PS, I knew very little JavaScript. But in no time I knew my way around it. Years before that I used to make VB applications and, similarly, I learnt by looking at source codes and Googling anything I didn't understand. There are plenty of websites that provide source codes, such as https://planet-source-code.com.

Anyway, as Lemonade said, it depends what you want to do.
 
Like what IT said, I know very little JS but started to pick up on somethings from looking at PS! source code. There is a lot of resources out there that can help you learn any language out there. Ultimately it's up to you to decide which kinda language you want to focus on. Practice the basics over and over again and you can apply it to any language with a little effort. "Bullshitting" your way to a solution is what my professor would commonly say to us if we were stuck. Lots of beginner friendly languages that you can practice basics on would be: Python and Java. You can also go into C but C sucks srry :]
 

cookie

my wish like everyone else is to be seen
is a Senior Staff Member Alumnusis a Contributor Alumnusis a Smogon Media Contributor Alumnus
java is great if you want to spend six hours setting environment variables and downloading jars so that you can print "Hello world". Python is great for picking up basic programming concepts and logic because the code is easy to parse as a human, and there's little of it to parse. Downloading/importing modules to fuck around with is also generally easy, but more heavyweight stuff like OCR libraries will still be painful. But then again doing anything actually useful requires you to deal with stuff like that (regardless of language) but at least with Python that's all hidden away from you while you ride with training wheels.
 

HoeenHero

The Misspelled Hero!
is a Battle Simulator Administratoris a Programmeris a Member of Senior Staffis a Community Contributoris a Smogon Discord Contributor Alumnus
PS Admin
I got interested in learning programming after looking at the PS source code. I learned the basics with codecademy back in 2015 (Javascript, and HTML & CSS), and honed my skills by trying to program my own web game. Whenever I wanted to learn how to do something (ex: how do i make a button run a script when clicked?, Is there a way to run this script on all element with a class of "planet"?, How do I add an element to an array?) I used google to find out, and I learned alot of stuff codecademy didn't teach me (they seems to skip alot). The best two resources I found during this are W3schools (reference for HTML, CSS, JS, and more), and stack overflow (Q&A site, usually what came up when I googled a question). I learned more when I returned to PS and started programming there on a side server and eventually main. The other PS devs were also great a great help in learning various tricks and optimizations (Shoutout to them!).
 
As a professional Software Engineer that is quite successful as a full stack developer and mobile/web app developer I think I should add my 2 cents in this topic.


Now I think I will make a massive post about IT later on but in this one imma just keep it simple and just answer the op's question.


First let me address something, learning how to code is not about learning a language, the biggest misconception about Programming is that its directly tied to learning some language.
See, people do this false connection with Real life ethnic languages, they think learning a programming language makes you automatically a fluent speaker and complete developer.
Well this is not right, because like Human languages, computer languages have some fundamental concepts that apply universally.

So to give you an example, human languages Have base concepts that apply on every language:

- Air regulation and breathing.
- Facial expressions
- Voice coloration and volume
- Body Language

All those things are needed in order to speak any kind of human language and they apply universally, (a smile means the same no matter if you are from japan of africa)
Now we tend to ignore them because they come naturally to us, so when it comes to computer languages people also tend to ignore the things that take in order to "talk computer"
(I love this 'talk computer' expression I jut invented so I will use it throughout)


Here is a few things that have absolutely nothing to do with a specific programing language but are an integral part of each and everyone.

First lets get to the things that have everything to do with writing the code and its syntax.

- Code structure

It doesn't matter what language you are using, nearly all of them are structured the same, the are made up from a series of commands
that usually end with a semicolon or the newline character, the markup languages like xml use tags, All languages have some kind of commenting and so on.


- Execution flow
Programming languages are top down languages, the go from top to bottom with the occasional redirections from things like loops and function calls, this does not apply on things integrational design ex. Verilog, but those are out of the scope.
So that means you need to get a hang of topics like Callback functions, loops, function calls as well as flow control commands like return, break and many more that contribute to the flow of a given program and are universally used, bar markup languages, learning them is not just memorizing what they do, it is actually gridding on them and play around till you familiarize with them, i often notice that the understanding of the flow of loops and difference between the various types like (while, for, etc) is a big issue among newcomers, and you'd be surprised of how many have issues with them even later on.

- Syntax

All languages use about the same things, they have about the same names for basic data types like string, char, etc, well in fact the classic languages like c, java and c++ share so much syntax you could mistake them for the same thing, this is syntax is so widespread the rest of the OOL and functional languages use simplified versions of it with slight variation, like python, where the ; is replaced with the newline, but other than tiny variations, nearly all languages use a . or a -> to access members and properties, they use{} for classes and for argument input they usually use (), thy even share a ton of keywords as well as overly popular statements like For and If and return.

This just show how similar the languages are and how you can easily jump from the syntax of one to the syntax of the other, highlighting again that learning the actual form of the language is not as important as "talking computer"

Another point that comes with syntax, having a good writing style and be competent with your coding outline as well as commenting, now this is important, much like you don't want stutter and have bad pronunciation in your real life language when talking to other people, the same way you don't want to write bad formatted code and not comment it in it, thing is, if you follow the path of coding, chances are there will be people working with you and trying to understand your script.
Code clarity and readability is so important that the community has enforced a few procedures like Pascal capitalization and line indents that have as their main role to make the code more readable, those obviously apply to most languages.

- The Physical Part

Not many people mention that, but I think its important, you need to learn how to fast, not to fast, but fast enough so you don't have to waste your time typing and making mistakes, this doesn't have have to do with your actual typing speed, it also has to do with doing less typos memorizing skills and thinking well what you are about to write and how you are going to write it, so you wont have to go back and correct it, believe me, programmers really hate going back and correcting stuff.
Also staying up on a monitor for hours is not as easy as it sounds, especially when its your work and you are kinda forced to do so.


- Reading the docs and looking for recourses

All languages home some development docs, some are better than others and some are completely shitty web1 apis *cough* Oracle *cough*, in any case, reading the docs and learning how to do so is very important on your course of learning how to program.

You also need to be familiar with searching up your issues online, and finding solutions as well as other recourses that can help you out, for example, w3schools is a nice place for with a lot of recourses for web centric technologies, stack overflow is a great platform for making questions or finding answered questions, GitHub is a nice place to find sample code that you can study and the list goes on.

- Getting to know your IDE

Chances are you will be writing your code in some IDE, or some lightweight code editor like vs.code, learning how it works and all the things it can do like auto complete, snippet management and so on can make your life a lot more easier.


Now lets get into the stuff that make you an actual programmer/developer and not just a guy that writes things on an editor, those are the fundamental of programming and Software engineering and.. surprise surprise, they have nothing to do with a specific language, as I said I am an engineer but that doesn't mean a simple programmer shouldn't know the things i am about to list.

- The Math

Lots of things about programming is about math, many people don't really understand that and I even met people laughing at me for saying it, but the cold truth has to be said, if you wanna be that guy getting paid 6 figures you have to know how algorithms work, you really need to know what algorithmic complexity is, how to make tour algorithms more efficient and get that procedural and mathematical way of thinking in you, this is not just about making some loops going faster, its about managing big data structures and other forms of data, its about running netcode, managing threads, doing byte operations and so... so much more.


- More Math

I am just reinstating the importance of math here, just to show you how important math is, consider that in the about 50% or more of the theory classes on a high level engineering and programming schools the subject is structured around math, from logical programming, to Data Structures and Algorithmic Complexity chances are your theory class is mostly centered around math, this is done to achieve a separation from the language you are using on your lab class and ensure you are learning how to talk computer and not just write code.
As a result, on high quality schools you will also get tons of pure math classes to support the math applied the the IT related subjects use, for example discrete math and Boolean algebra is directly affiliated with the logical side of programming while and algorithms are interconnected with linear algebra, call back functions and so on, well in fact, looking back to my first 3 years in school I think I had just as many Math related subjects as IT related ones.

- Work Ethic

I know the internet is there and it is so easy to just procrastinate, but this is the nature of your job and you better teach your self how set boundaries, this is a point where I think school plays a major role in, with all those deadlines and grades they plant a work ethic in you.
They make you more competed on your responsibilities and most importantly of all they teach you how to work on a team, working on student teams through group projects is how they prepare you in for a industry where most things happen in a team of developers, developers that organize work between them and plan their priorities along with each other.


- The Greater Picture

Information technology is a complex field, it has so many divisions and fields, a guy that does AI and data mining in python has so many differences with a guy that writes device drivers on c, and the reality is, that most modern applications require you to have knowledge in different things, that's why people in our field work on teams, for example in a team of developers some guys do the front end some guys do the back end, some guys focus on user experience and some others do the planning, thing is though, that the industry is constantly moving towards people that know more stuff about multiple technologies, to give you an and idea. Facebook recently announced that they will only be hiring full stack developers, full stack developers are guys that have a wide knowledge of the developing chain, from data science all the way up to UI design, those guys have it all and usually are the orchestrators of a team thanks to their wide knowledge pool.

You also need to put things together like that if you work alone, Wanna make the a Web app ? well you gotta know a ton of stuff from databases down to computer communications and markup languages. wanna make a game, then holy moly you gonna need to know lots and lots of different things including Marketing that also applies on most things IT but on games especially.

What I'm trying to say is that, developing will inevitably come down to the use of multiple things and the knowledge on how to synthesize them together in order to achieve your goal.

- I could really go the long mile and write a ton more but I don't think anyone wiil read this much and it will go wasted, so imma just wrap it up for now

Now, I hope I gave you a lot more questions other than just the "should i be learning the X language on the X framework"

But if I was to to pick one language for you, I would pick C/C++ preferably backed by visual studio(its free, avoid the visual C++ at first ) on a computer that is not raspberry pi, I have nothing against it, but its a hobby device(its a laughable single board computer in the automation industry), if you wanna start solidly start where the users are in.

The reason why I think c is the best starting language, is firstly because the vast majority of academic institutions that respect their self's teach c as their first language to their students.

Simply because, C is has a strict syntax, it teaches the learner how to be competent writer, you just put the semicolon and if you don't your program doesn't work, you null your variables before using or chances are they will be filled with garbage c does not forgive, it also doesn't have them fancy things the other languages have, when you write on c you do the garbage collection your self and you are learning why freeing up recourses is important when in higher level languages garbage collectors do the job for you, also if you wanna do some kind of data management system, you better know how implement your own search algorithms, your own data structure, your own insertion, and so on, in languages like c# and java there a plethora of things like array lists, dictionaries and so on that do the job for you, you never get the chance of seeing how they actually work.

Keep in mind that starting on C doesn't mean you get stuck there, in fact, you move on, and that's the best part, once you are hardened by it the rest of the languages will look like easier versions of C.
just a bunch of loosely typed languages that come pre built with goodies that make your life easier, from my experience and to give you an idea, I came across python on my third year and it took me less than one week to learn it, it was that easy, simple because, its no thing since in knew C but also because i gaining proficiency on all those things I listed in the beginning .


Now on the most important question that I think you should be asking your self instead:

Do you go to school for it or do you just study it on home through internet?

You do both, grinding your ass off on the computer chair to do stuff outside your homework, gaining experience on how the industry works and generally doing work alone is just as
important as the school stuff, but that doesn't mean school is unimportant, I talked about lots of things that school can teach you, if you can't do both then I assure you, you will hardly ever reach you full potential, unless your some kind of gifted person ofc.


(I am a European engineer so my English is crude )
 
Last edited:
If you've never programmed before, I'd suggest (by personal experience) is to get the theory done first. While ultimately each group of programming languages is different in what you can do with it and what you need to use to get the most of it, practically all of them have the same basic structure, even dramatically different languages like, say, BASIC, C# and JavaScript.

With that part done, you should pick a C-based language (C++, Java, C#...) as the basic syntax is very similar among them, and they make most of the popular programming languages of today, with Python and to a lesser extent Ruby and Visual Basic.NET being the only non C-based languages that can keep up in popularity.
 
Think of this as a general thread for discussion wrt coding, learning to code etc. There is technically already is a thread about coding, but the last post is from April 2014 so I think it's probably safe to post a new thread.

Anyway, I've just got a Raspberry Pi mini-computer up and running earlier today and am working through a book which gives an introduction into a load of stuff that I can do with it (sections in the book are animating with scratch, programming with python, importing modules, producing games, developing windowed apps and driving header pins). Anyway, I was wondering if anyone knows of any other useful resources for learning to code, any tips for what languages I should aim to learn (and in what order) etc.? I've worked through two of the HTML lessons on CodeAcademy already but outside of those and this book I'm a bit stumped for where to look for additional resources and such. Also, I personally am currently interested in developing applications for smartwatches. And in this situation, the article from https://www.cogniteq.com/blog/smartwatch-app-development-what-you-should-know became useful, I found a lot of useful things in it for myself.
Online learning platforms. Apart from CodeAcademy, there are several other online platforms such as Coursera, Udemy, and edX that offer courses on various programming languages and topics. You can explore courses in Python, Java, JavaScript, etc.

YouTube Tutorials: YouTube is a great resource for visual learners.

Books on programming. Books are still a valuable resource for learning to program. Look for books on programming languages for beginners, such as:

Open Source Projects. Contributing to open source projects on platforms like GitHub is a great way to gain hands-on experience and collaborate with other developers. Start by exploring projects that interest you

Coding Communities and Forums: Join coding communities and forums such as Stack Overflow, Reddit's.

Practice, practice, practice. The key to mastering programming is practice. Try creating small projects or applications to apply what you've learned. Start with simple projects and gradually increase

As for which languages to learn and in what order, it often depends on your interests and goals. Python is a great choice for beginners due to its simplicity.
 

Users Who Are Viewing This Thread (Users: 1, Guests: 0)

Top