Mistakes during Coding

2009-08-10 Thread FameofLight

Hi,

I am currently practicing on topcoder platform . I often can see the
solution to problem , but unable to code it in registered time , I
often commit logic bluder , like condition for if , while etc.

I am coping with this problem for sometime and now I am frustrated ,
can help me out some suggestions to suppress these mistakes.

-Regard
Hemant Verma
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"google-codejam" group.
To post to this group, send email to google-code@googlegroups.com
To unsubscribe from this group, send email to 
google-code+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-code?hl=en
-~--~~~~--~~--~--~---



Re: Mistakes during Coding

2009-08-10 Thread Rob Renaud
Stay calm.  The costs of a debugging a bug are still relatively enormous in
terms of development time.  Rushing has a negative expected value,
occasionally it will pay off when you hack out a solution that just works,
but most of the time being slow and deliberate will be much better (is this
off by 1? what happens when n = 0?, etc) will save you oodles of debugging
time and will make it a lot more likely that your submission is correct.

Practice a lot.

On Tue, Aug 11, 2009 at 1:24 AM, FameofLight  wrote:

>
> Hi,
>
> I am currently practicing on topcoder platform . I often can see the
> solution to problem , but unable to code it in registered time , I
> often commit logic bluder , like condition for if , while etc.
>
> I am coping with this problem for sometime and now I am frustrated ,
> can help me out some suggestions to suppress these mistakes.
>
> -Regard
> Hemant Verma
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"google-codejam" group.
To post to this group, send email to google-code@googlegroups.com
To unsubscribe from this group, send email to 
google-code+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-code?hl=en
-~--~~~~--~~--~--~---



Re: Mistakes during Coding

2009-08-11 Thread Amir Lubega
Hullo fame
By the fact that you are practicing on the topcoder platform, You should be
able to notice that logic blunders in the 'ifs' and 'whiles' are a result of
mixing up languages eg for perl and (C, C++,php,..), in perl relational
operators and equality operators depend on the type of data you are dealing
with.eg numeric uses(> ,>=, <, <=) yet strings use (gt, ge, lt, le).
hope you can notice the difference in there. yet the above doesnt apply for
C,C++, PHP (You need to do more reading)

There may be syntax blunders (which you havent mentioned) like missing out
the closing braces in yo ifs and whiles... which prevent you from coding in
the registered time bse you are debugging. U just have to keep the old habit
of opening & closing at the sametime then get inside them and code...Thats
why many guys are going for python bse it enables you deliver in record
time.


On Tue, Aug 11, 2009 at 8:24 AM, FameofLight  wrote:

>
> Hi,
>
> I am currently practicing on topcoder platform . I often can see the
> solution to problem , but unable to code it in registered time , I
> often commit logic bluder , like condition for if , while etc.
>
> I am coping with this problem for sometime and now I am frustrated ,
> can help me out some suggestions to suppress these mistakes.
>
> -Regard
> Hemant Verma
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"google-codejam" group.
To post to this group, send email to google-code@googlegroups.com
To unsubscribe from this group, send email to 
google-code+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-code?hl=en
-~--~~~~--~~--~--~---



Re: Mistakes during Coding

2009-08-11 Thread liang yu
Nothing else just practice more and some plugins are recommended for
generating both the basic code and the test code more efficient.

good luck

On Tue, Aug 11, 2009 at 2:01 PM, Rob Renaud  wrote:

> Stay calm.  The costs of a debugging a bug are still relatively enormous in
> terms of development time.  Rushing has a negative expected value,
> occasionally it will pay off when you hack out a solution that just works,
> but most of the time being slow and deliberate will be much better (is this
> off by 1? what happens when n = 0?, etc) will save you oodles of debugging
> time and will make it a lot more likely that your submission is correct.
>
> Practice a lot.
>
>
> On Tue, Aug 11, 2009 at 1:24 AM, FameofLight wrote:
>
>>
>> Hi,
>>
>> I am currently practicing on topcoder platform . I often can see the
>> solution to problem , but unable to code it in registered time , I
>> often commit logic bluder , like condition for if , while etc.
>>
>> I am coping with this problem for sometime and now I am frustrated ,
>> can help me out some suggestions to suppress these mistakes.
>>
>> -Regard
>> Hemant Verma
>>
>>
>
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"google-codejam" group.
To post to this group, send email to google-code@googlegroups.com
To unsubscribe from this group, send email to 
google-code+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-code?hl=en
-~--~~~~--~~--~--~---



Re: Mistakes during Coding

2009-08-11 Thread Bartholomew Furrow
>
> Stay calm.  The costs of a debugging a bug are still relatively enormous in
> terms of development time.  Rushing has a negative expected value,
> occasionally it will pay off when you hack out a solution that just works,
> but most of the time being slow and deliberate will be much better (is this
> off by 1? what happens when n = 0?, etc) will save you oodles of debugging
> time and will make it a lot more likely that your submission is correct.


Rob nailed it.  Particularly when you're
new to competitive programming, it's easy to rush through things and
tempting to take a risky approach.
 Consciously slow down, consciously think about boundary cases, and leave
the speed for when you get more comfortable.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"google-codejam" group.
To post to this group, send email to google-code@googlegroups.com
To unsubscribe from this group, send email to 
google-code+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-code?hl=en
-~--~~~~--~~--~--~---



Re: Mistakes during Coding

2009-08-11 Thread FameofLight

Yes , I have to admit this , when I see solution , I instantly jolt
down to type it without even thinking , how will the actual solution
look like ,

Like the last time div2 500 , seeing the solution instantly I saw the
approach but then two blunders

1. I don't correct give order to my dx[] and dy[] coordinate.
2. Second As I have copy pasted the condition for two if's L and R I
never changed the second if condition to 'R' until I was printing
everything from my program for debugging.

Also as I am able to recognize the repetative blunders , I now
developing habits to spot those mistake first .

On Aug 11, 12:24 pm, Bartholomew Furrow  wrote:
> > Stay calm.  The costs of a debugging a bug are still relatively enormous in
> > terms of development time.  Rushing has a negative expected value,
> > occasionally it will pay off when you hack out a solution that just works,
> > but most of the time being slow and deliberate will be much better (is this
> > off by 1? what happens when n = 0?, etc) will save you oodles of debugging
> > time and will make it a lot more likely that your submission is correct.
>
> Rob nailed it.  Particularly when you're
> new to competitive programming, it's easy to rush through things and
> tempting to take a risky approach.
>  Consciously slow down, consciously think about boundary cases, and leave
> the speed for when you get more comfortable.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"google-codejam" group.
To post to this group, send email to google-code@googlegroups.com
To unsubscribe from this group, send email to 
google-code+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-code?hl=en
-~--~~~~--~~--~--~---



Re: Mistakes during Coding

2009-08-11 Thread Bartholomew Furrow
>
> 2. Second As I have copy pasted the condition for two if's L and R I
> never changed the second if condition to 'R' until I was printing
> everything from my program for debugging.


Copy/Paste errors are very, very easy to make.  I have two solutions:

1. Never copy/paste anything.
2. If you do copy/paste something, make sure it's visually separate from the
rest of the page.  e.g.:

/// put this line in before
1. Never copy/paste anything.
2. If you do copy/paste something, make sure it's visually separate from the
rest of the page.  e.g.:
/// put this line in before

...and then go carefully from one end of it to the other, making sure you
didn't do anything wrong.

Another thing you can do is read your program carefully after you're done.
 For example, the person who coded this ended up with an obvious asymmetry,
and re-reading would have stopped him from being knocked out of the
tournament:

http://www.topcoder.com/stat?c=problem_solution&rm=300671&rd=13761&pm=10361&cr=304031

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"google-codejam" group.
To post to this group, send email to google-code@googlegroups.com
To unsubscribe from this group, send email to 
google-code+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-code?hl=en
-~--~~~~--~~--~--~---