Originally posted by d000hg
View Post
- Visitors can check out the Forum FAQ by clicking this link. You have to register before you can post: click the REGISTER link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. View our Forum Privacy Policy.
- Want to receive the latest contracting news and advice straight to your inbox? Sign up to the ContractorUK newsletter here. Every sign up will also be entered into a draw to WIN £100 Amazon vouchers!
Recommendations for children interested in programming
Collapse
X
-
I always wonder if the people that go on about GOTO being bad actually understand that where there's something inside an if condition, for example, that when the condition isn't true the computer jumps over it, or in other words goes to the end. Or maybe they just don't understand, or don't want to understand what's really going on. All the C based languages have switch, which is really just a fancy goto, have break and continue, which is little better, and you can always return from anywhere in a function.Will work inside IR35. Or for food. -
In spite of my earlier comment I agree. In the context of learning it's probably best to manipulate your own counters in conjunction with GOTO and simple IF tests before moving onto stuff like FOR-NEXT loops.Originally posted by VectraMan View PostI always wonder if the people that go on about GOTO being bad actually understand that where there's something inside an if condition, for example, that when the condition isn't true the computer jumps over it, or in other words goes to the end. Or maybe they just don't understand, or don't want to understand what's really going on. All the C based languages have switch, which is really just a fancy goto, have break and continue, which is little better, and you can always return from anywhere in a function.Last edited by Sysman; 5 April 2012, 12:15.Behold the warranty -- the bold print giveth and the fine print taketh away.Comment
-
You're right but that doesn't mean that in the context of a higher level language, use of goto is good. The whole point of C/C++ is it handles such ASM-level stuff for you, including side-effects with registers and so on.Originally posted by VectraMan View PostI always wonder if the people that go on about GOTO being bad actually understand that where there's something inside an if condition, for example, that when the condition isn't true the computer jumps over it, or in other words goes to the end. Or maybe they just don't understand, or don't want to understand what's really going on. All the C based languages have switch, which is really just a fancy goto, have break and continue, which is little better, and you can always return from anywhere in a function.
I don't think I'd cover goto if I was teaching C and I can't remember ever using it although
I am sometimes tempted when breaking out of a multi-dimensional loop
Originally posted by MaryPoppinsI'd still not breastfeed a naziOriginally posted by vetranUrine is quite nourishingComment
-
The problem with GOTO is something I came across many years ago with a language which didn't offer much else in control flow except for IF...GOTO. You could end up with some horrible code:Originally posted by d000hg View PostI don't think I'd cover goto if I was teaching C and I can't remember ever using it although
I am sometimes tempted when breaking out of a multi-dimensional loop
You can see where the term "spagghetti code" comes from.Code:if x != 1 goto 100 DESC ="INVOICE" goto 999 100: if x != 2 goto 200 DESC = "CREDIT" goto 999 200: if x != 3 goto 300 DESC = "JOURNAL" goto 999 300: if x !=4 goto 400 . . . 999:Last edited by Sysman; 5 April 2012, 13:22.Behold the warranty -- the bold print giveth and the fine print taketh away.Comment
-
How do you know? Have you tried? Children that age found LOGO easy enough to learn, and that's closer to LISP than anything else: I honestly don't think that Python is going to be that hard for them to pick up:Originally posted by d000hg View PostI repeat - you can not teach C or Python to a kid at the same age they are learning to do basic arithmetic.
Code:# This program says hello and asks for my name. print('Hello world!') print('What is your name?') myName = input() print('It is good to meet you, ' + myName)
Anecdotal evidence based on your own experience, perchance? Did anybody attempt to teach you anything but BASIC? How do you know you couldn't have learned with anything else?Originally posted by d000hg View PostYou CAN teach them BASIC.
You CAN teach them to talk Chaucerian English; that doesn't mean it's a good or useful thing to do so.Comment
-
Agreed.Originally posted by Scrag Meister View PostI'm a firm believer that programming is more about a state of mind and logical ability, than a specific syntax.
If you can think like a programmer then the language is a secondary thing.
You either have it or you don't and the language really isn't the main issue.
Microsoft still include it for the simple reason that they have corporate customers who have LOB applications written in the various versions of BASIC that Office has supported over the years, and Microsoft's philosophy is to support stuff that corporate customers actively use for as long as necessary - hence IE6 still being around.Originally posted by Scrag Meister View PostAnd if BASIC is as obsolete as you imply why do Microsoft still include it with Office, Studio, etc.. after 30+ years of it being around. VB.NET has access to the same Framework as C#, it's just a different language interface.
There are two main reasons for the existence of VB.NET, one officially acknowledged, the other not. The official one is that it provided a path for VB6 programmers, who at the time .NET was introduced were the single most active community of developers on the Windows platform, to move to the new framework; I recall not everybody was happy about it at the time. The small number of VB6 programers I know who made the move tended to end up moving wholesale to C# anyway.
As far as learning to program is concerned, I'd say stay away from MS's Visual IDEs at all costs: they do too much and hide it behind the curtains, which is fine in a commercial environment where the goal is to save money, but sucks in an educational context where the goal is to increase knowledge and understanding.Comment
-
Comment
-
You're right Nick we shouldn't be using a niche language to teach kids. So that's Python out of contention
I still absolutely don't buy your argument that simply because people don't write serious code in BASIC, that means it's bad as a tool to learn the basics. The point is to get them interested and teach them how to think. LOGO is as good as anything else at that age.Originally posted by MaryPoppinsI'd still not breastfeed a naziOriginally posted by vetranUrine is quite nourishingComment
-
The whole GOTO is bad in all circumstances thing is overdone. Agreed using goto's all over the place is bad but they can be useful in C for example in Macros for error handling.Originally posted by d000hg View PostI don't know that I'd consider VB to be BASIC, there's a lot more to confuse people with
And as for VB.net, definitely not. I mean good old-fashioned BASIC with line numbers, as being the simplest language you can actually write something in.
I thought we wanted to teach them low-level "how the computer works" stuff? That's what GOTO is, it my instill bad programming habits but it also is a fundamental part of knowing what a C function does.
It't like the statement that programmers can't be trusted to manage memory or forcing everything into a object oriented paradigm. Use the best keyword/language/paradigm for the job.Last edited by russell; 5 April 2012, 21:49.Comment
-
Oh crap I am finding myself agreeing with this manOriginally posted by russell View PostStart them on C or it's a waste of time. Close to the machine so they understand how a computer works.
Comment
- Home
- News & Features
- First Timers
- IR35 / S660 / BN66
- Employee Benefit Trusts
- Agency Workers Regulations
- MSC Legislation
- Limited Companies
- Dividends
- Umbrella Company
- VAT / Flat Rate VAT
- Job News & Guides
- Money News & Guides
- Guide to Contracts
- Successful Contracting
- Contracting Overseas
- Contractor Calculators
- MVL
- Contractor Expenses
Advertisers

Comment