Personal computing discussed
Moderators: renee, SecretSquirrel, just brew it!
whm1974 wrote:I'm just wondering but what is the youngest child that you guys know of that was able to learn and understand C well enough to at least be able to write short and simple programs?
DancinJack wrote:whm1974 wrote:I'm just wondering but what is the youngest child that you guys know of that was able to learn and understand C well enough to at least be able to write short and simple programs?
First, I don't think that's something that should be measured. You can literally write a program that does barely anything, compile it, and execute it. Look at your hello world example. Second, people progress at different paces. I'm just not sure what good knowing the age of a child that can write code does for you. It just shouldn't matter to you.
whm1974 wrote:I'm just thinking that if child young as 8 can learn to do simple C programming then I should be able to do so as well, right?
Captain Ned wrote:whm1974 wrote:I'm just thinking that if child young as 8 can learn to do simple C programming then I should be able to do so as well, right?
Well, the 8YO most likely has many fewer bad habits that need to be unlearned before real learning commences.
just brew it! wrote:Ahh, OK... you're a few years older than I thought.
MOSFET wrote:just brew it! wrote:Ahh, OK... you're a few years older than I thought.
With the number of times you've seen that username over the years, how?
just brew it! wrote:MOSFET wrote:just brew it! wrote:Ahh, OK... you're a few years older than I thought.
With the number of times you've seen that username over the years, how?
He's only been here since late 2014. And hey, in any case, my memory is starting to go... getting old sucks.
Edit: In hindsight, I should've been able to guess from his forum handle.
whm1974 wrote:I wearing a light sweat jacket and shorts, ten years ago I could have gone and back in my birthday suit and not feel a thing.
just brew it! wrote:@whm1974 -
Time for your first homework assignment! Write a C program which mimics the basic (don't bother parsing the command line) behavior of the "wc" CLI tool. Read the contents of stdin until EOF, count the lines, words, and characters therein, and print the three counts to stdout. No cheating by looking at the actual wc source code, but aside from that it's "open season" (feel free to use your eBook and Google, and you can ask for hints here).
No time limit, but I'll poke at you periodically if you're not making progress.
@everyone-else -
If he asks for hints, don't give him answers, but point him at appropriate runtime library functions, or tutorials illustrating relevant code constructs.
/* This verison of the BASH command wc is written by whm1974 for */
/* user just brew it! over at the www.techreport.com forums */
/* This an assignment for whm1974. File Name is Mywc.c Not meant */
/* for replacing the command wc. DO NOT USE. It is HOMEWORK */
/* If you find a program named Mywc, DO NOT RUN. IT MAY NOT BE */
/* THIS PROGRAM! */
#include<stdio.h>
/* Beginning of Program */
int main()
{
}
/* End of Program */
just brew it! wrote:If you want to take it slow and easy, start by just counting characters. Then do lines, and finally words.
whm1974 wrote:just brew it! wrote:If you want to take it slow and easy, start by just counting characters. Then do lines, and finally words.
What do you think of my warning? I created the label so I don't forget what this is for and chances are I'm going to over document this to help me understand what I doing.
just brew it! wrote:whm1974 wrote:just brew it! wrote:If you want to take it slow and easy, start by just counting characters. Then do lines, and finally words.
What do you think of my warning? I created the label so I don't forget what this is for and chances are I'm going to over document this to help me understand what I doing.
I think the warning is unnecessary. Just put in enough comments to help you remember what you did and why.
Redocbew wrote:It's not uncommon for me to read the same documentation multiple times when looking up function parameters, return types, and whatnot. The newer I am to the language, the more frequently I look stuff up, but even with a language I know very well there's still things I don't remember. Looking stuff up is something you should expect to do every now and then.
Pancake wrote:I'm actually teaching an 8-year old how to program at the moment. It's delightful to see him "get" a new concept like event handling. No, children absolutely do not learn faster than adults. They have less experiences and learnt concepts to draw on. It's much easier for me to learn a new language (spoken or computer) because I can easily see the relationships between a new language and learnt languages. Additionally, learning a programming language isn't much in and of itself - you need a solid foundation of maths, data structures and algorithms to do useful stuff.
whm1974 wrote:Pancake wrote:I'm actually teaching an 8-year old how to program at the moment. It's delightful to see him "get" a new concept like event handling. No, children absolutely do not learn faster than adults. They have less experiences and learnt concepts to draw on. It's much easier for me to learn a new language (spoken or computer) because I can easily see the relationships between a new language and learnt languages. Additionally, learning a programming language isn't much in and of itself - you need a solid foundation of maths, data structures and algorithms to do useful stuff.
OK I'm only half right then.
whm1974 wrote:In all seriousness, I think that learning C/C++ is going to be the easy part. The math, data structures and algorithms parts I will probably struggle with for at least while, maybe even need to go back to school just to relearn the basics. Any good beginner's stuff to (re)cover these subjects?
Pancake wrote:whm1974 wrote:In all seriousness, I think that learning C/C++ is going to be the easy part. The math, data structures and algorithms parts I will probably struggle with for at least while, maybe even need to go back to school just to relearn the basics. Any good beginner's stuff to (re)cover these subjects?
C is a very unrewarding way to learn about programming. I don't know why you insist on learning it first. It absolutely isn't for beginners. You want to pick up something that teaches you variables and assignments, control flow, string processing, how to do arithmetic, simple data structures like arrays, lists and dictionaries. Something with an easy to use API so you can do a bit of fun graphics to understand iteration and looping. In the old days we mostly started with BASIC built into our home computers and those more adventurous learnt assembly because a 1MHz 6502 just didn't have much firepower. But nowadays there's decent stuff like Python with more tutorials you can poke a stick at all free and online. When you've got that foundation and are doing fun, rewarding stuff and getting good results easily then think about C if you really must. I've got some crusty stories of what "real programmers" do but it's more said in jest and irony.
whm1974 wrote:In all seriousness, I think that learning C/C++ is going to be the easy part. The math, data structures and algorithms parts I will probably struggle with for at least while, maybe even need to go back to school just to relearn the basics. Any good beginner's stuff to (re)cover these subjects?
+---+---+--------+
| A | B | A && B |
+---+---+--------+
| 0 | 0 | 0 |
+---+---+--------+
| 0 | 1 | 0 |
+---+---+--------+
| 1 | 0 | 0 |
+---+---+--------+
| 1 | 1 | 1 |
+---+---+--------+
+---+---+--------+
| A | B | A || B |
+---+---+--------+
| 0 | 0 | 0 |
+---+---+--------+
| 0 | 1 | 1 |
+---+---+--------+
| 1 | 0 | 1 |
+---+---+--------+
| 1 | 1 | 1 |
+---+---+--------+
whm1974 wrote:Pancake wrote:whm1974 wrote:In all seriousness, I think that learning C/C++ is going to be the easy part. The math, data structures and algorithms parts I will probably struggle with for at least while, maybe even need to go back to school just to relearn the basics. Any good beginner's stuff to (re)cover these subjects?
C is a very unrewarding way to learn about programming. I don't know why you insist on learning it first. It absolutely isn't for beginners. You want to pick up something that teaches you variables and assignments, control flow, string processing, how to do arithmetic, simple data structures like arrays, lists and dictionaries. Something with an easy to use API so you can do a bit of fun graphics to understand iteration and looping. In the old days we mostly started with BASIC built into our home computers and those more adventurous learnt assembly because a 1MHz 6502 just didn't have much firepower. But nowadays there's decent stuff like Python with more tutorials you can poke a stick at all free and online. When you've got that foundation and are doing fun, rewarding stuff and getting good results easily then think about C if you really must. I've got some crusty stories of what "real programmers" do but it's more said in jest and irony.
To begin with, I always wanted to learn C/C++ ever since my stepfather brought a couple books on them back in the late 80's and early 90's when we were using a 8-bit Atari 800XL and then later the Tandy 1000/TL2.
Another reason is I'm trying to learn C is because it is hard! As I posted earlier I need a challenging project to keep myself from falling into deeper states of depression. And besides I already gotten the ball rolling so why stop now?
just brew it! wrote:whm1974 wrote:Pancake wrote:C is a very unrewarding way to learn about programming. I don't know why you insist on learning it first. It absolutely isn't for beginners. You want to pick up something that teaches you variables and assignments, control flow, string processing, how to do arithmetic, simple data structures like arrays, lists and dictionaries. Something with an easy to use API so you can do a bit of fun graphics to understand iteration and looping. In the old days we mostly started with BASIC built into our home computers and those more adventurous learnt assembly because a 1MHz 6502 just didn't have much firepower. But nowadays there's decent stuff like Python with more tutorials you can poke a stick at all free and online. When you've got that foundation and are doing fun, rewarding stuff and getting good results easily then think about C if you really must. I've got some crusty stories of what "real programmers" do but it's more said in jest and irony.
To begin with, I always wanted to learn C/C++ ever since my stepfather brought a couple books on them back in the late 80's and early 90's when we were using a 8-bit Atari 800XL and then later the Tandy 1000/TL2.
Another reason is I'm trying to learn C is because it is hard! As I posted earlier I need a challenging project to keep myself from falling into deeper states of depression. And besides I already gotten the ball rolling so why stop now?
I wouldn't say learning C is "unrewarding", but it's definitely more of a delayed gratification sort of thing, in that it'll probably take a lot longer before you'll be able to write programs that do something "interesting". I'd say the rewards (in terms of knowledge/skills) are arguably greater, but that doesn't help if it ends up being so difficult that you give up somewhere along the way.
Recall that I also originally recommended Python to start with.
Let's keep at the C for now since you seem to be highly motivated to learn it, but if it becomes too frustrating, perhaps shift over to Python instead, and come back to C later.
whm1974 wrote:Thanks JBI. I wonder if I should take a break every now and then so I don't get burned out?
just brew it! wrote:whm1974 wrote:Thanks JBI. I wonder if I should take a break every now and then so I don't get burned out?
How much time have you been spending on this anyway?
FWIW I've found that getting up from my desk and walking around for a couple of minutes can help clear my head if I'm stuck trying to understand something. (The downside for me is that "get up and walk around" often means "go get a snack"... I think I gain a few pounds when working on difficult projects!)