Be Excellent To Each Other

And, you know, party on. Dude.

All times are UTC [ DST ]




Reply to topic  [ 127 posts ]  Go to page Previous  1, 2, 3  Next
Author Message
 Post subject: Re: Programming
PostPosted: Wed Apr 09, 2008 21:26 
Excellent Member

Joined: 30th Mar, 2008
Posts: 112
CUS wrote:
Dudley wrote:
I don't see how a webby language like php is remotely helpful to you.

He needs to learn about functions and variables and arrays and strings. PHP is the fastest way there. Then, he can think 'Right... now what do I really want to DO, now that I have some idea of how I go about it?', or whatever. C# is surely the best language for him to actually latch onto firmly, but learning PHP first can get him there faster. Yes.


Friend of mine decided to learn the guitar when he was (much) younger. He went to his first guitar lesson and spent an hour learning how to play an open E string. He never looked at the guitar again and eventually sold it.

Years later, he got another guitar and just played along with records. Now he's rather good at it.

My point is, how many beginners really want to learn the proper way to do things? When I started out I didn't care about functions or variables or classes or arrays or strings or anything else, I just wanted to make some stuff move about on the screen. Same with the guitar - playing the same note for an hour isn't any fun, and although it might teach you the *right* way to play that note, if you don't enjoy it then everything you've learnt is useless because you'll just give up.

I was thinking about this the other day, so I'd be interested to hear what people think. If you were going to teach someone to program, would you show them how to do something simple but interesting (make a sprite move around in a Java applet, for example) and gradually explain how you've done it, or would you start them off with functions, variables, classes, etc, and gradually build towards something interesting? My thinking is that if you don't grab someone's attention right at the start they'll never get past the first few lessons.

_________________
Image


Top
 Profile  
 
 Post subject: Re: Programming
PostPosted: Wed Apr 09, 2008 21:42 
User avatar
lazy eye patch

Joined: 27th Mar, 2008
Posts: 3955
Location: Telford, UK
I was simply suggesting that he learn what variables, functions, strings etc. are whilst seeing their results on-screen, right now, with little effort, right now guy. Then he could go onto C# with a degree of confidence. Since he's already got Turbo Pascal about, he might as well go straight onto C# after, it'd accomplish the same purpose... mostly... enough, I expect.

Quote:
When I started out I didn't care about functions or variables or classes or arrays or strings or anything else, I just wanted to make some stuff move about on the screen.

But that isn't learning how to program, which is what he asked about. *rethinks* Oh, are you suggesting he... downloads a sample game or something, and sort of fiddles with it a bit? That might work too, I support that's one way to see how you can... make shit happen. It's just completely the opposite way to how I would do it, but YOAYO *shrugs*

_________________
Photographs


Top
 Profile  
 
 Post subject: Re: Programming
PostPosted: Wed Apr 09, 2008 21:54 
User avatar
Excellent Member

Joined: 30th Mar, 2008
Posts: 5924
Location: Stockport - The Jewel in the Ring
mrbogus wrote:
I was thinking about this the other day, so I'd be interested to hear what people think. If you were going to teach someone to program, would you show them how to do something simple but interesting (make a sprite move around in a Java applet, for example) and gradually explain how you've done it, or would you start them off with functions, variables, classes, etc, and gradually build towards something interesting? My thinking is that if you don't grab someone's attention right at the start they'll never get past the first few lessons.


I'm entirely self taught in (counts on fingers) far too many languages. Mainly by taking the Nike approach and having an idea and Just Doing It.

The downside to this is that some of the terms used pass me completely by. I couldn't describe what a strongly typed array is* but I will automatically use them all the time, and tell off my PFY (fresh out of Uni with a 1st in Comp Sci) for not type declaring all his variables.

I do believe in a natural aptitude for programming, though. Mine was because of all the (borrowed -Ed.) games I used to have for my Vic-20, C64 or Amiga, where you could only work out the instructions from the reviews and tips pages as (the friend had not lent you the instructions - Ed.).

*Actually, I do. Bad example.

Edit:Forgot the footnote

_________________
Mint To Be Stationery - Looking for a Secret Santa gift? Try our online shops at Mint To Be.

Book me in the Face | Tweet me. Tweet me like a British nanny.


Top
 Profile  
 
 Post subject: Re: Programming
PostPosted: Wed Apr 09, 2008 21:56 
User avatar

Joined: 27th Mar, 2008
Posts: 14497
I just programmed something in Pascal using Notepad++ and some strange free compiler. It kind of worked a bit. I managed to make an exe file and it outputs in a cmd prompt sort of thing, but it just flashes on and then closes. Somehow I managed to make it stay on and the calculation I did was out by a decimal place. Learning is fun.


Top
 Profile  
 
 Post subject: Re: Programming
PostPosted: Wed Apr 09, 2008 22:04 
User avatar
Lord Of The Powerchord

Joined: 30th Mar, 2008
Posts: 174
Location: Merrie England
Quote:
If you were going to teach someone to program, would you show them how to do something simple but interesting (make a sprite move around in a Java applet, for example) and gradually explain how you've done it, or would you start them off with functions, variables, classes, etc, and gradually build towards something interesting? My thinking is that if you don't grab someone's attention right at the start they'll never get past the first few lessons.

The real question you need to answer in deciding which language to go with is how far you want to be abstracted from the compiler -- all OOP languages will abstract the problem you are trying to solve, because that's what OOP is, and you will be expressing pretty much the same *stuff* in all of them. The difference is that C-alikes will require you to have a better handle on what's really going on (like knowing what pointers are) and hold the compiler's hand for it (this is the end of the line Mr Compiler;) whereas script and BASIC derivatives won't so much. Can you get interesting things up and running in BlitzMax (might as well keep pushing my fave!) faster than C#? Sure. Does it take a long time to get things running in C# by any objective standard? Not really (see XNA). You can't really go wrong.


Top
 Profile  
 
 Post subject: Re: Programming
PostPosted: Wed Apr 09, 2008 22:05 
User avatar
lazy eye patch

Joined: 27th Mar, 2008
Posts: 3955
Location: Telford, UK
jonarob wrote:
the calculation I did was out by a decimal place. Learning is fun.

:)

_________________
Photographs


Top
 Profile  
 
 Post subject: Re: Programming
PostPosted: Wed Apr 09, 2008 22:38 
User avatar
Lurker

Joined: 30th Mar, 2008
Posts: 993
Location: Wigan
I am going to copy Jonarob and buy that book, as I too am a simpleton who can't code yet who got a C in A-level Computing (by programming a simple database in BASIC).

_________________
Splendid.


Top
 Profile  
 
 Post subject: Re: Programming
PostPosted: Wed Apr 09, 2008 22:57 
User avatar
Kindly deeds done for free

Joined: 30th Mar, 2008
Posts: 1326
Dimrill wrote:
Winnar! :DD to Stu, obv.


Winnar... or LOSER?

Code:
10 LET t=0
20 FOR x=32768 TO 32814
30 READ y
40 POKE x,y
50 LET t=t+y
60 NEXT x
70 IF t<>4154 THEN PRINT "Error in data" : STOP
80 RANDOMIZE USR 32768
90 DATA 17,16,128,1,31,0,205
100 DATA 60,32,62,0,211,254,60
110 DATA 24,251,32,66,65,83,73
120 DATA 67,32,105,115,32,97
130 DATA 108,115,111,32,102,111
140 DATA 114,32,115,107,105,108
150 DATA 108,109,97,115,116,101
160 DATA 114,115


Top
 Profile  
 
 Post subject: Re: Programming
PostPosted: Wed Apr 09, 2008 23:36 
User avatar
MR EXCELLENT FACE

Joined: 30th Mar, 2008
Posts: 2568
If you want to learn java I can get you a lovely free copy (pdf, natch) of a very good textbook. It's being written by one of the lectures at our university and is a very good way of teaching things. Well, some of the examples are fucking crap and the guy likes to do things in very round a bout ways, but the fact is it sets you nice little exercises.

Why not try and and I'll mark them for you? ;) If you learn Java, it's a very small step to learn C#. And from there it's an even smaller step to learn C/C++. Personally my favourite language is ARM Assembler. Nothing like predicated instructions to get me hard.

_________________
This man is bound by law to clear the snow away


Top
 Profile  
 
 Post subject: Re: Programming
PostPosted: Thu Apr 10, 2008 0:39 
User avatar

Joined: 30th Mar, 2008
Posts: 2046
CUS wrote:
Anonymous X wrote:
can't even manage HTML

HTML isn't a programming language. :nerd:
It is to anyone who knows nothing about computers.


Top
 Profile  
 
 Post subject: Re: Programming
PostPosted: Thu Apr 10, 2008 0:48 
User avatar
Most Excellent Pagan Wench

Joined: 3rd Apr, 2008
Posts: 361
Location: Norfolk, UK
There's loads I'd love to learn, but I have a slight learning difficulty and I'm still working on simple thigns like HTML and CSS, let along moving onto programming.
Still, in future I do intend to look further in to it Image

_________________
Image
Image


Top
 Profile  
 
 Post subject: Re: Programming
PostPosted: Thu Apr 10, 2008 2:35 
User avatar
Paws for thought

Joined: 27th Mar, 2008
Posts: 17154
Location: Just Outside That London, England, Europe
CUS wrote:
jonarob wrote:
I'll take it from anyone.

/me clears throat loudly.

And that's not why Grim... was clearing his, jonny boy.
Mr Dave wrote:
Hello! I don't actually see why people have any problems with it. It's lovely.

C? As a first programming language, in this exciting future we live in? It doesn't even do strings!
I rather like C++ and I even wrote the beginnings of a shitty Scramble clone in it (libSDL is lovely for cross-platform gammy stuff). As Mr. jonny's first programming language to see what it's like? 8)


*cough*
(Admittedly, I just use WCHAR arrays for everything string related, but still...)

I just prefer it as it gives you a much greater idea of what the hardware is actually doing over any other non-assembly language.
(See also: Why I quite like x86 assembly)


Top
 Profile  
 
 Post subject: Re: Programming
PostPosted: Thu Apr 10, 2008 7:36 
User avatar
Excellent Member

Joined: 30th Mar, 2008
Posts: 3
On the subject of Ruby, this book http://www.pragprog.com/titles/fr_ltp is by all accounts a good introduction to programming if you have absolutely no past experience. A few sample chapters online too.

I'm a freelance programmer fluent in several languages and I'd have gone for a dynamic scripting language such as Ruby as a starter for 10. Ignoring all the Rails hype, the underlying Ruby language is fantastic for getting a lot done in relatively few lines of code, and it will teach you sound object-oriented concepts applicable to many other languages.

_________________
Discount Codes @ VoucherMAD.co.uk - save money on shiny stuff and laugh at my "design" skills


Top
 Profile  
 
 Post subject: Re: Programming
PostPosted: Thu Apr 10, 2008 9:28 
User avatar
making out to faces of death

Joined: 1st Apr, 2008
Posts: 2686
Location: Sadville
I think I have to learn C-something again soon.

Right now the only programming I do (under sufferance) is in LSL, a scripting language. "They" are putting some "Mono" thing into the system so it will be all "proper" languages then. :nerd: :'(

_________________
Me flickr
Image


Top
 Profile  
 
 Post subject: Re: Programming
PostPosted: Thu Apr 10, 2008 9:52 
User avatar

Joined: 27th Mar, 2008
Posts: 14497
Scarysheep3000 wrote:
I am going to copy Jonarob and buy that book, as I too am a simpleton who can't code yet who got a C in A-level Computing (by programming a simple database in BASIC).


Are you me?


Top
 Profile  
 
 Post subject: Re: Programming
PostPosted: Thu Apr 10, 2008 10:09 
SupaMod
User avatar
Commander-in-Cheese

Joined: 30th Mar, 2008
Posts: 49232
I also got a C for a-level computer science. The teacher decided that my awesome Pascal (Turbo? Ooh, fancy!) written company payroll system wasn't 'appropriate' as a project. Even though he'd been saying how ace it was all year.

_________________
GoddessJasmine wrote:
Drunk, pulled Craster's pork, waiting for brdyime story,reading nuts. Xz


Top
 Profile  
 
 Post subject: Re: Programming
PostPosted: Thu Apr 10, 2008 10:16 
User avatar
Legendary Boogeyman

Joined: 22nd Dec, 2010
Posts: 8175
Craster wrote:
I also got a C for a-level computer science. The teacher decided that my awesome Pascal (Turbo? Ooh, fancy!) written company payroll system wasn't 'appropriate' as a project. Even though he'd been saying how ace it was all year.

Bizarre, I too got a C and also used frigging pascal. In my defense though, the lecturer for the course dissapeared after the first year, and for half of the second year we got a sub who just said 'keep, errr, doing your pascal', which basically meant all we did was piss about on the internet all lesson, every lesson. Eventually a full-time person was hired but he didn't actually have a clue about the course, and it was too late to actually teach us anything. Complete shambles, I say.

_________________
Mr Kissyfur wrote:
Pretty much everyone agrees with Gnomes, really, it's just some are too right on to admit it. :)


Top
 Profile  
 
 Post subject: Re: Programming
PostPosted: Thu Apr 10, 2008 10:22 
SupaMod
User avatar
Est. 1978

Joined: 27th Mar, 2008
Posts: 69509
Location: Your Mum
I got an F, mainly because we (as in, the whole class) did the wrong coursework, and all got a 'U'. The genius teacher ever taught us LIFO and FIFO backward. He left that year when the PC replaced the Acorns.

_________________
Grim... wrote:
I wish Craster had left some girls for the rest of us.


Top
 Profile  
 
 Post subject: Re: Programming
PostPosted: Thu Apr 10, 2008 10:36 
User avatar
lazy eye patch

Joined: 27th Mar, 2008
Posts: 3955
Location: Telford, UK
:D We were joking at work yesterday about how useless most computer courses are. Lots of 'This is how the bus works' and 'This is FIFO, LILO, LIFO, FILO...'. Over and over and over and over again.

I have never needed to know the difference between a MAN and a WAN.

_________________
Photographs


Top
 Profile  
 
 Post subject: Re: Programming
PostPosted: Thu Apr 10, 2008 10:38 
SupaMod
User avatar
Est. 1978

Joined: 27th Mar, 2008
Posts: 69509
Location: Your Mum
LILO is FIFO, surely?

_________________
Grim... wrote:
I wish Craster had left some girls for the rest of us.


Top
 Profile  
 
 Post subject: Re: Programming
PostPosted: Thu Apr 10, 2008 10:59 
User avatar
Paws for thought

Joined: 27th Mar, 2008
Posts: 17154
Location: Just Outside That London, England, Europe
At school I didn't do the computing course, it seemed a bit pointless. Before I even started doing GCSEs, I probably could have passed the A-level course.


Top
 Profile  
 
 Post subject: Re: Programming
PostPosted: Thu Apr 10, 2008 11:07 
User avatar
lazy eye patch

Joined: 27th Mar, 2008
Posts: 3955
Location: Telford, UK
Grim... wrote:
LILO is FIFO, surely?

Of course. Almost every college exam I sat had 'Which is the odd one out: LILO, FIFO, or FILO?'

_________________
Photographs


Top
 Profile  
 
 Post subject: Re: Programming
PostPosted: Thu Apr 10, 2008 11:08 
User avatar
Part physicist, part WARLORD

Joined: 2nd Apr, 2008
Posts: 13421
Location: Chester, UK
IT (renamed to ITC eventually - bugger that) was all about word processing and spreadsheets. It didn't interest me, so I took Biology, Chemistry and Psychology, keeping computers as a hobby. Now I work with the things, but it isn't bad, if I'm honest.


Top
 Profile  
 
 Post subject: Re: Programming
PostPosted: Thu Apr 10, 2008 11:16 
SupaMod
User avatar
Est. 1978

Joined: 27th Mar, 2008
Posts: 69509
Location: Your Mum
nynfortoo wrote:
IT (renamed to ITC eventually - bugger that) was all about word processing and spreadsheets.

You must be a young'un - it was called 'computing' when I was at school, and we did bugger all about WP and spreadsheets.

_________________
Grim... wrote:
I wish Craster had left some girls for the rest of us.


Top
 Profile  
 
 Post subject: Re: Programming
PostPosted: Thu Apr 10, 2008 11:19 
User avatar
Part physicist, part WARLORD

Joined: 2nd Apr, 2008
Posts: 13421
Location: Chester, UK
Grim... wrote:
nynfortoo wrote:
IT (renamed to ITC eventually - bugger that) was all about word processing and spreadsheets.

You must be a young'un - it was called 'computing' when I was at school, and we did bugger all about WP and spreadsheets.


Fairly young - 23. My IT teacher had a degree in geology, and was utterly, utterly useless with computers.


Top
 Profile  
 
 Post subject: Re: Programming
PostPosted: Thu Apr 10, 2008 11:20 
Excellent Member

Joined: 30th Mar, 2008
Posts: 112
nynfortoo wrote:
IT (renamed to ITC eventually - bugger that) was all about word processing and spreadsheets.


I did GCSE IT (called "ISG" at the time) because I noticed there was a bit of programming at the end of the course. It was all about word processing and the programming was a lie. Massive waste of time.

Geology? Consider yourself lucky. My IT teacher was a former PE teacher.

_________________
Image


Top
 Profile  
 
 Post subject: Re: Programming
PostPosted: Thu Apr 10, 2008 11:23 
SupaMod
User avatar
Est. 1978

Joined: 27th Mar, 2008
Posts: 69509
Location: Your Mum
My IT teacher told us, and I quote: "The only thing Windows 95 does that 3.1 doesn't is to let you put shortcuts on the desktop. [Acorn] MOS has been doing that for years."

_________________
Grim... wrote:
I wish Craster had left some girls for the rest of us.


Top
 Profile  
 
 Post subject: Re: Programming
PostPosted: Thu Apr 10, 2008 11:56 
User avatar
making out to faces of death

Joined: 1st Apr, 2008
Posts: 2686
Location: Sadville
We had BBC B's at my school.

There was some game about building a dyke, and another one about trying to "win" the battle of the Somme better than the real generals did.

And we made circles and stuff on the screen. :nerd:

_________________
Me flickr
Image


Top
 Profile  
 
 Post subject: Re: Programming
PostPosted: Thu Apr 10, 2008 11:59 
User avatar
lazy eye patch

Joined: 27th Mar, 2008
Posts: 3955
Location: Telford, UK
AceAceBaby wrote:
And we made circles and stuff on the screen. :nerd:

Apparently, that's a game called 'Elite'. I was surprised too, after the fact.

_________________
Photographs


Top
 Profile  
 
 Post subject: Re: Programming
PostPosted: Thu Apr 10, 2008 12:00 
User avatar
Sitting balls-back folder

Joined: 30th Mar, 2008
Posts: 10078
AceAceBaby wrote:
I think I have to learn C-something again soon.

Right now the only programming I do (under sufferance) is in LSL, a scripting language. "They" are putting some "Mono" thing into the system so it will be all "proper" languages then. :nerd: :'(

Mono is an open-source implementation of the .NET CLR (Common Language Runtime) that C#, J#, VB.NET and Managed C++ (or C++/CLR, or whatever it's called now) run on. Your LanguageOfChoice code is processed into CIL (Common Intermediate Language) which the CLR runs.

So! Instead of learning C, learn how to write/define/build an LSL->CIL processor so you can just port all your LSL stuff straight into the new Mono-based system!


Top
 Profile  
 
 Post subject: Re: Programming
PostPosted: Thu Apr 10, 2008 12:27 
User avatar
lazy eye patch

Joined: 27th Mar, 2008
Posts: 3955
Location: Telford, UK
PHP.

_________________
Photographs


Top
 Profile  
 
 Post subject: Re: Programming
PostPosted: Thu Apr 10, 2008 12:56 
User avatar
Sitting balls-back folder

Joined: 30th Mar, 2008
Posts: 10078
Oh yes, I did CLAIT at school (a clash prevented Computer Studies, which I ended up doing as an additional GCSE anyway).

Thou Shalt Not Give Faulty Acronyms To Schoolchildren - any foo' know you don't include minor words like 'and' and 'or' in acronyms. Now I'm a grown-up it's hard to believe that Computer Literacy and Information Technology wasn't a joke that got out of hand.


Top
 Profile  
 
 Post subject: Re: Programming
PostPosted: Thu Apr 10, 2008 14:05 
User avatar
MR EXCELLENT FACE

Joined: 30th Mar, 2008
Posts: 2568
ComicalGnomes wrote:
Craster wrote:
I also got a C for a-level computer science. The teacher decided that my awesome Pascal (Turbo? Ooh, fancy!) written company payroll system wasn't 'appropriate' as a project. Even though he'd been saying how ace it was all year.

Bizarre, I too got a C and also used frigging pascal. In my defense though, the lecturer for the course dissapeared after the first year, and for half of the second year we got a sub who just said 'keep, errr, doing your pascal', which basically meant all we did was piss about on the internet all lesson, every lesson. Eventually a full-time person was hired but he didn't actually have a clue about the course, and it was too late to actually teach us anything. Complete shambles, I say.


I've yet to meet someone who had a GOOD teacher for their A level computer-ing. HMPH.

CUS wrote:
:D We were joking at work yesterday about how useless most computer courses are. Lots of 'This is how the bus works' and 'This is FIFO, LILO, LIFO, FILO...'. Over and over and over and over again.

I have never needed to know the difference between a MAN and a WAN.


Everything they teach you up to A-level is ridicuously simplistic and not useful in anyway shape or form. Why do these thnigs exist?

Mr Dave wrote:
At school I didn't do the computing course, it seemed a bit pointless. Before I even started doing GCSEs, I probably could have passed the A-level course.


See above!

_________________
This man is bound by law to clear the snow away


Top
 Profile  
 
 Post subject: Re: Programming
PostPosted: Thu Apr 10, 2008 16:24 
User avatar

Joined: 30th Mar, 2008
Posts: 2046
ComicalGnomes wrote:
Bizarre, I too got a C and also used frigging pascal. In my defense though, the lecturer for the course dissapeared after the first year, and for half of the second year we got a sub who just said 'keep, errr, doing your pascal', which basically meant all we did was piss about on the internet all lesson, every lesson. Eventually a full-time person was hired but he didn't actually have a clue about the course, and it was too late to actually teach us anything. Complete shambles, I say.
Sounds like GCSE German for my year group. We just had a few supply teachers who didn't know or speak German, they just had a pile of very old textbooks which we were meant to work through ourselves somehow. Some lessons one year we were timetabled to sit in the GCSE PE 'class room' because there was no other free rooms - it stank, and we had to put our work on our laps, although few people actually worked. The only one of 25 of us who passed the GCSE was a German lad (which may have been the only GCSE he passed).


Top
 Profile  
 
 Post subject: Re: Programming
PostPosted: Fri Apr 11, 2008 11:20 
Excellent Member

Joined: 31st Mar, 2008
Posts: 35
The ideal learning programming language is Python or Ruby. Python probably takes it in terms of sheer all-round niceness and the amount of concepts it introduces - I can recommend Apress's Beginning Python which is pretty well written. Ruby is pretty good, but has a few less intuitive concepts, less clear syntax and its books tend to be a bit poor - the Pickaxe is horribly overrated.

PHP is pretty damn ugly and annoying but is exceptionally easy to pick up and play with. It's a language that has been thrown together rather than fitting together nicely. It's not a good language for "learning programming" but is suitable for hacking stuff together despite any experience.

C# is pretty much Java, which has upsides and downsides - it's quite fast, it's a nice compromise between speed-and-clarity, but it has long-winded syntax and forces you to use objects for everything.


Top
 Profile  
 
 Post subject: Re: Programming
PostPosted: Fri Apr 11, 2008 14:35 
User avatar
making out to faces of death

Joined: 1st Apr, 2008
Posts: 2686
Location: Sadville
BikNorton wrote:
So! Instead of learning C, learn how to write/define/build an LSL->CIL processor so you can just port all your LSL stuff straight into the new Mono-based system!


:nerd: I make objects move, and textures change into other textures. Don't confuse me with your programming stuff! :'(

_________________
Me flickr
Image


Top
 Profile  
 
 Post subject: Re: Programming
PostPosted: Fri Apr 11, 2008 19:19 
User avatar

Joined: 27th Mar, 2008
Posts: 14497
The book arrived! And it really does start from the beginning - I think I'm gonna be ok.

I tried "Hello World" and it works fine. However, my console only flashes on and then closes itself instead of staying open and actually displaying my "program". Anybody know why? It's the basic cmd console.


Top
 Profile  
 
 Post subject: Re: Programming
PostPosted: Fri Apr 11, 2008 19:23 
User avatar
Paws for thought

Joined: 27th Mar, 2008
Posts: 17154
Location: Just Outside That London, England, Europe
Because that's how windows works. If you want it to delay the end of the program, you have to ask it to.

(Also, I think there's an option in Visual studio which also has the same effect.)


Top
 Profile  
 
 Post subject: Re: Programming
PostPosted: Fri Apr 11, 2008 19:24 
User avatar

Joined: 27th Mar, 2008
Posts: 14497
Ah right. In the book it doesn't mention that, it just says that the cmd prompt will remain open and show my "hello world".


Top
 Profile  
 
 Post subject: Re: Programming
PostPosted: Fri Apr 11, 2008 19:26 
User avatar
making out to faces of death

Joined: 1st Apr, 2008
Posts: 2686
Location: Sadville
:bulb: Run it from the console.

_________________
Me flickr
Image


Top
 Profile  
 
 Post subject: Re: Programming
PostPosted: Fri Apr 11, 2008 19:27 

Joined: 30th Mar, 2008
Posts: 8679
If you're running a command line program from windows it'll close the window when it's finished. There's plenty of ways to get it to pause though. Alternatively, start a windows command line and run said program from that.

Edit : 3 answers in as many minutes, does this place rock or what?


Top
 Profile  
 
 Post subject: Re: Programming
PostPosted: Fri Apr 11, 2008 19:28 
User avatar

Joined: 27th Mar, 2008
Posts: 14497
I've fathomed a way. I was running it and debugging, but if I run it without debugging it keeps it open. Presumably when it debugs, it just runs the program to test it and then closes it.

edit: It does indeed rock!


Top
 Profile  
 
 Post subject: Re: Programming
PostPosted: Fri Apr 11, 2008 19:30 
User avatar
Paws for thought

Joined: 27th Mar, 2008
Posts: 17154
Location: Just Outside That London, England, Europe
The easy way would be to chuck in a breakpoint just before the program ends if you want it to pause with no extra work while debugging.


Top
 Profile  
 
 Post subject: Re: Programming
PostPosted: Fri Apr 11, 2008 19:33 
User avatar

Joined: 27th Mar, 2008
Posts: 14497
Yeah that would be easy, were it not my first ever program in C# :p

I'm just following the book!

Am I right in thinking that debug does just that? Checks the program and closes it? Whereas running it without debug is like running it from the point of view of an end user who may have downloaded my program?


Top
 Profile  
 
 Post subject: Re: Programming
PostPosted: Fri Apr 11, 2008 19:34 
User avatar
Paws for thought

Joined: 27th Mar, 2008
Posts: 17154
Location: Just Outside That London, England, Europe
jonarob wrote:
Yeah that would be easy, were it not my first ever program in C# :p

I'm just following the book!

Am I right in thinking that debug does just that? Checks the program and closes it? Whereas running it without debug is like running it from the point of view of an end user who may have downloaded my program?


No, the point of debug is to enable you to debug it (after all, how does it know a bug as compared to the behaviour you wanted, you may have wanted it to horribly crash). Breakpoints are places where you stop the program from running, and then it allows you to step through each instruction and see what values things are taking, hence allowing you to find wrong ones, and find the bug causing it. Just one of the things that debuggers allow you to do.


Top
 Profile  
 
 Post subject: Re: Programming
PostPosted: Fri Apr 11, 2008 19:36 
User avatar

Joined: 27th Mar, 2008
Posts: 14497
Right. So does anyone know why the book tells me that the console will show my "hello world" when in fact it just closes the cmd prompt? Is the book BROKEN? I've followed the instructions exactly.


Top
 Profile  
 
 Post subject: Re: Programming
PostPosted: Fri Apr 11, 2008 19:38 
User avatar
lazy eye patch

Joined: 27th Mar, 2008
Posts: 3955
Location: Telford, UK
Are you seeing Hello World at all before it closes?
Oh. So, do you have a command prompt, but running your program then closes that prompt? Even though you already had a prompt anyway before running the program?

_________________
Photographs


Top
 Profile  
 
 Post subject: Re: Programming
PostPosted: Fri Apr 11, 2008 19:40 
User avatar
Paws for thought

Joined: 27th Mar, 2008
Posts: 17154
Location: Just Outside That London, England, Europe
I wouldn't think it's broken - certainly not in terms of teaching you to program as compared to using visual studio. Did it actually ask you to debug it as compared to just running it? Could be that VS2008 works differently from 2005. Could be the professional version works differently to the express version. As it stands the program is doing exactly what it's supposed to, it's just the enviroment around it that isn't behaving quite as you'd expect, but don't worry.


Top
 Profile  
 
 Post subject: Re: Programming
PostPosted: Fri Apr 11, 2008 19:41 
User avatar

Joined: 27th Mar, 2008
Posts: 14497
Basically, I've written the Hello World in Visual C# Express, I click "start debugging" like the book says, the cmd prompt flashes up for a split second with my Hello World in it and closes immediately. It is there, but it closes. However, if I click "start without debugging" the cmd prompt stays open. However, the book says to click "start debugging" and shows the cmd prompt OPEN. Bah!

I don't already have the cmd prompt open, by the way.


Top
 Profile  
 
 Post subject: Re: Programming
PostPosted: Fri Apr 11, 2008 19:43 
User avatar
Paws for thought

Joined: 27th Mar, 2008
Posts: 17154
Location: Just Outside That London, England, Europe
Right, time to install c# express (2008, I'm guessing) and see what's up.


Top
 Profile  
 
Display posts from previous:  Sort by  
Reply to topic  [ 127 posts ]  Go to page Previous  1, 2, 3  Next

All times are UTC [ DST ]


Who is online

Users browsing this forum: Mr Russell and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search within this thread:
You are using the 'Ted' forum. Bill doesn't really exist any more. Bogus!
Want to help out with the hosting / advertising costs? That's very nice of you.
Are you on a mobile phone? Try http://beex.co.uk/m/
RIP, Owen. RIP, MrC.

Powered by a very Grim... version of phpBB © 2000, 2002, 2005, 2007 phpBB Group.