Best C tool

R

Rajnish

Hi C experts,

Please suggest me best c programming language tool, which is like
Jbuilder (for java) which suggest all avilable methods etc on typing
the object.

Best regards,

Rajnish
 
M

Mark A. Odell

(e-mail address removed) (Rajnish) wrote in

Hi C experts,

Please suggest me best c programming language tool, which is like
Jbuilder (for java) which suggest all avilable methods etc on typing
the object.

What is your question about the C language? We don't discuss tools here
(officially).
 
M

Mike Wahler

Rajnish said:
Hi C experts,

Please suggest me best c programming language tool, which is like
Jbuilder (for java) which suggest all avilable methods etc on typing
the object.

It seems you're misunderstanding what C is and how it works.
C does have 'objects' (defined simply as 'regions of storage'),
but they cannot be 'automatically' associated with 'methods'
('functions' in C) as they can with Java or C++. C has a construct
'struct' (which is very similar to a C++ class) which one can use
for composition and aggregation , but functions are not allowed as
members (but pointers to functions are).

The closest one can get to simulating e.g. a C++ member function
(I only have a passing acquaintance with Java so I won't go there)
is something like:

#include <stdio.h>
struct T
{
int member;
int (*get_m)();
};

int get_m(const struct T *arg)
{
return arg->member;
}

int main()
{
T obj = {42, get_m};
printf("%d\n", get_m(&obj));
return 0;
}

Note that there's no way to implement 'private' data, i.e.
client code can modify any of 'obj's internals indiscriminately.

If you're looking for a language for writing object oriented code,
then C is not what you're looking for. (It *can* be done in C,
but 'by hand', and you don't get any of the automatic 'safety
nets' that C++ and Java have. It's quite tedious too.).


-Mike
 
D

Default User

Rajnish said:
Hi C experts,

Please suggest me best c programming language tool, which is like
Jbuilder (for java) which suggest all avilable methods etc on typing
the object.


Your question makes no sense. There are no methods associated with C
objects. Structs and unions will have associated data members. I don't
know of any IDEs that help with that.



Brian Rodenborn
 
A

Alan Balmer

There are IDEs/editors which will do the opposite - on typing a
function (method) name, they will list all objects appropriate for the
parameters.
Your question makes no sense. There are no methods associated with C
objects. Structs and unions will have associated data members. I don't
know of any IDEs that help with that.
Do you mean the last sentence to apply to the previous one? There are
IDEs/editors which will automatically present the members of a struct
or union for selection.
 
M

Malcolm

Rajnish said:
Please suggest me best c programming language tool, which is like
Jbuilder (for java) which suggest all avilable methods etc on typing
the object.
C isn't that sort of language. It is designed to be typed into a standard
text editor, though one with syntax colouring is nice. Some IDEs for C++ can
be used for C as well and list members of structures. This is mildly useful,
though if you need to rely on it then probably the structure isn't too
well-named in the first place. They also sometimes list parameters to
functions - again mildly useful.

You will find the most useful tool is the cut and paste facility. This
allows you to move functions from one file to another, and also knock out
boilerplate code.
 
A

Alan Balmer

C isn't that sort of language. It is designed to be typed into a standard
text editor, though one with syntax colouring is nice. Some IDEs for C++ can
be used for C as well and list members of structures. This is mildly useful,
though if you need to rely on it then probably the structure isn't too
well-named in the first place.

I have to disagree with this - if you have hundreds of structure
definitions, and each one can contain a dozen or more members, it is
*very* useful. My editor, Slickedit, not only shows you the struct
members, but tells you their type and displays any comment near them.
I don't care how well-named your structures and their members are - I
find it very useful. One of the best things is that when you let the
editor autocomplete object names, they are spelled correctly no matter
what your typing skills.
They also sometimes list parameters to
functions - again mildly useful.

Again, if you have hundreds of functions, it is very useful to be
reminded of the parameters, their sequence and type, and applicable
comments. Slickedit will even provide a list of objects of the proper
type and scope for each parameter. Again, this reduces errors.
You will find the most useful tool is the cut and paste facility. This
allows you to move functions from one file to another, and also knock out
boilerplate code.
There should rarely be a need to cut and paste functions from one file
to another. If you reuse functions, they should be in their own file,
perhaps even in a library. If you move functions because they're in
the wrong file, better design is needed.
 
?

=?iso-8859-1?q?Nils_O=2E_Sel=E5sdal?=

Your question makes no sense. There are no methods associated with C
objects. Structs and unions will have associated data members. I don't
know of any IDEs that help with that.
Visual Slickedit does that just fine.
 
S

Severian

C isn't that sort of language. It is designed to be typed into a standard
text editor, though one with syntax colouring is nice. Some IDEs for C++ can
be used for C as well and list members of structures. This is mildly useful,
though if you need to rely on it then probably the structure isn't too
well-named in the first place. They also sometimes list parameters to
functions - again mildly useful.

This is much more than 'mildly useful' in my current C project, which
includes hundreds of source files, thousands of structures, and many
thousands of functions.
You will find the most useful tool is the cut and paste facility. This
allows you to move functions from one file to another, and also knock out
boilerplate code.

I certainly hope you are being sarcastic. Both 'cutting and pasting'
and 'boilerplate code' are signs of poor programming skills.
 
M

Mabden

Malcolm said:
C isn't that sort of language. It is designed to be typed into a standard
text editor, though one with syntax colouring is nice. Some IDEs for C++ can
be used for C as well and list members of structures. This is mildly useful,
though if you need to rely on it then probably the structure isn't too
well-named in the first place. They also sometimes list parameters to
functions - again mildly useful.

I you don't mind a Microsoft-centric Universe, there is the new C# (C-sharp)
programming language and environment. It is basically the newest language MS
has gotten behind, since Sun sued to stop MS from extending Java. So they
made their own language that's a combo of C, Java, and VB.
 
S

Severian

I you don't mind a Microsoft-centric Universe, there is the new C# (C-sharp)
programming language and environment. It is basically the newest language MS
has gotten behind, since Sun sued to stop MS from extending Java. So they
made their own language that's a combo of C, Java, and VB.

Ouch. Thank god I run my own company and will never have to use this
POS.
 
J

jacob navia

Alan Balmer said:
Do you mean the last sentence to apply to the previous one? There are
IDEs/editors which will automatically present the members of a struct
or union for selection.

The IDE of lcc-win32 is one of those. If the type of an identifier is either
a structure or a union, and it is followed by "->" or ".", the IDE will
open a window with the fields of the structure/union. It is a new feature
so it may have some problems. For instance, only recently it handles

struct foo tab[56];

tab[23].

This will provoke the opening of the window now, i.e. the IDE understands
tables of structures. There may be other situations where this doesn't work
OK.

jacob

lcc-win32: http://www.cs.virginia.edu/~lcc-win32
 
J

jacob navia

Alan Balmer said:
I have to disagree with this - if you have hundreds of structure
definitions, and each one can contain a dozen or more members, it is
*very* useful. My editor, Slickedit, not only shows you the struct
members, but tells you their type and displays any comment near them.

lcc-win32's IDE does that too. I thought about including comments
but it is tricky, specially if they are long. What does Slickedit do
when you have a long comment besides the member definition?

I thought that would be better to have a "goto definition" feature, that
shows you the source for the definition, and a SHORT members window.
I don't care how well-named your structures and their members are - I
find it very useful. One of the best things is that when you let the
editor autocomplete object names, they are spelled correctly no matter
what your typing skills.

This is implemented with the Escape key: it will complete the current word,
if there is only one way of completing it. If there are more than one, it
will display a list for you to choose from.

Again, if you have hundreds of functions, it is very useful to be
reminded of the parameters, their sequence and type, and applicable
comments. Slickedit will even provide a list of objects of the proper
type and scope for each parameter. Again, this reduces errors.

lcc-win32 will display the prototype automatically. Of course only
if you #include the correct header.
 
A

Alan Balmer

I you don't mind a Microsoft-centric Universe, there is the new C# (C-sharp)
programming language and environment. It is basically the newest language MS
has gotten behind, since Sun sued to stop MS from extending Java. So they
made their own language that's a combo of C, Java, and VB.

And what does that have to do with finding the "best c programming
language tool"? Did you just have a sudden impulse to insert an
advertisement here?
 
O

Old Wolf

Hi C experts,

Please suggest me best c programming language tool, which is like
Jbuilder (for java) which suggest all avilable methods etc on typing
the object.

Since you mention JBuilder, you ought to be aware of C++Builder
(by the same company). You can download a trial from www.borland.com
(This is offtopic for comp.lang.c so don't reply to this)
 

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

Forum statistics

Threads
474,145
Messages
2,570,824
Members
47,371
Latest member
Brkaa

Latest Threads

Top