Can anybody learn how to code?

Hey Everyone,

Apologies on the vague title, but it is at the core of my question - let me first elaborate a little bit here.

Just to give a brief background on myself - I have been working in the IT industry for around 4 years now. I first started working straight from college (where I did average at best as I really did not much enthusiasm at all at the time) at the age of 18. I began working on a mainframe system, picking up the basic bits and pieces and eventually worked my way over to the UNIX side. Prior to my experience at work, I had always been a bit of a geek (mostly computer games) - but in terms of technical stuff, all I had experience in was dabbling with a bit of HTML for fun.

In the past few years I have become really interested with coding, such a shell scripting, awk etc. (currently learning perl). I am seriously considering a career path down the coding route in the future. I wouldn't consider myself highly intelligent, but I do okay and believe I manage to pick things up quite well. What I have found since beginning my 'coding journey' is that there seems to be quite a distinct leap between your average shell script, some regexp and if statements here and there, which seem to be quite linear concepts, and your much more abstract codes and programs (for loops within for loops, multi-dimensional arrays, algorithms etc.).

My main question is, does one have to possess an inherently high intelligence level to move onto the next level with coding and grasp these types of 'abstract coding' concepts? Or can they be learned with enough determination? I definitely have the eagerness to learn, but I don't want feel like I'm going down a route where I may hit a wall (i.e. Grasp certain concepts) and not be able to progress.

Sorry if my question is poorly worded, I hope some people might be able to relate to this and offer some advice :).

Thanks all.
pilnet101

As I see it, what programming takes is creativity, thoroughness, and the right kind of obsessive laziness... My programming journey truly began in high-school, when my biology teacher handed me an inane assignment requiring two buckets of dry beans and a blindfold. I was supposed to count out several hundred beans of each kind individually, mix them back together, randomly add and remove them in various ways to simulate "natural selection" then total up the results.

This would have required
1) actually having several hundred dry beans of two colors
2) being willing to paw at them for hours like a 2-year-old in a sandbox

A qbasic program cobbled together in 15 minutes solved it instead. That's the first time I wrote anything that actually saved me time and effort.

That's what it's really for in the end, solving problems. If you find yourself thinking "this is so boring/stupid/repetitive, why doesn't the computer do this?" maybe it should be. It's not a career choice as much as a means to an end. You may find a use for it in lots of IT work but generally, nobody's going to hire you to program awk, shell, C, or whatever -- it's a tool for whatever problem they need to solve.

Most of these computing concepts you're worried about aren't too abstract or complicated. You already know what a loop and multi-dimensional array are, I'm sure. Some things are harder to build than they should be, of course.

1 Like

IT has put lots of clerks out of work by taking the boring repetitive processes they had are replacing them with machines that do far more far quicker. All the important work they would have done (for example calculating an pension liability against investments held and their daily values) could be dismantled to a series of mind-numbing processes. These actions are then logically collected into either sequences, loops, conditions etc. If you can dismantle processes far enough and then write the lowest lever of operation in a language that the computer understands, you are a programmer.

Consider making a cup of tea. What steps would you have and what could they be further broken down to?

High level process to make a cup of tea:-

  • Add tea to pot
  • Add hot water to pot
  • Allow to brew
  • Pour from pot to cup
  • Add milk

Okay? Let's move on another layer.

Two level process to make a cup of tea:-

  • Add tea to pot
    [list]
  • Remove lid of pot
  • Use spoon to put one measure into pot
  • Use spoon to put 2nd measure into pot
    [/list]
  • Add hot water to pot
    [list]
  • Fill kettle
  • Boil kettle
  • Pour hot water from the kettle spout to the pot.
    [/list]
  • Allow to brew
    [list]
  • Lift lid
  • Wait 2 minutes
  • Mix with spoon
  • Wait 30 seconds
  • Replace lid
    [/list]
  • Pour from pot to cup
    [list]
  • Lift pot
  • Aim at cup
  • Tip over allowing liquid to transfer
  • Stop before overflowing less enough to allow for milk
    [/list]
  • Add milk
    [list]
  • Get bottle from refrigerator
  • Open bottle
  • Aim at cup
  • Tip over allowing liquid to transfer
  • Stop before overflowing
    [/list]

Right, not let's go further, and again, and ....... no perhaps let's not, but you get the picture.

At some point, you might want to cater for 50 people, i.e. 50 cups and you have a bigger pot that will make 20 cups so you have a loop where you make the pot three times, then another loop to pour and milk one cup 20 times stopping if there are either no cups left or a total of 50 have been poured.

Of course there might be exceptions to normal processing where you have a decision for some who may not want milk or those that want sugar.

It gets more and more tedious the more you analyse it, however computers are incredibly stupid. They are incredibly good at adding up and comparing plus they do not get bored so they can be given really basic stuff to do over and over again.

If you can break human processes down small enough, you are building the logic, then you just need the tools to tell the computer what to do and you are off and running. Don't be scared. Anything that is important should be safely copied away beforehand. Computers don't break real things and at worst you recover from where you started. Ever the most complex database and application should be recoverable.

Robin

1 Like

I prefer Advanced Tea Substitute, it tastes almost, but not quite, entirely unlike tea. :wink:

Programming is about problem solving, and programming well is about solving problems without repeating a lot of logic over and over. Can you get the results that you want without hard coding magic values, can someone understand what your program is doing and why? Can someone new come in and maintain the code with out just slapping on more code? You don't need to be a genius, you just need to write thoughtful well documented code that adapts to change easily.

2 Likes

Finally: be aware that "programming" isn't "programming".

There is the highly scientific number crunching: you need a solid mathematical background to even understand the algorithms involved and many times in-depth technical knowledge of the environment you program for. Applications typically needing such skills include: signal processing, simulations, graphics, realtime applications, optimization (operations research), statistics and all sorts of scientific applications.

There is the frontend-oriented business programming: you need a lot of organisatorial skills, you need to have communication skills (most customers have no idea what they want and it is your first job to clarify that with them). You will not need more math than the basic arithmetical operations, but you will have to fit into an organization, whereas the people writing the high-tech stuff can get away with being autistic (or acting that way). Knowledge about database programming is a must in this area, so picking up SQL is a good idea.

There is the hardware-oriented programming: drivers, embedded systems, all sorts of odd one-time-programmables, microcontrollers and the like. You will need a solid knowledge of Assembler (standard language in many of these cases), a well-filled algorithmic toolbox (you shouldn't need any time to think about how to compute a parity bit, for instance), but you mostly do not need that good math background you will need for scientific programming.

Finally, there is what i call "ad hoc programming": scripting, writing helpers which make daily life easier, etc.. This is mostly done in two areas: web programming (PHP, perl, ruby, Phyton, ...) and systems administration. You will not need all too much programming skills at all, but it will in turn only be part of your work: in systems administration, for instance, you write scripts besides doing your main work, which is - administrating systems!

I hope this helps.

bakunin

1 Like

I agree with corona688, rbatte1 and bakunin, coding is very simple basics things you need to improve / understand are :

  1. Logical / control flow
  2. Basic mathematics
  3. Basic logic gates and their functions
  4. Your own logic to implement task in simple way
  5. Ability to learn and work hard
  6. Develop Analytical Skills

Don't worry about syntax, if you can develop / improve above things, you can easily start coding with the help of some manual / online resources / Forums

I personally recommend people to take advantage of forums to improve their skills, problem solving ability, don't just search short time quick fix to problem, always try to analyze solution.

2 Likes

Thank you all very much for your insightful and enlightening responses! I especially enjoyed reading rbatte1's "cup of tea process" :).

1 Like

I rather enjoyed the "The Hitch-hiker's Guide to the Galaxy" reference from gandolf989 :cool:

What a very British expression from me in the UK - a bit like Mr. Dent himself. :wink:

Robin

There is an old proverb: a dedicated programmer can write FORTRAN programs in any language. ;-))

In principle you are right. To put it in theoretical terms: as long as a language is Turing-complete or Turing-equivalent it is possible to use any language for every problem. Still, most languages develop a certain "look and feel" about their specifics and it is in most cases suboptimal in the long run to try to force language As way of programming onto language B.

This reminds me of the people who go to a foreign country and try to pretend still to be living in the country they come from. Whats the point of going somewhere and then to demand that the cooking should be the same as used from at home?

bakunin

1 Like

_Speaking_ as a complete amateur I would say anyone can do simple coding.

But if you intend to learn coding then shell scripting is a good place to start as there is a utility for just about everything you would want to do.

It is easy to get into bad coding habits but seriously difficult to get out of them.

You do not need a doctorship in mathematics but a good approach to working out your logical intentions is a must.

To learn, (I started shell scripting in Jan 2013), I jumped in at the deep end with a project I was interested in.

Hitting hurdles was great especially trying to solve them, and, although I always solved them the big guns on here voluntarily provided often much better solutions of which I have been grateful.

If you show you have had a go at any piece of code and come up against a problem _we_ will help solve them, preferably giving you hints rather than actual solutions as you learn that way.

I have learnt a few languages over the years but shell scripting is now my language of choice.

Good luck...

banunkin, Do you mean the "If those foreigners don't understand, just shout louder" brigade?

Seems a bit like trying:-

echo `echo Hello!`

I never quite understand that type of traveller. A least the pronunciation of "Beer" and "Taxi" are pretty universal (although it's "Tacsi" in Wales.)

Robin (quite close to Wales)

Not exactly. What i mean is the "i want everything in a foreign land to be exactly like i am used to at home" - which begs the question "why go to a foreign land in first place". I live in Frankfurt/Main right now. At the corner there is a nice little italian restaurant i like to visit for dinner. The restaurant is run by a married couple: she - doing the service - is speaking some odd mixture of german and italian, which passes for "cute". He (the cook) is speaking no german at all. They have 3 daughters, all married to italians, they talk only in italian, they never spend their vacation anywhere else than Italy (precisely, they say "at home"), albeit already living for 25 years in Germany, etc..

I couldn't spend my life that way. I know not a single word of japanese, but if i would be forced to live in Japan, I'd try to speak japanese as fluently as possible. I would not dine exclusively in austrian restaurants and i would clothe myself like the japanese people do. If this includes kimonoes or something else foreign to me, then so be it.

It is the same with programming languages. For instance: of course it is possible to use C-like pointer structures in PASCAL - it is just cumbersome, inefficient and PASCAL is not really made to use memory like that. Of course it is possible to program around FORTRAN math functions (in fact i had to maintain such a program once - i still have nightmares from that) in a bid to outperform them: it is highly improbably, though, to succeed and there is a good chance to just produce tons of unreadable, unmaintainable and outright shitty code.

There are some tenets every programmer, regardless of his toolset should observe: simplicity, encapsulation, proper indentation, well-defined interfaces, .... But then, there are some innate strategies, structures, ways to deal with certain problems special to every programming language. One can argue if object orientation is a good programming paradigma or not - but if you think it is not, then you should not use Oberon or Modula 2 but stick to PASCAL, even if it is not well suited for large software projects. But I'd prefer to debug a well-written PASCAL-program over a poorly-written Oberon-program.

bakunin

Hi
for my part , i learnt a bunch of programming languages alone ....
You will need logcical concepts but a good memory too ....
I think that it's possible with a good amount of work ...but beware of the headaches !!