Help Requested for Legacy Code

S

Suzie

Hi,

I've inherited some code from a developer who has moved onto other
things. The code makes up a rather simple application: a text editor.

The problem is, I'm still a novice programmer and I'm having trouble
accustoming myself to the programmer's coding style.

Could someone please take a look at the code and reformat it in the
way that the newbie books format code?

I ask because I feel it would only take a few moments for experts like
you guys, and it would do wonders for me.

Here is the code: http://www.Cotse.NET/users/jeffrelf/X.CPP
 
K

Karthik Kumar

Suzie said:
Hi,

I've inherited some code from a developer who has moved onto other
things. The code makes up a rather simple application: a text editor.

The problem is, I'm still a novice programmer and I'm having trouble
accustoming myself to the programmer's coding style.

Could someone please take a look at the code and reformat it in the
way that the newbie books format code?

I ask because I feel it would only take a few moments for experts like
you guys, and it would do wonders for me.

Here is the code: http://www.Cotse.NET/users/jeffrelf/X.CPP

Get a code programming editor or s.th like an 'indent' utility. That
should help you.
 
E

Evan Carew

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hi,

I've inherited some code from a developer who has moved onto other
things. The code makes up a rather simple application: a text editor.

The problem is, I'm still a novice programmer and I'm having trouble
accustoming myself to the programmer's coding style.

Could someone please take a look at the code and reformat it in the
way that the newbie books format code?

I ask because I feel it would only take a few moments for experts like
you guys, and it would do wonders for me.

Here is the code: http://www.Cotse.NET/users/jeffrelf/X.CPP
Yikes! Now that's what I call munged code! But seriously, since this is
MS specific, you might have a hard time getting help on this one from
this group. I suggest you try one of the more MS specific news groups.

Evan
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFBU1bMoo/Prlj9GScRAk6iAJ9O17QMHYXXS+hHJCDNte2HNkYWmACfZvUt
Waov2WFzzDq+BF1ipWcFB4g=
=tK/g
-----END PGP SIGNATURE-----
 
P

Phlip

Suzie said:
I've inherited some code from a developer who has moved onto other
things. The code makes up a rather simple application: a text editor.

The problem is, I'm still a novice programmer and I'm having trouble
accustoming myself to the programmer's coding style.

Could someone please take a look at the code and reformat it in the
way that the newbie books format code?

I ask because I feel it would only take a few moments for experts like
you guys, and it would do wonders for me.

Here is the code: http://www.Cotse.NET/users/jeffrelf/X.CPP

Wow! There's a different style violation on each line!!

This kind of code has no excuse. It reminds me of prima-donna code written
to "fit the most words into a character terminal". But that was before yours
or this guy's time.

Code must be readable by people first, compilers second.

If your boss thinks this code has any value, or that any extra time spent
working on it is your fault, you are screwed. Change your project or your
boss or something.

Any effort to reformat this code, or clean it up, will only throw good money
after bad. The code does so little, with such burden on everything it does,
that only a rewrite will make it better.

If you get clearance to fix the code, write what it does again, bit by bit,
into a new project. Make sure that project goes one feature at a time, and
test each feature (preferrably with automated tests) before pulling in the
next feature.

Use this code only as a cheat sheet, to show you things like how to call
SetPriorityClass() or RasEnumConnections().

Along the way, write the cleanest code you can, following rules such as
found in style guidelines like /Code Complete 2nd Ed/ by Steve McConnell.
And _frequently_ review your current progress and your code's state with
your boss and colleagues.
 
D

David Hilsee

Suzie said:
Hi,

I've inherited some code from a developer who has moved onto other
things. The code makes up a rather simple application: a text editor.

The problem is, I'm still a novice programmer and I'm having trouble
accustoming myself to the programmer's coding style.

Could someone please take a look at the code and reformat it in the
way that the newbie books format code?

I ask because I feel it would only take a few moments for experts like
you guys, and it would do wonders for me.

Here is the code: http://www.Cotse.NET/users/jeffrelf/X.CPP

Smells like a troll. First, your e-mail address is "(e-mail address removed)".
Second, the code is unbelievably bad and looks like it was intentionally
obfuscated. Third, you claim is a text editor (software which few people
write these days except for kicks) but it contains "News.Individual.NET" and
Phone_Nums[] = { "337-5075", "495-5075" }; It sounds to me like you're
trying to trick someone into compiling and running some malicious software.
 
A

Alf P. Steinbach

* Suzie:
I've inherited some code from a developer who has moved onto other
things. The code makes up a rather simple application: a text editor.

The problem is, I'm still a novice programmer and I'm having trouble
accustoming myself to the programmer's coding style.

Could someone please take a look at the code and reformat it in the
way that the newbie books format code?

I ask because I feel it would only take a few moments for experts like
you guys, and it would do wonders for me.

Here is the code: http://www.Cotse.NET/users/jeffrelf/X.CPP

LOL. Thanx. :)


PS: Are you Jeff Relf?
 
R

Richard Herring

David Hilsee said:
Suzie said:
Hi,

I've inherited some code from a developer who has moved onto other
things. The code makes up a rather simple application: a text editor.

The problem is, I'm still a novice programmer and I'm having trouble
accustoming myself to the programmer's coding style.

Could someone please take a look at the code and reformat it in the
way that the newbie books format code?

I ask because I feel it would only take a few moments for experts like
you guys, and it would do wonders for me.

Here is the code: http://www.Cotse.NET/users/jeffrelf/X.CPP

Smells like a troll. First, your e-mail address is "(e-mail address removed)".
Second, the code is unbelievably bad and looks like it was intentionally
obfuscated. Third, you claim is a text editor (software which few people
write these days except for kicks) but it contains "News.Individual.NET" and
Phone_Nums[] = { "337-5075", "495-5075" };

Suzie is (a) a troll, and (b) late (compare and contrast my posting from
not so long ago "Programmer seeks employment...")
It sounds to me like you're
trying to trick someone into compiling and running some malicious software.

I think she's just sharing the joke. Does the name J*ff R*lf mean
nothing to you?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top