Re: Some Advice.

From: Mike Wahler (mkwahler_at_mkwahler.net)
Date: 02/14/04


Date: Sat, 14 Feb 2004 04:43:31 GMT


"Joec" <joec@annuna.com> wrote in message
news:3QfXb.2959$tL3.37@newsread1.news.pas.earthlink.net...
>
>
> Mike Wahler wrote:
>
> > "Joec" <joec@annuna.com> wrote in message
> > news:N9cXb.2961$WW3.1845@newsread2.news.pas.earthlink.net...
> >
> >>
> >>Robert W Hand wrote:
> >
> >
> > [some good advice]
> >
> >
> >>Wow thanks for the tips.
> >
> >
> > Yes, imo Bob's advice is always worth listening to.
> >
> >
> >> Some of them I am learning as I go along. I
> >>am learning that naming is far more important in C than in Perl.
> >
> >
> > IMO it's *always* important, regardless of language. It's a
> > 'quality of work' issue, not a language issue.
> >
> > Source code is primarily for human consumption. Think about
> > trying to read and understand your code after being away from
> > it for a year (or more).
> >
> >
> >>Writing a program and learning is very fustrating.
> >
> >
> > I feel your pain. We've all been there. :-)
> > But, learn by doing.
> >
> >
> >>I want to learn. I
> >>can read books on syntax and theory all day but it doesn't matter until
> >>it is applied.
> >
> >
> > Right. Practice, practice.
> >
> > Hang in there. :-)
> >
> > -Mike
> >
> >
> Again thanks for the tips. It is good to hear from people who do this
> in the real world. I hope to be there some day. I never realized that
> programming involved such basic skills.
>
> I really wanted to study programming in school but the stiff math
> requirements kept me out of the field of study.

I'm aware that many college curricula do impose such requirements,
but (unless it's a part of the problem domain itself), you don't
really need that much math to learn to program.

I have very little math knowledge beyond simple algebra, but
it hasn't hindered me because most of my work is business/accounting
oriented, where the 'math' is really basic arithmetic.

> The more I get into and
> learn programming the more I learn that programming I more like a
> liberal art than a science.

Yes, there's an art to it. But the 'science' (theory, etc.) is
 a necessary foundation.

>Yes math can be involved if it is necessary
> for an algorithm but writing a program is more like writing a good paper
> than doing math.

Right.

> In my current project like all I have had in the past and you can see
> them, I have had my share of bugs and problems to solve. 70% are simple
> mistakes, Curly braces, putting a < backwards or leaving off some part
> of initialization or command.

You're describing 'syntax errors' which the compiler should point
out to you. It's the *logic* errors (e.g. the code is 'legal', but
doesn't do what you expect) that are the hard ones to find.

Fixing bugs is easy, it's finding them that's hard. :-)

>I like C++ because the compiler quickly
> finds many of those errors.

Yes. But that characteristic is not unique to C++.

>20% are bad logic.

The hard to find problems. :-)

>I just did something
> wrong and I have to re-think my program.

Yes, forethought and planning are important.

>10% are that I don't know the
> syntax.

I think what you're really saying here is that you're not
sure which features or constructs are most suitable for
a given situation, or if there are any at all that 'fit'.
This just takes practice, and becoming familiar with
what the language has to offer.

> Perl was really bad for that in complex data structures.

No comment, I don't know Perl.

>
> I have been writing demo programs and posting them on my page. I get
> really excited and proud when I learn something like inheritance,
> creating a dynamic array or reading and writing files.

Yes, I find learning very rewarding myself.

> There is alot of
> code out there so a lot of people do it, it can't be that hard.

:-) It seems that some folks are naturally suited to it, others are not.

I find that a good measure is if you enjoy it or not.

>
> This program I am writing I have done already in perl. I came up with a
> better basic design for the program. The map in my Perl game was a 2d
> array of characters but in my C++ it is a grid of objects. That solved
> many of the problems I was having trying to expand the game and make it
> better. My work with and studying of C++ has given me a better ability
> to write that program in perl.

Yes, I think what's happening is that this causes you to think about
the problem more in the abstract, without bringing the baggage of
e.g. a given language's features into the idea. A Good Thing(tm).

>
> Again thanks for reading my messages mostly they are 70% frustration and
> 30% question.

Well, we're here to answer your questions.

If I find myself frustrated or simply 'stuck', often just 'stepping
away' from it for a while (do something completely different, go
walk the dog or something) reduces the stress level, and my subconscious
continues to work on it. I usually return to the project 'refreshed'
with better insight, and sometimes new ideas.

>I hope that my code can be seen and I get some advice why
> my return character function won't return the character when I draw the
> map but will when I use a debugging flag or cout in another part of the
> program.

I thought we went over that in another post. Maybe look at it again
(I forgot which thread, but I'm sure you can find it)

> I will do some reading

Never a bad idea. I read and reread my programming books constantly.

>and go over my code again in a few days.

Yeah, take a break. It can often do wonders. :-)

Good luck!

-Mike



Relevant Pages

  • Re: Newbie Question...
    ... them for writing, they are automatically clobbered. ... > complains that it cannot close the first outputfile ... > of Perl, but what am I doing wrong with the script??? ... Can you do a recursive directory search in perl without ...
    (comp.lang.perl.misc)
  • Re: (1)[0] ok but not 1[0]
    ... FK> I think I'll be writing for some weeks, ... FK> "Programming Perl" and http://perldoc.perl.org/. ... there are dozens of perl tutorials on the net ...
    (comp.lang.perl.misc)
  • Re: Some Advice.
    ... >>am learning that naming is far more important in C than in Perl. ... >>Writing a program and learning is very fustrating. ... Perl was really bad for that in complex data structures. ... I hope that my code can be seen and I get some advice why ...
    (alt.comp.lang.learn.c-cpp)
  • [UNIX] Sudo Perl Local Privileges Escalation
    ... The following security advisory is sent to the securiteam mailing list, and can be found at the SecuriTeam web site: http://www.securiteam.com ... Sudo Perl Local Privileges Escalation ... Writing FTP/Makefile.PL ...
    (Securiteam)
  • Re: How good is PERL at searching ASCII files?
    ... Can PERL do th ... or should I just spend 3 or 4 hours writing ... segregate the three param calls from the two param calls. ... The key elements being the string CONVERT, ...
    (comp.lang.perl.misc)