473,480 Members | 1,523 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Code reading/Understanding - A general question

Hi Everybody,

I am looking for an advice on following:
I have that "pleasure" of reading C++ codes that have been written by
person(s) that have not attended the same C++ classes that I did or
have not read the same C++ books that I have read. This kind of
people has written some parts of the code that use notations that I am
not familiar with (and that probably also includes also 50 % of other C
++ programmers). While everybody who has read a code has had that
pleasure of pulling their hair out trying to read the code that has no
comments or documentation but (in this case) I am not trying to find
the solution to such a problem. What I am looking for are books/
articles/Know-all-Inc-double-latte-coffee (is a coffee that once drank
will all of sudden make you understand every possible syntax ever
written in C++) that will allow me to be able to read the not-so-often
used C++ syntax. First guess would be to read latest ANSI/ISO C++
standard but they tend to be fairly hard to understand. That being
said I did not read ANSI/ISO standard for C++ (feel free to comment on
the C++ standard). What also would be helpful in my case? For
example, books that use/and explain non-traditional syntax of C++. I
am looking for examples of those. Detailed reference books would also
be good.
So in short I am looking for a way to help me understand quicker the
"non-traditional" C++ syntax. Help will be appreciated.

Everybody.... Thank you for your time.
Humbly,
Bo

Jun 1 '07 #1
8 1802
On Jun 1, 1:02 pm, boki_...@hotmail.com wrote:
Hi Everybody,

I am looking for an advice on following:
I have that "pleasure" of reading C++ codes that have been written by
person(s) that have not attended the same C++ classes that I did or
have not read the same C++ books that I have read. This kind of
people has written some parts of the code that use notations that I am
not familiar with (and that probably also includes also 50 % of other C
++ programmers). While everybody who has read a code has had that
pleasure of pulling their hair out trying to read the code that has no
comments or documentation but (in this case) I am not trying to find
the solution to such a problem. What I am looking for are books/
articles/Know-all-Inc-double-latte-coffee (is a coffee that once drank
will all of sudden make you understand every possible syntax ever
written in C++) that will allow me to be able to read the not-so-often
used C++ syntax. First guess would be to read latest ANSI/ISO C++
standard but they tend to be fairly hard to understand. That being
said I did not read ANSI/ISO standard for C++ (feel free to comment on
the C++ standard). What also would be helpful in my case? For
example, books that use/and explain non-traditional syntax of C++. I
am looking for examples of those. Detailed reference books would also
be good.
So in short I am looking for a way to help me understand quicker the
"non-traditional" C++ syntax. Help will be appreciated.

Everybody.... Thank you for your time.
Humbly,
Bo
At first I was thinking you are trying to find a method of
understanding some legacy code. Later I figured you are having
difficulties to understand some of the different syntax you are
running into.
For that matter, I am not so sure there is a magic book. Furter more,
I don't realy have get what kind of syntax you can't understand...
May be I missunderstood your problem.

Anyhow, if you are trying to break down some existing code I strongly
suggest using Doxygen (or one the similar tools).
It takes some time to figure out exactly what options you'd like to
use, but you get a realy nice output, including different call graphs,
class diagrams, collaboration etc.
Tip: Install 'graphviz' tool to get the graphs and diagrams.

Good Luck,
Guy

Jun 1 '07 #2
On Jun 1, 12:43 pm, gMorphus <gmorp...@hotmail.comwrote:
On Jun 1, 1:02 pm, boki_...@hotmail.com wrote:


Hi Everybody,
I am looking for an advice on following:
I have that "pleasure" of reading C++ codes that have been written by
person(s) that have not attended the same C++ classes that I did or
have not read the same C++ books that I have read. This kind of
people has written some parts of the code that use notations that I am
not familiar with (and that probably also includes also 50 % of other C
++ programmers). While everybody who has read a code has had that
pleasure of pulling their hair out trying to read the code that has no
comments or documentation but (in this case) I am not trying to find
the solution to such a problem. What I am looking for are books/
articles/Know-all-Inc-double-latte-coffee (is a coffee that once drank
will all of sudden make you understand every possible syntax ever
written in C++) that will allow me to be able to read the not-so-often
used C++ syntax. First guess would be to read latest ANSI/ISO C++
standard but they tend to be fairly hard to understand. That being
said I did not read ANSI/ISO standard for C++ (feel free to comment on
the C++ standard). What also would be helpful in my case? For
example, books that use/and explain non-traditional syntax of C++. I
am looking for examples of those. Detailed reference books would also
be good.
So in short I am looking for a way to help me understand quicker the
"non-traditional" C++ syntax. Help will be appreciated.
Everybody.... Thank you for your time.
Humbly,
Bo

At first I was thinking you are trying to find a method of
understanding some legacy code. Later I figured you are having
difficulties to understand some of the different syntax you are
running into.
For that matter, I am not so sure there is a magic book. Furter more,
I don't realy have get what kind of syntax you can't understand...
May be I missunderstood your problem.

Anyhow, if you are trying to break down some existing code I strongly
suggest using Doxygen (or one the similar tools).
It takes some time to figure out exactly what options you'd like to
use, but you get a realy nice output, including different call graphs,
class diagrams, collaboration etc.
Tip: Install 'graphviz' tool to get the graphs and diagrams.

Good Luck,
Guy- Hide quoted text -

- Show quoted text -
Hi Guy,

Thank you for the reply. To clarify you further: In most cases it is
question of a legacy code. That legacy code typically uses constructs
(syntax) that are not normally used (or are considered obsolete) but
can still be compiled in to working code. Todays books/articles use
"more modern" code that is in almost all the cases more appropriate/
efficient/nicer looking/more readable/etc. They do not explain these
"old" ways of implementing certain solutions. So to be more clearer I
am looking for books/articles that will allow me to quickly find
explanations of particular syntax. I am looking for the inverse of
"International Obfuscated C Code Contest". I would like to speed up
my understanding of the C++ code (the syntax part of it and not the
functionality; as you mentioned Doxygen is helpful to understand the
functionality, however not the syntax). So I am looking for good
books to help me(no book will help me solve all of it but several will
probably will).

Kind regards,
Bo

Jun 1 '07 #3
bo******@hotmail.com wrote:
On Jun 1, 12:43 pm, gMorphus <gmorp...@hotmail.comwrote:
>On Jun 1, 1:02 pm, boki_...@hotmail.com wrote:


>>Hi Everybody,
I am looking for an advice on following:
I have that "pleasure" of reading C++ codes that have been written by
person(s) that have not attended the same C++ classes that I did or
have not read the same C++ books that I have read. This kind of
people has written some parts of the code that use notations that I am
not familiar with (and that probably also includes also 50 % of other C
++ programmers). While everybody who has read a code has had that
pleasure of pulling their hair out trying to read the code that has no
comments or documentation but (in this case) I am not trying to find
the solution to such a problem. What I am looking for are books/
articles/Know-all-Inc-double-latte-coffee (is a coffee that once drank
will all of sudden make you understand every possible syntax ever
written in C++) that will allow me to be able to read the not-so-often
used C++ syntax. First guess would be to read latest ANSI/ISO C++
standard but they tend to be fairly hard to understand. That being
said I did not read ANSI/ISO standard for C++ (feel free to comment on
the C++ standard). What also would be helpful in my case? For
example, books that use/and explain non-traditional syntax of C++. I
am looking for examples of those. Detailed reference books would also
be good.
So in short I am looking for a way to help me understand quicker the
"non-traditional" C++ syntax. Help will be appreciated.
Everybody.... Thank you for your time.
Humbly,
Bo
At first I was thinking you are trying to find a method of
understanding some legacy code. Later I figured you are having
difficulties to understand some of the different syntax you are
running into.
For that matter, I am not so sure there is a magic book. Furter more,
I don't realy have get what kind of syntax you can't understand...
May be I missunderstood your problem.

Anyhow, if you are trying to break down some existing code I strongly
suggest using Doxygen (or one the similar tools).
It takes some time to figure out exactly what options you'd like to
use, but you get a realy nice output, including different call graphs,
class diagrams, collaboration etc.
Tip: Install 'graphviz' tool to get the graphs and diagrams.

Good Luck,
Guy- Hide quoted text -

- Show quoted text -

Hi Guy,

Thank you for the reply. To clarify you further: In most cases it is
question of a legacy code. That legacy code typically uses constructs
(syntax) that are not normally used (or are considered obsolete) but
can still be compiled in to working code. Todays books/articles use
"more modern" code that is in almost all the cases more appropriate/
efficient/nicer looking/more readable/etc. They do not explain these
"old" ways of implementing certain solutions. So to be more clearer I
am looking for books/articles that will allow me to quickly find
explanations of particular syntax. I am looking for the inverse of
"International Obfuscated C Code Contest". I would like to speed up
my understanding of the C++ code (the syntax part of it and not the
functionality; as you mentioned Doxygen is helpful to understand the
functionality, however not the syntax). So I am looking for good
books to help me(no book will help me solve all of it but several will
probably will).

Kind regards,
Bo
Your best approach is to post the obscure syntax here and ask us about
it. Actually I think it is modern C++ that uses obscure syntax not old
C++ (which is more C like). But without seeing examples of what you are
struggling with it's hard to say. Post some code!

You definitely don't won't to look at the C++ standard, that will not
help you at all. I don't know of any book dedicated to 'understanding
old C++ syntax', better to access to accumulated wisdom of the regulars
here. There are many, many man-years available to you!

john
Jun 1 '07 #4
On Jun 1, 6:02 am, boki_...@hotmail.com wrote:
[snip]
I have that "pleasure" of reading C++ codes that have
been written by
person(s) that have not attended the same C++ classes
that I did or
have not read the same C++ books that I have read.
In a commercial situation, it may be worthwhile to get
the author of the code and make them explain it. Even
if you have to pay (or your company has to pay) for
some hours, it may be worth it.

There are some tools out there that do some levels
of "de-obfuscation." I've not had a lot of experience
with them. But they were designed to reduce the
"George factor." That is "George wrote this, I can't
figure it out, and George is only available on contract
at a rate the company hates to pay." Eventually the
company gets the idea that the software tool is cheaper
than paying George's hourly rate. Ordinarily such tools
are not exactly cheap.

For future work: A company software design style guide
is not a bad idea. Though it should have some level
of flexibility and not be seen as a straight jacket.
It should give guidance on things to do and things
to avoid so that code is reasonably easy to read.
You could do worse than starting by making everybody
read _Code Complete_.
Socks

Jun 1 '07 #5
<bo******@hotmail.comwrote in message
news:11*********************@g4g2000hsf.googlegrou ps.com...
Hi Everybody,

I am looking for an advice on following:
I have that "pleasure" of reading C++ codes that have been written by
person(s) that have not attended the same C++ classes that I did or
have not read the same C++ books that I have read. This kind of
people has written some parts of the code that use notations that I am
not familiar with (and that probably also includes also 50 % of other C
++ programmers). While everybody who has read a code has had that
pleasure of pulling their hair out trying to read the code that has no
comments or documentation but (in this case) I am not trying to find
the solution to such a problem. What I am looking for are books/
articles/Know-all-Inc-double-latte-coffee (is a coffee that once drank
will all of sudden make you understand every possible syntax ever
written in C++) that will allow me to be able to read the not-so-often
used C++ syntax. First guess would be to read latest ANSI/ISO C++
standard but they tend to be fairly hard to understand. That being
said I did not read ANSI/ISO standard for C++ (feel free to comment on
the C++ standard). What also would be helpful in my case? For
example, books that use/and explain non-traditional syntax of C++. I
am looking for examples of those. Detailed reference books would also
be good.
So in short I am looking for a way to help me understand quicker the
"non-traditional" C++ syntax. Help will be appreciated.
There are basically only a few things that makes up C++ code, keywords,
operators, syntax, function calls and the STL. If you come across one you
don't understand then you can try googling for it or asking it here or
alt.comp.lang.learn.c-c++. For more simplistic questions
alt.comp.lang.learn.c-c++ may be better since there no one asks you "and
just what book are you reading that doesn't explain xxxxxx" which I've
always considered a bit rude.

One such example is an initialiation list which is one of the more frequent
sytnax questions:

class Foo
{
public:
Foo( int bar ): Bar_( bar ) {}
private:
int Bar_;
};

Without a book explainging initialization lists that is not easy to
understand. Once you find out about initialization lists, it becomes second
nature. (I dont' know if you know about initialization lists or not so
won't explain it at this point).

Feel free to ask.
Jun 1 '07 #6
On Jun 1, 6:31 pm, "Jim Langston" <tazmas...@rocketmail.comwrote:
<boki_...@hotmail.comwrote in message
news:11*********************@g4g2000hsf.googlegrou ps.com...
I am looking for an advice on following:
I have that "pleasure" of reading C++ codes that have been written by
person(s) that have not attended the same C++ classes that I did or
have not read the same C++ books that I have read. This kind of
people has written some parts of the code that use notations that I am
not familiar with (and that probably also includes also 50 % of other C
++ programmers).
[...]
There are basically only a few things that makes up C++ code, keywords,
operators, syntax, function calls and the STL. If you come across one you
don't understand then you can try googling for it or asking it here or
alt.comp.lang.learn.c-c++. For more simplistic questions
alt.comp.lang.learn.c-c++ may be better since there no one asks you "and
just what book are you reading that doesn't explain xxxxxx" which I've
always considered a bit rude.
One such example is an initialiation list which is one of the more frequent
sytnax questions:
class Foo
{
public:
Foo( int bar ): Bar_( bar ) {}
private:
int Bar_;

};
Without a book explainging initialization lists that is not easy to
understand.
If he learned C++ from a book that didn't explain initialization
lists, he should find another book. It's a basic part of C++,
and their use is required in all of the coding guidelines I've
ever seen.

It would be interesting to see what sort of notations he's
talking about. It would give us a better idea of the books he's
read, and where he should go from there.

--
James Kanze (Gabi Software) email: ja*********@gmail.com
Conseils en informatique orientée objet/
Beratung in objektorientierter Datenverarbeitung
9 place Sémard, 78210 St.-Cyr-l'École, France, +33 (0)1 30 23 00 34

Jun 1 '07 #7
On Jun 1, 9:36 pm, James Kanze <james.ka...@gmail.comwrote:
On Jun 1, 6:31 pm, "Jim Langston" <tazmas...@rocketmail.comwrote:
<boki_...@hotmail.comwrote in message
news:11*********************@g4g2000hsf.googlegrou ps.com...
I am looking for an advice on following:
I have that "pleasure" of reading C++ codes that have been written by
person(s) that have not attended the same C++ classes that I did or
have not read the same C++ books that I have read. This kind of
people has written some parts of the code that use notations that I am
not familiar with (and that probably also includes also 50 % of otherC
++ programmers).

[...]


There are basically only a few things that makes up C++ code, keywords,
operators, syntax, function calls and the STL. If you come across one you
don't understand then you can try googling for it or asking it here or
alt.comp.lang.learn.c-c++. For more simplistic questions
alt.comp.lang.learn.c-c++ may be better since there no one asks you "and
just what book are you reading that doesn't explain xxxxxx" which I've
always considered a bit rude.
One such example is an initialiation list which is one of the more frequent
sytnax questions:
class Foo
{
public:
Foo( int bar ): Bar_( bar ) {}
private:
int Bar_;
};
Without a book explainging initialization lists that is not easy to
understand.

If he learned C++ from a book that didn't explain initialization
lists, he should find another book. It's a basic part of C++,
and their use is required in all of the coding guidelines I've
ever seen.

It would be interesting to see what sort of notations he's
talking about. It would give us a better idea of the books he's
read, and where he should go from there.

--
James Kanze (Gabi Software) email: james.ka...@gmail.com
Conseils en informatique orientée objet/
Beratung in objektorientierter Datenverarbeitung
9 place Sémard, 78210 St.-Cyr-l'École, France, +33 (0)1 30 23 00 34- Hide quoted text -

- Show quoted text -
Hi Everybody,

Thank you for your comments. I liked the "George factor" comment.
Unfortunatelly in most of the cases that give me a trouble are the
ones where the "George" was employed by company X 10 years ago and
nobody who is in the company X knows where George is (in some extreme
cases they do not know who George was). The sad part is that the 10
year old code if not properly documented cannot be understod even by
George.

Jim: I agree with your comment and would like to add the following:
The user will have hard time finding it on the net/book if she/he does
not know that the syntax that you had shown is called "initialization
list". I also agree with James that C++ book has to cover
"initialization list" but they might not to.

I agree that newsgroups are the best place to ask. By far.

So to boil it down to a point:
Could someone name me three good detailed/big reference books for C+
+? Has anybody read the ISO/ANSI standard? How good it is as
reference? (Please do not beat me down for saying this: I like
standards. No joke.)

Kind regards,
Bo

Jun 4 '07 #8
Is it the style of coding that has been written?
Or just C++ syntax in general - over the years C++ has not changed
that much.
So i assume the former else you just need to learn C++ the traditional
way.
You only need to google 'C++ recommended reading'

Else if it is the coding style...

I would say welcome to the real world of working as a software
developer.
Having to navigate through code written by someone who does not really
read those books.

I have started a similar thread on being able to reverse engineer such
code into a more meaningful medium.

I have tried many tools and have yet to find one that i do use day to
day because it helps me maintain and understand some source not
written by me( or someone from the same school, in fact someone from
any school ).

To the extend i am seriously considering writing my own.

Maybe u could try some tools

Jun 8 '07 #9

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

Similar topics

242
13104
by: James Cameron | last post by:
Hi I'm developing a program and the client is worried about future reuse of the code. Say 5, 10, 15 years down the road. This will be a major factor in selecting the development language. Any...
9
4166
by: Marty McDonald | last post by:
If I invoke a web service, and it throws an exception, I can see the exception if the client app is a .Net app. However, if the client app is not a .Net app, I only receive the HTTP 500 error. I...
19
3210
by: Vinod | last post by:
Hi, I have got a peculiar requirement. I want to distinquish between the color codes. I have got two text fields and i will enter the color codes there. The first text field will have ...
9
1894
by: Ken Durden | last post by:
I already posted this to comp.programming.threads, but the group over there seems to be arguing from a purely theoretical standpoint rather than addressing the reality of compiler optimizations and...
18
1768
by: Scott Brady Drummonds | last post by:
Hi, everyeone, I recently stumbled on some code that someone else wrote that I don't like. However, I'm having trouble articulating what the bad quality of the following code is. The...
16
1410
by: André | last post by:
Hi all, I am contructing a class derived of DataGridTextBoxColumn with very much modification. However, I need to see the code of base class to know what should I in some inherited methods. ...
13
1672
by: Kirk McDonald | last post by:
Say I have a database containing chunks of Python code. I already have a way to easily load, edit, and save them. What is slightly baffling to me is how I can effectively pass this code some...
0
1538
by: Hamayun Khan | last post by:
Salam Reading email from mailserver return some extra character like 3D =20 = following is the mail body i read from mailserver through php code <HTML><HEAD>
19
2275
by: Hapa | last post by:
Does only reading (never writing) of a variable need thread synchronisation? Thanks for help? PS. Anybody knows a Visual C++ news group?
0
7041
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,...
0
6908
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7044
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,...
1
6739
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
6929
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5337
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4779
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...
1
563
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
181
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.