473,835 Members | 2,287 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Help Requested for Legacy Code

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
Jul 22 '05 #1
9 1363
Suzie wrote:
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.

--
Karthik.
Jul 22 '05 #2
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Suzie wrote:
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/Prlj9GScRAk6iAJ 9O17QMHYXXS+hHJ CDNte2HNkYWmACf ZvUt
Waov2WFzzDq+BF1 ipWcFB4g=
=tK/g
-----END PGP SIGNATURE-----
Jul 22 '05 #3
Suzie wrote:
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
SetPriorityClas s() or RasEnumConnecti ons().

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.

--
Phlip
http://industrialxp.org/community/bi...UserInterfaces
Jul 22 '05 #4
"Suzie" <wi******@yahoo .com> wrote in message
news:ec******** *************** ***@posting.goo gle.com...
Hi,

I've inherited some code from a developer who has moved onto other
things.


Track him down and shoot him.

--
Cy
http://home.rochester.rr.com/cyhome/
Jul 22 '05 #5
Cy Edmunds wrote:
"Suzie" <wi******@yahoo .com> wrote in message
news:ec******** *************** ***@posting.goo gle.com...
Hi,

I've inherited some code from a developer who has moved onto other
things.

Track him down and shoot him.

....and *then* get mean!

!
--ag

--
Artie Gold -- Austin, Texas

"If you don't think it matters, you're not paying attention."
Jul 22 '05 #6
"Suzie" <wi******@yahoo .com> wrote in message
news:ec******** *************** ***@posting.goo gle.com...
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 "wi******@yahoo .com".
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.Individua l.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.

--
David Hilsee
Jul 22 '05 #7
* 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?

--
A: Because it messes up the order in which people normally read text.
Q: Why is it such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?
Jul 22 '05 #8
In message <Yr************ ********@comcas t.com>, David Hilsee
<da************ *@yahoo.com> writes
"Suzie" <wi******@yahoo .com> wrote in message
news:ec******* *************** ****@posting.go ogle.com...
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 "wi******@yahoo .com".
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.Individua l.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?

--
Richard Herring
Jul 22 '05 #9
"Richard Herring" <ju**@[127.0.0.1]> wrote in message
news:zb******** ******@baesyste ms.com...
<snip>
I think she's just sharing the joke. Does the name J*ff R*lf mean
nothing to you?


No, not really, but looking at http://www.cotse.net/users/jeffrelf/ gave me
an idea of what he's about. I just wanted to point out that the post was
not serious, because a few people were responding with serious answers.

--
David Hilsee
Jul 22 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
1773
by: masood.iqbal | last post by:
In this day and age, you never say no to any work that is thrown at you ---- so when I was offered this short-term contract to convert legacy C code to C++, I did not say no. Personally I believed that it was a somewhat futile exercise since one of the main requirements was for the existing API (a functional interface written in C) to remain the same. I would have much rathered that the mandate be ab-initio, but that was not the case...
3
4026
by: Sai Kit Tong | last post by:
Hi, I am developing a new application running on Windows platform that needs to interface with existing legacy code - written in basic C / C++. I am trying to evaluate Java vs C# implementations. Originally, I have the impression that C# should be a clear winner. I started with Java and using the guideline from the book "Java Native Interface". Though complex, the book provide details of the practical implementation and potential...
4
1692
by: gs | last post by:
I have searched Google, MSDN,... for a week. I am still unable to make available functions in my csharp dll as native windows functions for some legacy non dotnet application I just want to expose the regex function to my old legacy application built with some tools that runs a VM with capability to access windows native DLL via declaration syntax like public int function setRegexp(String argRegexp) alias "ClassIeString.setRegexp"
6
2790
by: Ben Terry | last post by:
Hello, I have a VS 2003.NET solution which consists of four c++ unmanaged legacy projects. I am adding a new project to the solution which will be in c#. What do I need to do to my c++ projects in order to call my c# modules from within c++? From what I understand, I need to convert my c++ code from unmanaged to managed using the /clr switch (IJW). Is this correct? Are there any other considerations I need to be aware of? Ben
2
1646
by: Mark Olbert | last post by:
First off, the sympathy is for all you poor buggers out there who have to figure out how to marry Managed Extensions for C++ onto your legacy code. My condolences; my brief experience with the process leads me to believe the Microsoft hates all of its VC++ developers :) Now, the question. I'm getting a NullReferenceException in a __gc class that wraps functionality in a legacy C/C++ app (it's actually part of the Nero burning rom api). ...
1
4363
by: treelife | last post by:
I'm getting and internal server error when | run the following mod_python script. I am actually trying to run Django. Script: from mod_python import apache def handler(req): req.content_type = 'text/plain' req.write("Under Construction")
2
2908
by: trihanhcie | last post by:
I m currently working on a Unix server with a fedora 3 as an os My current version of mysql is 3.23.58. I'd like to upgrade the version to 5.0.18. After downloading from MYSQL.COM the package on the site, I made : rpm -i MySQL-server-5.0.18-0.i386.rpm then i have errors that relate to many conflicts. I cannot figure out why -and- cannot upgrade. Please Help !
20
2219
by: Mike | last post by:
Hi all, I am cramming for an technical interview about C++ and programming... I believe there will be problems on data-structures and algorithms... could anybody recommend some online resources/references/websites so that I can find summary sheet about the confusing points of C++ and typical storage/time complexity of common data structures and common algorithms? I do have those big textbooks but I found they don't provide a fast...
10
4973
by: brooksr | last post by:
I know VB5/VBA very well but have not used VB to create web pages but need to do so. Can someone explain the purposes and differences between VBScript and VB.NET to create web pages? Also where do Visual Web Developer Express Edition and Microsoft Frontpage fit into the picture? It seems there are a bewildering array of choices in creating websites
0
9803
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10811
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10523
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
7766
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6966
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5636
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5804
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4434
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3993
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.