Want to learn to code, where to start

yusuo

Well-Known Member
OP
Member
Joined
Oct 19, 2006
Messages
3,387
Trophies
1
Age
36
XP
4,841
Country
United Kingdom
Work for me is pretty quiet at the moment so I get an hour or 2 down time each day, all in all added up.

I would like to fill this time by learning to code however I'm limited to doing anything that draws alot of attention to myself, so can't read a book or watch YouTube videos, what I can do however is online course or reading websites.

Are there any resources out there that anyone would recommend and which language would be easiest to learn first, mind you the only experience I've had with coding is some VB 15 years ago.

Ideally I'm looking at going into cyber security.

Any insight appreciated.

Thanks.
 
Last edited by yusuo,

FAST6191

Techromancer
Editorial Team
Joined
Nov 21, 2005
Messages
34,338
Trophies
2
Website
trastindustries.com
XP
23,437
Country
United Kingdom
Find something you are interested in is usually a good start here. Some can lean dry text for the sake of it but they are rare. You might want to help make a game, you might want to code plugins for websites, you might want to make a file converter, you might want to port something to the raspberry pi... probably want to steer clear of the super hardcore things but that still leaves a world of stuff.

Security varies massively and will take basically any coding skill, though lower levels tend to be where the really fun stuff happens and there are more popular things than others (most websites are written in PHP or maybe ruby, C family stuff is always in demand, these days security for mobile phone "apps" is abysmal so if you can code and find holes in those then you can do well, bonus is Android's java is unlikely to be found outside business any time soon, but at the same time plenty of people have had fun in pen testing if they get poweshell access.

Easiest to learn varies as well. Typically the higher level stuff is easier to learn (learn PHP and you can probably be doing paid work making plugins for to popular wordpress website builder, and also probably keeping the security business funded for years to time, inside a month, going to be a bit longer before you are that dangerous in C but you can likely be doing things for you in a reasonably short amount of time) but it does not mean the low level stuff is insurmountable either -- people originally had to learn it before the rest followed.

Book wise I have quite enjoyed all of the apress "beginning ?" series.

I cover some more in https://gbatemp.net/threads/so-you-want-to-learn-to-program.371255/ , though one of it is a youtube video series.
 
  • Like
Reactions: yusuo

Quantumcat

Dead and alive
Member
Joined
Nov 23, 2014
Messages
15,149
Trophies
0
Location
Canberra, Australia
Website
boot9strap.com
XP
11,055
Country
Australia
I would recommend buying a university textbook, reading it, and making stuff as you go. You only learn really by doing stuff.

Make something, search through stack overflow for how to fix your errors or how to add features you had an idea for, read some more of the textbook to get more ideas about what you can do, make something else, rinse and repeat.

You can pick any language to start with really.
 
  • Like
Reactions: WD_GASTER2

WD_GASTER2

Hated by life itself.
Developer
Joined
Jun 17, 2018
Messages
779
Trophies
1
XP
1,797
Country
United States
depending on how sharp you are and willing to mess with stuff as well, you can learn by downloading android studio and looking at places like stack overflow to learn the ropes (if you have any interest in mobile). I virtually didnt know anything about that and fast forward a few years later, i can atleast make some basic apps for it. However like @Quantumcat nothing beats a good book.
 

yusuo

Well-Known Member
OP
Member
Joined
Oct 19, 2006
Messages
3,387
Trophies
1
Age
36
XP
4,841
Country
United Kingdom
Started with this, it's trying to teach me html which I'm already familiar with, so I feel this is a good place to start, if only for structure.

Need to know where to go after this, ideally want to go into pen testing, so maybe php, or c.

However would rather get my foot in the door with a company, so maybe java is the way to go first, might get lucky and they might pay for me to learn other languages in a formal setting that way.
 
Last edited by yusuo,

rrdein

Active Member
Newcomer
Joined
Apr 30, 2018
Messages
28
Trophies
0
Age
43
XP
153
Country
United States
Get an app called SoloLearn for your phone and take the Python tutorial. If you've never programmed it will take you maybe a week to get through. Read the comments on any lessons you don't fully understand. This will give you a pretty good overview of the language. Then find a more detailed course online that walks you through getting it set up on your system and running a Python script from the command line, then find some simple exercises (if they aren't part of the course) that require you to use loops/conditionals, and input/output. Then decide on something you do daily (like retrieving your messages on GBATemp), and figure out how to do that with Python. For the GBATemp thing you would need a library like Selenium or Puppeteer. Figuring a task like that out will make you (somewhat) ready for larger projects.

I recommend doing your exercises on a Raspberry Pi, Mac, or Linux Machine. If you don't have one of those then you should run a Linux VM in Oracle Virtualbox on your Windows machine. Real programmers use VMs all the time so this will be a good experience for you.

--------------------- MERGED ---------------------------

Dude don't start with HTML, you'll never get past it. I have this friend that I told to learn an actual programming language, and he just insisted on starting with HTML and never went anywhere with it. HTML is not a programming language, it's just a way of encoding a document to be viewed in a web browser.

If you want to learn pentesting you will probably need either Python (preferred; it's what 90+% of pentesters use), or maybe something similar like Ruby. PHP and C are poor choices that will take a lot of time to learn and will not help you much with your goals here. PHP is used for building websites, and C is for things like programming microchips. You want a high-level language like Python or Ruby that abstracts some of the lower-level programming functions that are included in a language like C.
 
Last edited by rrdein,
  • Like
Reactions: JoeBloggs777

PityOnU

Well-Known Member
Member
Joined
Jul 5, 2012
Messages
1,166
Trophies
0
XP
1,478
Country
United States
If you want to learn programming properly, you should start with C. The reason I say that is because C is fairly ubiquitous (supported by pretty much everything), is widely used, and is low level enough that it actually forces you to learn coding best practices and to understand things like memory spaces and allocation/deallocation. Not sure if there is a definitive guide for that out there, though. Others can weigh in.

Once you've done that, for actually getting stuff done, I would suggest either C++ or Python. Both abstract away a lot of the housekeeping required in bare C (Python a lot more so than C++) and support OOP. Bjarne Stroustrup has written some really good books for C++, which can be easily found online.
 

Coto

-
Member
Joined
Jun 4, 2010
Messages
2,791
Trophies
1
XP
2,003
Country
Chile
Heck, you could start with useful howto's from skilled devs.

Others will learn faster if reading everything backwards. Instead of starting with someting very easy, start with reverse engineering. When I was 5 I used to take apart and fix TV and radios (when you lack the "understanding", let the creative side of yours to take care of that)

But you need to separate programming in layers:

The most basic layer is to implement very basic things, such as manipulating strings (stay away from regex if you are a beginner)

The intermediate layer is to understand languages, their pro and cons (time-wise, so you pick the fastest-to-implement-a-desired-feature)

And the advanced layer is to don't care about the language, and implement the functionality you want through scientific means such as maths (such as 3D programming, Sound programming, game/physics programming, where you will need your problem solving to be very advanced)
 
Last edited by Coto,

ClassyDragon

Well-Known Member
Member
Joined
Jan 30, 2017
Messages
108
Trophies
0
Age
22
Location
ケンタッキー
XP
692
Country
United States
My university started us with C++, and I've learned some others along the way. The way I learned the most was finding projects or coming up with something I wanted to make and just trying to do that. Obviously start with simple things. Eventually you learn how to break up a large task into individual lines of code, and being able to do that is the most important thing in my opinion. Then it's just a matter of optimizing that skill by looking at how other people perform the same task.

In other words, make a goal, do your best to fulfill it, and then check how other people have done it. It makes you really flexible and translates to any programming language easily.

Obviously StackOverflow is an invaluable resource, but I also recommend just looking at the documentation/reference pages for whatever language you're learning. They include great examples of how to use a language's features.

Some of my first personal projects I worked on:
  • Dice roll / Coin flip program
  • Life counter for Magic The Gathering
  • Bitmap -> ASCII art converter
  • Tetris Game (everyone has to at least try this at some point lol)
Now I work on more complicated things but I still use a lot of the techniques I got while making those earlier projects.

Additionally, if I had to say the one specific thing that's helped me improve the most, it would probably be parsing. This refers to taking a file, such as an image, and breaking it down into it's components so your programs can use the data. It will help familiarize yourself with reading documentation and doing research for how file formats work.

Best of luck in your learning!
 
D

Deleted User

Guest
My university started us with C++, and I've learned some others along the way. The way I learned the most was finding projects or coming up with something I wanted to make and just trying to do that. Obviously start with simple things. Eventually you learn how to break up a large task into individual lines of code, and being able to do that is the most important thing in my opinion. Then it's just a matter of optimizing that skill by looking at how other people perform the same task.

In other words, make a goal, do your best to fulfill it, and then check how other people have done it. It makes you really flexible and translates to any programming language easily.

Obviously StackOverflow is an invaluable resource, but I also recommend just looking at the documentation/reference pages for whatever language you're learning. They include great examples of how to use a language's features.

Some of my first personal projects I worked on:
  • Dice roll / Coin flip program
  • Life counter for Magic The Gathering
  • Bitmap -> ASCII art converter
  • Tetris Game (everyone has to at least try this at some point lol)
Now I work on more complicated things but I still use a lot of the techniques I got while making those earlier projects.

Additionally, if I had to say the one specific thing that's helped me improve the most, it would probably be parsing. This refers to taking a file, such as an image, and breaking it down into it's components so your programs can use the data. It will help familiarize yourself with reading documentation and doing research for how file formats work.

Best of luck in your learning!

Neat I am learning C++ to code PC and 3DS games it is a very easy to learn language so it is a good choice for beginners
 

rrdein

Active Member
Newcomer
Joined
Apr 30, 2018
Messages
28
Trophies
0
Age
43
XP
153
Country
United States
The guy specifically said he wants to do pentesting, and nearly all pentesting books are written in Python.
 

AlexMCS

Human
Member
Joined
Jul 3, 2018
Messages
379
Trophies
0
Age
36
Location
Fortaleza
XP
1,609
Country
Brazil
IMHO coding is just natural. There is nothing but syntax/semantics of the languages to learn.
You give orders to the computer in a specific language, and it executes it.
It's simple as that.

Focus on learning what @rrdein mentioned: i/o (input/output), loop structures (for, while), logic gates (if... else) and finally exception handling (try... except).

What you should focus on, instead of randomly picking a language to focus, is the logic behind it.
Programming is completely based on having a good understanding of basic propositional logic.

Even more so when you go from the basics (Object-oriented/imperative structural programming) to some more niche stuff, like functional programming or logical programming.

After you master the logic (at this point, you can create your programs just fine), you should focus on optimization, that is, the study of algorithms, their complexity, time/space requirements and how to make them faster: using a "better" (in terms of execution time/memory usage or some other criteria) sequence of orders, using multiple cpu/gpu cores to execute commands in parallel (at the same time) etc..

For that end, in my opinion, there is one language at the moment that is much better suited to it than any alternatives, and it's called Python.

People mentioned C/C++ in the topic, but it's a huge waste of time trying to do in C what you can do in Python, with minimal gains for most practical purposes.
 
General chit-chat
Help Users
    KennieDaMeanie @ KennieDaMeanie: https://youtube.com/shorts/KuAlJOEGaYk?feature=share