Jump to content

How to get started with computer programming?


Pawelk198604

Recommended Posts

59 minutes ago, NeverEnoughFuel!! said:

so I began to dug and the first thing was "you need to learn linear algebra, vectors etc."... ok what's that? It turns out it's a small part of monstrosity called Calculus... ok let's dig deeper... pre-Calculus... what's that? Well it's comprised of advanced levels of three math branches, trigonometry, algebra and geometry. At this point I turned green...

Not necessary, except in specialized cases, as several posters have already said.

Just to give a little background, so you know the experience from which I'm speaking:  I've been a professional software engineer for over 20 years, working at a variety of companies from little startups up to major global corporations.  However, my background isn't computer science; I'm a physics major.  Which means I'm experienced in all those math fields you mention that make you turn green.

And I can tell you:  in over 20 years of professional software engineering, writing code for a living, I have never once had to solve an integral or a differential equation (even though I can).  It just doesn't come up.  Most of my job experience has required barely any formal math at all.  (I have occasionally had use for trigonometry, but only when working on specific projects where spatial calculations were needed, which accounts for fewer than 10% of the projects I've worked on over my career.)  What's required isn't mathematical knowledge, but rather, a logical and methodical mind, a habit of extreme attention to detail, and the ability to break a complex problem down into logical steps.  Those kinds of skills are often found in people with a mathematical turn of mind, but they're not inseparable.  Upper-level math skills are not a prerequisite for a successful career in this field, at all.

59 minutes ago, NeverEnoughFuel!! said:

ok, let's assume I learn all this... there are thousands of classes and libraries... how do I know what's what, and where is what? Do programmers have photographic memory? How do you "move around" (figuratively speaking) and choose what you need at the moment? Do you learn classes by hearth?

It's like anything else you work at:  the longer you spend in an area, the more you learn its ins and outs and yes, you do end up learning a lot of stuff by heart-- same as with any job.

But until you get to that point... Google is your friend.  :)  It's a combination of "find code that someone wrote that already does something similar to what you want", with "look up definitions and function references on Google".  Yes, it goes faster when you just know all the stuff and don't have to keep looking things up, but you can still make progress that way.  The longer you do it, the more stuff you know, and the more productive you become.

53 minutes ago, Steel said:

TL;DR: you absolutely DO NOT need to know vector calculus and linear algebra to program unless (a) you are doing something complex like working with 3D animation at a low level (and let's be honest, there are very few applications outside this, scientific computing and game development where you are going to need any knowledge of vectors whatsoever) and (b) you want to start writing every function you ever use yourself

^ This.

36 minutes ago, NeverEnoughFuel!! said:

but even if could find some example of this code all I can do is stare at it like an idiot... because I don't know calculus and linear algebra and I don't understand what this or that line of code is doing... so I'm in a closed loop... 

Right.  So that particular job may not be for you.  Yet.

Bear in mind that computer programming is like any field of endeavor.  You have to crawl before you can walk, and you have to walk before you can run.  If you're starting from absolute scratch, then of course it's effectively going to be Sanskrit to you if you look at the output of a seasoned professional who has specific domain knowledge in the particular field to which the code applies.

You have to start with the basics.  There's no short-cut.  What you should be looking at is "Hello world" programs, and build up from there.

Here's a secret about software engineering jobs:  There are two kinds of knowledge that are both needed in order to be able to do any particular job:

  1. Programming fundamentals.  The basics of how a computer program is structured, how to break things into functions, an idea of what kinds of data structures are good for what kinds of situations and why, that sort of thing.
  2. Domain-specific knowledge for the particular problem space that a given job is concerned with (e.g. gaming?  modeling software?  network programming?  Android programming to write phone apps?  web server?  etc.)

You'll need both #1 and #2, eventually.  But #1 has to come before #2 ... and it's also a lot more portable.  You'll need to learn #1 just once... but you'll need to re-learn #2 every time you switch jobs.  If you're looking at the output of a polished professional, your eyeballs are going to get snowed under so much of looking at #2 that it will be intimidating and unhelpful... and obscure the really important part, which is #1.

So just start simple, and treat it as a fun hobby.  Teach yourself whatever is easiest to futz around in.  It could be python, if you like.  Or you could teach yourself C#; it's an easy language, and Visual Studio is free, and you can use it to learn to write KSP mods.  :)  Or you could teach yourself Java, also easy, very marketable (lots and lots of companies do all their coding in Java), also free to get a programming environment for.

Doing it that way takes all the pressure off.  It will also allow you to discover about yourself:  do you actually enjoy this stuff, or is it like pulling teeth and you can't stand it?  If you find that you like it, then you'll automatically want to learn more and more, and eventually your hobby-level learning will accumulate to the point that you actually become marketable.

Heck, it worked for me.  :)

24 minutes ago, nathan1 said:

But the most important part isn't which language you choose or how technical your book is; the most important thing is whether it keeps your interest. You can always switch languages more easily than learning how to program in the first place.

^ This!

Link to comment
Share on other sites

Her'e the thing. If you ask 10 people what is the best programming language to learn, you'll get a list of 10 languages. :D

The question you have to ask your self is not what language you can learn, but what thing you want to learn to do. After all, a language is a tool, you learn it in order to do something you want, not the other way around. Don't go learn a language and then find something to do with it, motivation is paramount when learning anything, and having an actual thing you want to build helps a lot. You learn as you go.

Also, don't try to build a super Skynet as your first project... Start with small things, usually not very useful, not very "brag-able", but if you start with something big you'll just fail. We have to learn to walk before you learn to run.

This is all IMO of course... and now there's going to be 9 people come tell you I'm wrong!

Link to comment
Share on other sites

On 08/11/2016 at 4:47 PM, Pawelk198604 said:

Is the age of 30 I'm too old for this?

Most definitely not. Kids will naturally pick coding up fast (frighteningly fast), but the main thing is if you want to learn, then you'll be able to. And coding is it's a constant learning process, while there are core concepts that remain constant a lot of the higher level stuff changes quite rapidly so you have to keep learning.

The best thing is to have a reason to write some code, just trudging through tutorials can be painful and tedious (although useful and a good place to start) the real learning curve happens when you're really trying to achieve something in particular.

Python is an good language to start on.  Python is "loosely typed", aka it's less fussy, which I think frees you up to focus on the more interesting aspects. C# is strongly typed and therefore requires you to be more particular.  One is not better than the other, just different, and getting to grips with both is a good idea, but starting off on a loosely typed lang is probably more accessible. 
If you'd not already picked on Python I would have suggested Ruby, it has a lot of similarities to Python but is even more minimal/terse (and a lot of it reads like English), but the main reason is the Ruby docs are simply fantastic as is the ruby community. 

You can definitely teach yourself (I'm mostly self taught) and there's no shortage of learning material out there....and stackoverflow will become one of your most visited websites (after the KSP forums of course). 

Link to comment
Share on other sites

2 hours ago, Pawelk198604 said:

With a little bit afraid because I have bad memories of math class at school and lesson of programming in Turbo Pascal programming language   in Gimnazjum (midle school) :(

But I always wanted to learn to program, now feels like Dr. Strange, when he volunteered with the desire to learn from the masters in Kathmandu :D

I bought a book that was indeed quite expensive as for Polish standards for books market, because it cost me 70 or Polish Zloty about  $17.73

 

http://ksiegarnia.pwn.pl/Python-dla-dzieci,114592565,p.html

https://www.nostarch.com/pythonforkids

 

 

There's a lot of online material available as well. I can highly recommend to install Python through a package. There's nothing wrong with downloading a bare installation from python.org, but packages like Anaconda and WinPython (the latter is Windows-only, I use it and I'm very happy with it) offer a full suite with practically every (scientific) library you can imagine. Which is not very useful at first, but at one point you want to do more complex things. Maybe create a PDF file as output. These scientific packages contain every single library you could possibly imagine so you're not wasting time figuring out how to get "matplotlib" to work (although a "pip install" in Python usually does the trick and is really, really easy).

GBmh188.png

The arrival times of my son's school bus. I run a Python script on my iPad that records the arrival time and then plots a control chart for me. This way I can optimize the time we're outside, waiting for the bus to arrive (winters in New Jersey can get quite cold)

There are many tutorials about Python you can find online. Code Academy has a tutorial, and there's a learn python site. I don't know how good they are but it never hurts to try them out. I even found a Python 101 on the PyVideo website although it's likely to be a bit information dense (one of the nice things about Python is that there is a large community out there that is very fanatical about advocating Python).

But most important, get your hands dirty and start writing software! :) Are you playing KSP through Steam? Start with a script that copies yours Steam installation over to a folder in, say, "My Documents." Ooh, wait, you don't want the "steam specific" files. So exclude those. And actually, wipe out the destination folder before copying over, so you get a clean install. Well, wipe out everything except your gamesaves and gamedata of course. Except for the Squad folder in Gamedata. And so on.

In the end you'll have a script that quickly makes a fresh copy of KSP but retains your saved games and mods and applies your preferred settings to the game's config file (bonus! :) ). That's what I did at least and it served me well when 1.2 was rolled out. It's just an example of something relatively simple to start with, but at the same time it teaches you about adding all those extra conditions that can make things a lot more complex than you'd initially thought (experienced programmers are usually a lot more pessimistic about timelines than new ones).

 

 

Edited by Kerbart
Link to comment
Share on other sites

7 hours ago, NeverEnoughFuel!! said:

Well, let me be a Devils advocate... I tried to learn programming many times, same as quitting smoking... the easiest thing to do... I've done it a thousand times as Mark Twain used to say... I always I mean always hit the same wall writing functions ...  everything else is pretty reasonable... variables, operators, lists, reserved words, objects, classes, inheritance etc. etc. I'm talking from the perspective of someone who's for a long time in the world of 3D animation but also is an anti-talent for math in general... so I began to dug and the first thing was "you need to learn linear algebra, vectors etc."... ok what's that? It turns out it's a small part of monstrosity called Calculus... ok let's dig deeper... pre-Calculus... what's that? Well it's comprised of advanced levels of three math branches, trigonometry, algebra and geometry. At this point I turned green... ok, let's assume I learn all this... there are thousands of classes and libraries... how do I know what's what, and where is what? Do programmers have photographic memory? How do you "move around" (figuratively speaking) and choose what you need at the moment? Do you learn classes by hearth? These were and still are the questions which are bothering me... so IMHO without math there is no programming...     

ive learned a lot about maths through programming. i learned that i knew how to use calculus before i actually knew there was a name for what i was doing. if you learn about vectors and vector operations, which are pretty straight forward, and some way to change frames of reference (linear algebra, matrices, quaternions, and any trig you need to figure out angles), you already have enough knowledge to do some level of game programming. id have never learned about this kind of math had i not dove headfirst into programming. the cool thing about programming is you dont need to understand the equation, it helps to figure out bugs but you generally just implement it in code and it does exactly what it says on the tin. of course later as the bugs seep in you start to study up on them more and gain a better understanding.

when i started i was told programmers did need really good memory, which is why i never made a career out of it. once my code gets of a certain size i can no longer keep it all in my head and either loose interest or get discouraged. getting to where you need to work with other programmers, or shared code bases. things get hard fast.

most of the rest of that is just picked up through experience. programmers just end up building a list of essential libs that they go to for specific problems. i had a good experience with sdl, so its the first go to when i need access to video, audio and input resources. someone may have had a good experience with directx and use it every time. my personal opinion about libraries is use as few as possible, then you understand your code better. but in many cases its a neccisary evil (like windows.h, or anything that accesses black box hardware or proprietary closed source software blobs that you are always going to run into).

Link to comment
Share on other sites

I've got to second what others have said: find a project first that interests you. This will dictate the tool (language) you need to learn. You will learn what you need to solve the problem, but if you don't have a problem to solve you'll get bored and quit.

For instance, I've had training in F77 and C, and tried to learn C++. But I never really use it. Why not? Because I have no reason to, and thus no motivation.. But I do use Excel for engineering at work, so I can write VBA all day without breaking a sweat, even though I've had no formal - or really even informal - training.

If you don't have a project for yourself, look to the FOSS community. There are thousands of program projects out there from simple text games to commercial-quality media editors to the very programs that run the backbone of the Internet. And they all have bugs. Lots of bugs. Many of which would be beyond a beginner's ability to fix. But not all. Some of it is just annoying little misbehaviors that just need someone to go and fix. Not very glorious, but you get to see a lot if code that [mostly] works so you can begin to understand programs that actually do something. Also, as Edison said, "success is one percent inspiration and 99 percent perspiration," and that's true in coding as well. Be willing to be the perspiration guy, and not only will you learn a lot, people will notice, too.

Link to comment
Share on other sites

33 minutes ago, Nuke said:

when i started i was told programmers did need really good memory, which is why i never made a career out of it. once my code gets of a certain size i can no longer keep it all in my head and either loose interest or get discouraged.

Nonsense. If you have better memory, it will merely take a little while longer before same thing happens. You just learn to split problems into smaller units that can be solved separately. 
 

Link to comment
Share on other sites

1 hour ago, Nuke said:

when i started i was told programmers did need really good memory

Nobody has asynchronous tree-like memory to keep in mind whole program. Especially when its sources are 20 MB of pure code and crreated by several people..

90% of programmer's work is reproducing his earlier sources and adapting 3rd party sources. A developer should also have abstract thinking and imagination to more or less imagine what exactly he/she creates.

 

Math is required only if you are programming maths. The same with 1001 sorting algorithms.

Edited by kerbiloid
Link to comment
Share on other sites

I think everything has already been said, but I will add a few tips anyways:

- Start with scripts that are linear and and handle small tasks.Then go on until you feel frustrated and want bigger problems. Object oriented kind of coding (like Java) should come second. 

- Never assume you have mastered something. There is always a angle from which you have not look your code ( security, performance ...)

- VBA is underrated and being able to produce macros for excel is a powerfull competence if you work in a desk environment.

https://www.codingame.com/start not a place to actually learn to code. but you find challenge to gradually test your skills in a manner that will keep you interested and motivated...

 

Edited by Chabadarl
Link to comment
Share on other sites

And first of all decide for youself: is your aim to develop web pages, office applications, command line programs for science or for sysadmining, games or something else.
As different cases mean different tools and languages. Even operating systems.

2 hours ago, Chabadarl said:

VBA is underrated and being able to produce macros for excel is a powerfull competence if you work in a desk environment.

If you want to create visual applications for office usage, indeed VBA (with ActiveX) is your bro. You can easily interact with MS Office (and if you want, with OpenOffice) from your program, making users happy.
But this doesn't mean you must study VisualBasic. You can/should press "Record macro", manually do everything you need, then "Edit macro" and steal what you see there, but in your language. Of course, this is about Windows.

Btw, afaik python has a port of very handy Qt framework.

Edited by kerbiloid
Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...