How do people use examples?

There had been some discussion in the topic

about learning to program.
I think people approach this in various ways. I may be the odd one out here, so let me tell you what I do , and lets see if others differ

I never try to learn from examples… neither doing them nor reading them .
When I first started to need to program, I read the manual once, then sat down and wrote code. When I had a slab of code that I thought would work, I compiled it… it did not work of course… then the learning started… how to debug, why does this loop never exit?, what is floating point overflow?, what is an undefined reference.?
Eventually I got something elementary to compile and run. Then I built on it, one subroutine at a time. Cant see how to do something?.. now is the time to look at code examples… you can learn for other peoples code when you have a specific need.
I have always done it that way. Never do exercises… never do a course… never look at a tutorial. … do the real thing… then seek help when you crash.

Now the question… How do others do it? Am I an odd man out?.. …Is there a right way to learn to program?

I know maths and physics are taught with examples… I hated it… only really learnt maths when I came to use it for real world problems. . Sure you need to have algebra drummed into you before you can use it, but does that apply to programming?
I think not. You might disagree.

4 Likes

Hi Neville, :wave:

Interesting question.

As far as I can remember, when learning how to do bash-scripting I consulted 2 sources:

From (1) I took notes so that I had a quick reference guide when need.
And often enough I have a look at (2) because it gives a concise overview of what I need.

Of course there are examples included in both sources.
I take a look at examples in (2) whenever something is unclear to me.
But generally I don´t copy and execute them.

As soon as I´m confident in using the commands/syntax I turn to my own project and do it like you:

I thinks that´s the wisest approach. :blush:
You may learn more effectively his way.

Many greetings from Rosika :slightly_smiling_face:

5 Likes

Hi Rosika,
Hey it looks like I have one supporter.
Really, one can learn the syntax and keywords of a small language like C or Pascal or shell script in about half an hour. The rest is practice and learning from mistakes.

Putting code together is a creative activity like writing. You dont learn it any more than you would learn to write poetry. You drag it out of your self.
There are technical tricks acquire, yes, but that is a side issue.

That is why someone with language skills, like @Rosika , is more likely to be a good programmer than some high powered maths graduate who has done all the examples.

Regards
Neville

4 Likes

Hi Neville, :wave:

thanks for the feedback. :heart:

… if it weren´t for loss of memory, I might add. :laughing:

My memory used to be better in my younger days.
Seems I´m prone to forgetting certain things when not using them daily or at least on a regular bsis. Oh well…

Yes, you´re right, Neville. That certainly is the key part.

That´s a very nice compliment indeed. I´m not sure I deserve it though. :blush:

The thing is: I don´t write code every day.
I just turn to things like that when the need arises, like when I needed an administration script for my web-stick.
Mind you, I needed a few afternoons to get everything right at the time. I was a bash-scripting noob back then but I´m not sure I´d be able to be much quicker today.

Cheers from Rosika :slightly_smiling_face:

3 Likes

Dont worry about forgetfulness. We all have it.
I have spent 4 days trying to get back to where I was with some R code I wrote a year ago. Not there yet.

4 Likes

Hi Neville, :wave:

Thanks for the heads-up.

I guess R is not as easy to learn and to remember (if not applied daily) as bash-scripting.
I tip my hat to you for dealing with R at all. :+1:

Thanks also for the link. I read through the article and it seems interesting indeed.

The researchers found that language aptitude, memory and reasoning play a bigger role in predicting how well someone will pick up a computer language — not how savvy they are with numbers.

That´s good to know. There might still some hope left for me. :wink:

I noticed the author referred to python as an example for the studies.
In fact I tried to deal with python a few years ago but gave up after a few lessons. Not sure why. Perhaps I didn´t have sources at my disposal that worked well for me.

The article also mentioned codeacademy. Perhaps this one would work out better for me. I took a look at pricing:

The Basic Plan is “Always free”, it seems. Perhaps this one might be worth considering … :thinking:

Thanks for the info, Neville. :heart:

Many greetings from Rosika :slightly_smiling_face:

3 Likes

Neville and Rosika: I’m impressed with your capabilities and success. I have never experienced them (learn syntax in half an hour? incredible!) but I did find a similar process: repetition.

FunOS uses a library of ‘sudo apt…’ scripts instead of a GUI package manager and by using this, I find I’m using CLI in all of the distros I try. Just the necessity to use the terminal in one distro has, through repetition, enabled me to use the terminal in everything. I need to install Fedora again, so I can feel my way through using ‘dnf’ instead of ‘apt.’

It’s a small success, nothing like what you two can do, but every little accomplishment convinces me that my 77-year-old brain is still functioning!

Cheers!

5 Likes

@berninghausen :

Hi Bill, :wave:

thanks for your feedback and comments.
You´re too kind. :heart:

Thanks a lot. To tell the truth however: I´m nothing in comparison to Neville.
In fact I see myself rather as a beginner - even after all these years. :blush:

Yes, you´re right. It would certainly take me more than half an hour to learn the syntax of any programming language. And I would have forgotten most of it in no time.
But Neville is another calibre. I believe him capable of everything. :+1:

Never heard of FunOS before. Thanks for mentioning it.
I found it here and here.

Pretty much the same with me.
Although most things can be achieved via GUI applications there are others that rely on the terminal, like alpine e-mail client or a CLI-based app for using disposable e-mail addresses, and much more.

I particularly like terminal-based browsers, like lynx or w3m.

I think it´s rather a big success. You´re too modest, Bill. :heart:

Thanks so much for your post.

Many greetings from Rosika :slightly_smiling_face:

4 Likes

Personally watching YT videos tor coding tutorials since 6th grade. I still think it’s the best way to learn. And the best part is that it’s free.

The usual pattern which they follow is just tell the syntax and do examples.
Similar is done in my coaching for Physics, Chemistry and Mathematics.
We learn a concept, and then apply it in the questions. Although the examples/questions should be in the ascending order of difficulty, not like solving Jee advanced qs just after learning the concept.

So personally I love learning through examples. Although I still like to note down a basic or a fundamental procedure for solving a problem, whether its a coding qs or a JEE qs.

Also , the channel which I am recently watching is Apna College for DSA and C++.
Although according to me freeCodeCamp is like the king of coding tutorials. They drop like 10 hr tutorials weekly!

Cheers!

3 Likes

You have hit on it Bill. The key word is ‘necessity’. Its all about motivation to get going. The real learning bit happens automatically once you start.
Well done.

4 Likes

Follow the link to the FunOS site, select the Documentation tab, and scroll down until you see the installation choices. Each one leads you to an apt script that can be easily copied and pasted into a terminal. It’s one of the most innovative things I’ve seen in the last 10 years.

Don’t forget to use shift-paste [Ctrl+Shift+V]!

Cheers

4 Likes

Hi Bill, :wave:

I tried it.
I see what you mean. The respective commands can easily be copied by clicking on “Copy Code”. That´s great. It´s certainly a big help, especially for beginners. :+1:

Thanks for the explanation.

Many greetings from Rosika :slightly_smiling_face:

4 Likes

So you are different. You treat programming like an academic subject… learn all the rules and practice on small problems.

I had to look up JEE… some sort of exam. Yes you can pass exams by learning rules and repeating examples.

We may have a generational difference here, or it may be that once you finish with the education system, you may swing back to the way I described? That is what happened to me . Once I got through my education, I rebelled and did it my way.

4 Likes

Maybe due to the Bharatiya Education System…
But as you said maybe it’ll change…

Although I do bigger problems once I complete a specific part of the language…

3 Likes

Hi Rosika,
Think again.
Most languages have

  • variables , maybe several types of variable
  • replacement statements
  • control statements… loops, if
  • declarations about variable types (some omit that)
  • structure …functions or procedures or subroutines

That is about all there is to learn. Maybe a dozen keywords to learn ( a very small vocabulary)
and a simple rigid syntax (grammar). You could write it all on a one page cheat sheet.
Everything else is experience and talent.

Dont bother with courses. Find a project you love, and practice.

Regards
Neville

3 Likes

Hi Neville, :wave:

thanks a lot for the heads-up. :heart:

The way you describe it makes it sound easy, but you can look back on a wealth of experience.
That´s probably something not everyone has access to.

But of course you´re right.
Thanks for providing an excellent enumeration of what´s important in any programming language.

Expereience and practice are key points. I very much agree with you.

Thanks again, Neville. :heart:

Cheers from Rosika :slightly_smiling_face:

3 Likes

Not necessarily. I am interested in how people learn. I dont want to push my ideas unless someone finds them helpful.
Someone said to me once
“You march to a different drum”
I did not hurt, I liked it.

3 Likes

Think this is a question of debate by many education establishment and scolaires. There is no right way, there is no answer… everyone learns differently in different situations and with different tools.

I worked in education post 16. Got the job at my first place as I was knowledgeable in computing and that was the requirement to teach others, been in operations, programming before qualifications were really around. I then moved to teach in university having gained a degree in computing, 5 years teaching and many industry standard certificates, lotus, microsoft etc… the the uni decided we all had to have a teaching qualification, no problem, 6 months day release in house then the exam.

I failed the practical, because I had to write a lesson plan for a course to teach excel, sat down wrote it, learning objectives, examples, teaching points all text book stuff.

Examiner sat at the back of the room, students came in, so started but it became very clear they were well in advance of the requested lesson. So I changed tack pushed the plan to one side and shifted gear to suit the students. They did not need to draw graphs and add columns of numbers as requested by the company that sent them, they wanted lookup tables, whatif, 3 dimension calculations, multi sheet and then afternoon on macros. Yes I was capable of answering and doing the requested stuff, but of course the lesson plan was not used !

My examiner failed me because I did not stick to the lesson planned. I changed and adapted to the student requirements.

I had to go through it again with a different examiner, who watched for 10 mins then passed me with highly commended grade because I could adapt to student knowledge and requirments.

So yes I am a qualified teacher, but also very good on excel and spreadsheets, but the main point is students learn at different rates with different stimulating ideas, there is no right or wrong answer to learning.

My wife uses on line leasning for languages, I cannot stand them.

As for teaching or learning programming I prefer little steps and little parts, that build to a bigger picture. So for example I may write a error checking program for data input, choose a number between 1 and 9 no 0 and no letters. Then write the same for just letters, then write one for just capitals, or just sentence case… then use that in a bigger program to ask for name, age, address, postcode etc. Using my error checking for each input.

3 Likes

So it is a pointless question… people use examples in any way that suits their learning practices.

3 Likes

I learned to code Cobol and Assembler in classes at a Jr College. So I learned in a structured way thru the teacher and completing the class assignments. Later when I was hired as a Programmer Trainee, I received a lot of “OJT” (On the Job Training).

I can fondly remember learning how to code a sequence update of a master file creating a new (updated) master file., What if the master file reached the end of file (EOF) before the transaction or if the transactions ended before the master file?
Learning about subscription thru a table of values or an table array (2 dimensional). And if I remember correctly, we even had 3 dimensional arrays.

Work back in those early was a lot of fun because you were also learning.

4 Likes