T Nation

Teaching Oneself to Code

Have any of you done it? How long do you think it would take for someone with above-average cognitive ability depending on time invested?

What language … I had a brief introduction to SQL, Python and r but learned (an learning) through applications directly related to real world projects

There is a wealth of information available for no to low cost to learn w/e language you’re thinking about investing time in to learn. As someone with intermediate coding ability, I’d recommend at the very least know what you want to accomplish (i.e what problem do you want your code to solve our be applied to) and figure out what code is best for that particular application.

Or conversely, what language (s) you want to learn and to what they’re best suited and go that route … I have found, for me, the best combination to learn is a bit if theory and then work to figure out how best to apply it to the problem if that makes sense…

I’m sure there are more seasoned programmers/developers in here who might give you a better answer … but in terms of where I’m at and how I’ve learned what I have, it was through trial and error and lots of googling

Edit: as for how long it depends how much time you can devote to any particular project or to whatever path you take to learn … you seem like a resilient guy and I’m sure you can learn whatever code you set out for … keep I’m mind it’s a bit like learning music or another language

1 Like

Coding is basically math.

If you’re good at math, then you’ll probably be able to pick up the concepts behind coding quickly.

Most of the popular languages today have books and guides/resources online that provide extensive amounts of information. Not too hard to pick up if you really want to.

1 Like

why do you want to do it? what’s the goal?

it is a young persons game. I just recently learnt it, even though I’ve been in and out of it for years and years.

from what I can gather they only hire coders that are actually really amazing with no education, or people that have computer science degrees.

it always angered me that I didn’t get into it sooner, like in my teens or early 20s when I actually still had the time. I wanted to do it, I still don’t know why I never did.

funny story- a guy got recently fired from our place. he had been there 12 years, he coded a very specific thing for the company, he slept half the fucking day, no joke. true story, he SLEPT half the day, at his desk. this has been his job for the last 12 years but then they somehow automated his job and they booted him.

he was so shit at programming that they didn’t even attempt to move him to another position, they just fired him… so yeah since he got into it so long ago before there were decent programmers in abundance he got to stay in a nice cozy job for over a decade lol

Depends on what language you click with. I still cannot get comfortable with C or C++. Too archaic for me personally.

Python took me about a full semester to fully understand (4-5 months). It’s very user friendly too.

Rust is good if you want top notch speed. Vaguely reminds me of SQL and Python.

JuliaBox is relatively new of all the languages, has all the original stuff of C++, and all the newer and more streamline stuff of Python and R.

Scala is personally my favorite and it’s quite popular amongst the various languages to learn. It’s less buggy than JuliaBox, but I like Julia for the built in packages.

If you’re all about plotting and calculus with a lot differentiation and algorithms go with MATLAB.

I like R too, but I reminds me of Python, and upon messing around in it whatever I can do in Python I can do in R as well. Same with SQL. If you understand Python, you’ll understand SQL.

Java is, in my opinion, the easiest among the languages other than HTML/website script stuff.

I’d suggest just starting out with Python. Get all your variables, functions, and loops down pat. Everything else just becomes what you make of it. Tinker with stuff, try new stuff, etc.

If you’re wanting to get into machine learning, optimization, or deep learning I’d eventually get comfortable with JuliaBox.

I didn’t teach myself, per say, but I did have to do a lot of research and practice on my own quite a bit. Linux, Perl, R, Scala, Java, Python, and SQL are among the tier languages that a lot of businesses look for or notice. In case you were thinking about presenting anything in the future.

There’s a lot more programs out there, so I’d say just take your pick. The ones you like most will stick out to you. Good luck in your endeavors!

1 Like

This depends on your intended level of proficiency.

Is the goal to just have something productive to do at the computer, then that is one thing. If it’s to land any programming job, another. And if you are aiming to work at a company with a name that 90% of people recognize, another entirely.

I’ve tutored programming at the university, and while most students will be able to grok it there are those that never do. Do not let that statement dishearten you though, I mention it simply because I’m not convinced that everyone should learn to code (which is a popular opinion today) as I’m just not confident it’s an enriching activity for all.

It’s kind of like how some people can squat 315 pounds without too much trouble and some people have to start with the bar.

Let how fun you think programming is determine whether or not it is for you. Even if you struggle, if you are having fun then keep at it.

The difference between “knowing how to program” and writing (good) code that is habitable and maintainable for years is about as far separated as knowing how to use a saw and being able to produce this 11-inch master-piece,

But if you share why you are looking to get into it, then maybe I can give a more concrete answer.

Whether or not I’m the right person to ask, maybe. I think a lot about teaching programming and making it accessible to others and am not half-bad at it myself, but there are definitely people that are far better at it than I. Adept at it enough to have worked as a software engineer at one of the MAAN-companies (Microsoft, Apple, Amazon, Netflix), and another globally known company just shy of a Fortune 500-listing. And then there is the university, and an R&D-job at a uni-spin-off too.

2 Likes

I agree with this.

I know how to manipulate and edit several languages (Cadence SKILL/Mentor Graphics scripts/Python) that are directly relevant to what I do at work.

But I cannot write them from scratch. I lack the training and the proper understanding to even attempt this.

It’s one thing to understand what you’re reading enough to tinker with it a bit, and another thing entirely to create new and interesting stuff from scratch with it.

Indeed, curiously the way languages are picked up changes tremendously after the first two I’d say. Once you have the lingo in place, you can pick up essentially any other language within the same paradigm and only really have to go through a genuine new learning experience if picking something up from a paradigm your previously unaccustomed to (this is not a paragraph you have to care about just yet @BrickHead)

I’d say this is premature as it makes it too easy to bite off way more than you can chew and if you end up trying to build something too far outside of your level you are doing the equivalent of ego-lifting. Start small, and iterate on that. Depending on the kind of programming you are keen on getting into, what these projects are changes. Meaning, if you are looking to get into graphics programming for instance, here’s a couple of projects,

  1. Draw a triangle
  2. Draw a square
  3. Draw any shape given a set of points
  4. Repeat 3, and move the shape around on screen.
  5. Repeat 4, let the user control the shape.
  6. Repeat 5, and let the computer control the shape until the user takes command.
  7. Repeat 6, add a rewind functionality
  8. Do something else now.

By starting over with a blank slate each time, you aren’t falling over your previous mistakes, you are able to improve on your design, see what are the things that you need to do every time, and so forth.

This is a perfectly acceptable way to learn (and work), it’s something I myself do even to this day, but I’ll add to it this: if you do not understand what the code you wrote does but it just works then you are not “done” until you understand it. I’ve graded too many submissions where it was obvious that the student had produced code that solved the problem, but it’s how some lifters squat by essentially doing a good morning to get the weight up and so I had them redo it - even though it “worked”.

3 Likes

Again, I’d say we are back at defining expectations. You are not wrong, but just by knowing “math” does not mean you’ll produce quality software.

Math is more a means of leap-frogging ahead, as you’ll have familiarity with some concepts and that’ll give you a framework to understand this new thing you are working with. Besides basic arithmetic operators, I’d say that having a firm understanding of mathematical functions will help with learning how to program. If you picked up recursive functions beforehand, that’ll also help a ton.

But if you really want to get programming, then you need to understand the call-stack as well and math does not really have anything akin to that (except that is how recursion might have been explained to you).

Other useful math things,

  • Geometric functions (sin, cos, …) for graphics programming,
  • Matrices for graphics programming and machine learning,
  • Calculus, again for machine learning.

If you’ve studied discrete mathematics, then you’ll have a leg up for all kinds of problems that can be modeled as graphs. Oh, and you get to understand graphs as a data-structure really easily. You also get Markov chains, which will help with Machine Learning and AI.

There are other domains too that’ll have some value, but the generality of their applicability is diminishing.

1 Like

Thanks for the replies. Is there any way anyone can, if s/he wishes, to contact me personally. You know where I’m at on IG.

1 Like

I don’t have IG, but if you have any further questions I’d be happy to try and help answer them. If you feel it’s not suitable for the forum, I reckon we can exchange emails?

1 Like

I don’t think they allow emails posted. I thank you for all the information so far!

Putting your email in your profile is the approved workaround.

@BrickHead check my profile for an email address

Oh! Thank you! I’ll do that.

By the way. Sorry for the delay. I just had my second kid two days ago and I was very busy in the few weeks preceding this.

1 Like

Hey man, no worries. I posted that 30 minutes ago. Congrats!

1 Like

Plus the issue of just getting something to do what you want vs doing it without wasting a ton of RAM/processing. That’s how I knew I didn’t want to code for a living - I enjoyed making the computers work hard on stupid stuff