Linux Format forums Forum Index Linux Format forums
Help, discussion, magazine feedback and more
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Bit stuck with Coding Academy Project One
Goto page Previous  1, 2
 
Post new topic   Reply to topic    Linux Format forums Forum Index -> Programming
View previous topic :: View next topic  
Author Message
Hudzilla
Site admin


Joined: Mon Apr 04, 2005 12:52 pm
Posts: 265
Location: LXF Towers

PostPosted: Thu Feb 04, 2010 10:43 pm    Post subject: Reply with quote

Hey!

Bazza: please do take any programming competitions into their own thread Smile

Marrea: I do a lot of C-like languages, like PHP, C#, C++, etc. These all have very similar syntax: lots of { and }, lots of ; and lots of ( and ).

A few months ago, I wrote a little library for Python called Gloss (www.tuxradar.com/gloss), which has quite a different syntax to C, so when I returned to C# I was making these kinds of errors all the time - missing braces, missing semi-colons, etc.

For me, because I have this C stuff on quite a deep level in my brain, it's pretty easy for me to get back into "C mode" after an hour or two. But for you it will take a little longer because it's your first time: you will stare at errors like this and have no idea what's causing it... but when you spot the fix, you'll remember it along with the symptoms, and be much faster to fix it next time.

There are lots of problems you'll come across, but the one I hate the most is the missing brace: you think you've closed a foreach loop, but actually you've just closed the Main() method, which means everything afterwards causes epic-level errors for MonoDevelop.

Fortunately, careful indenting of your code means it's fairly easy to find these problems. Also, newer versions of MonoDevelop dot little red scribbles around to show you when your code is wrong - it's not perfect, but it can often point you in the right direction.


Paul
Back to top
View user's profile Send private message Visit poster's website
1slipperyfish
Forum Jester


Joined: Mon May 09, 2005 3:52 pm
Posts: 2429
Location: wigan

PostPosted: Fri Feb 05, 2010 12:18 pm    Post subject: Reply with quote

i don't know whether you're a command line jockey or an ide person, but if you use eclipse or similar ide it will point out missing braces etc, admittedly it does make for lazy coding but it's just a suggestion, i always try to learn a new language using the command line as it teaches you to look for mistakes rather than having them auto-checked Very Happy finding errors is just part of the learning process Very Happy
paul
_________________
i am a follower of the culture

Back to top
View user's profile Send private message
Ram
LXF regular


Joined: Thu Apr 07, 2005 10:44 pm
Posts: 1671
Location: Guisborough

PostPosted: Fri Feb 05, 2010 1:01 pm    Post subject: Reply with quote

1slipperyfish (troll) wrote:
finding errors is just part of the learning process Very Happy
paul


But how do we fix you..... Rolling Eyes
_________________

lubuntu LXDE 13.10 running on AMD Phenom II*4; ASUS Crosshair III Formula MB; 4 GB Ram.....
Back to top
View user's profile Send private message MSN Messenger
Marrea
LXF regular


Joined: Fri Apr 08, 2005 10:32 pm
Posts: 1873
Location: Chilterns, West Hertfordshire

PostPosted: Fri Feb 05, 2010 7:52 pm    Post subject: Reply with quote

Hudzilla wrote:
But for you it will take a little longer because it's your first time: you will stare at errors like this and have no idea what's causing it... but when you spot the fix, you'll remember it along with the symptoms, and be much faster to fix it next time.

Couldn't agree more. A bit like Linux generally, really. I've learned so much by not simply reinstalling every time something goes wrong but doing my best to research the problem and get it solved without taking the easy way out.

Quote:
Fortunately, careful indenting of your code means it's fairly easy to find these problems. Also, newer versions of MonoDevelop dot little red scribbles around to show you when your code is wrong - it's not perfect, but it can often point you in the right direction.

Yes, I've seen quite a few of those red scribbles this last week!
Back to top
View user's profile Send private message
Marrea
LXF regular


Joined: Fri Apr 08, 2005 10:32 pm
Posts: 1873
Location: Chilterns, West Hertfordshire

PostPosted: Fri Feb 05, 2010 7:57 pm    Post subject: Reply with quote

1slipperyfish (troll) wrote:
i don't know whether you're a command line jockey or an ide person

I'm too new to all this to have a preference yet. But so far I'm happy either way. However, in the magazine Paul seems keen for us to use the command line so I shall probably be concentrating on that.
Back to top
View user's profile Send private message
Hudzilla
Site admin


Joined: Mon Apr 04, 2005 12:52 pm
Posts: 265
Location: LXF Towers

PostPosted: Fri Feb 05, 2010 11:03 pm    Post subject: Reply with quote

Code and build from the GUI; run from the command-line. This makes running commands with parameters so much easier!
Back to top
View user's profile Send private message Visit poster's website
Marrea
LXF regular


Joined: Fri Apr 08, 2005 10:32 pm
Posts: 1873
Location: Chilterns, West Hertfordshire

PostPosted: Sat Feb 06, 2010 12:33 pm    Post subject: Reply with quote

Hudzilla wrote:
Code and build from the GUI; run from the command-line. This makes running commands with parameters so much easier!

Thanks for the clarification. Wink
Back to top
View user's profile Send private message
View previous topic :: View next topic  
Display posts from previous:   
Post new topic   Reply to topic    Linux Format forums Forum Index -> Programming All times are GMT
Goto page Previous  1, 2
Page 2 of 2

 
Jump to:  
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 vote in polls in this forum
Linux Format forums topic RSS feed 


Powered by phpBB © 2001, 2005 phpBB Group


Copyright 2011 Future Publishing, all rights reserved.


Web hosting by UKFast