Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   C Programming (http://www.velocityreviews.com/forums/f42-c-programming.html)
-   -   If you could change the C or C++ or Java syntax, what would you like different? (http://www.velocityreviews.com/forums/t735010-if-you-could-change-the-c-or-c-or-java-syntax-what-would-you-like-different.html)

Alexander 10-08-2010 07:09 PM

If you could change the C or C++ or Java syntax, what would you like different?
 
Please share your oppinion on anything you do not like in the C or C++
or Java syntax (they're quite similar).

In order to maintain the integrity of the discussion (have everything
at the same place) please respond on comp.lang.c.

Cheers,
Alexander

Stuart Golodetz 10-08-2010 07:43 PM

Re: If you could change the C or C++ or Java syntax, what would youlike different?
 
Alexander wrote:
> Please share your oppinion on anything you do not like in the C or C++
> or Java syntax (they're quite similar).
>
> In order to maintain the integrity of the discussion (have everything
> at the same place) please respond on comp.lang.c.
>
> Cheers,
> Alexander


....and thus began a long, pointless and heated debate :-)

Doesn't sound like a good plan to me:

1) It will annoy the regulars in comp.lang.c with lots of off-topic
stuff about C++ and Java.
2) It won't be actionable -- if you were serious about changing the
syntax, you'd need to get on the standards committees and spend about a
decade of effort working on the details.
3) The syntax of each of the languages is different (despite a certain
amount they have in common) -- it's very hard to have a productive
discussion about three different languages at once.

If I were a betting man, I'd say you were a troll.

Regards,
Stu

Dann Corbit 10-08-2010 08:18 PM

Re: If you could change the C or C++ or Java syntax, what would you like different?
 
In article <f3bfce1a-e3d9-48e9-9c84-
e8d020bde7ec@a36g2000yqc.googlegroups.com>, alvatov@gmail.com says...
>
> Please share your oppinion on anything you do not like in the C or C++
> or Java syntax (they're quite similar).
>
> In order to maintain the integrity of the discussion (have everything
> at the same place) please respond on comp.lang.c.


If I wanted to change the features of the language, I would post to
news:comp.std.c where the design of the language is discussed.

If I were to add any feature to C, it would be a totally safe string
type, that carries its length.

But that is neither here nor there.


red floyd 10-08-2010 08:31 PM

Re: If you could change the C or C++ or Java syntax, what would youlike different?
 
On Oct 8, 12:43*pm, Stuart Golodetz <b...@blah.com> wrote:
> Alexander wrote:
> > Please share your oppinion on anything you do not like in the C or C++
> > or Java syntax (they're quite similar).

>
> > In order to maintain the integrity of the discussion (have everything
> > at the same place) please respond on comp.lang.c.

>
> > Cheers,
> > Alexander

>
> ...and thus began a long, pointless and heated debate :-)
>
> Doesn't sound like a good plan to me:
>
> 1) It will annoy the regulars in comp.lang.c with lots of off-topic
> stuff about C++ and Java.
> 2) It won't be actionable -- if you were serious about changing the
> syntax, you'd need to get on the standards committees and spend about a
> decade of effort working on the details.
> 3) The syntax of each of the languages is different (despite a certain
> amount they have in common) -- it's very hard to have a productive
> discussion about three different languages at once.
>
> If I were a betting man, I'd say you were a troll.


Or else some guy posting his homework question.

Lew 10-08-2010 10:26 PM

Re: If you could change the C or C++ or Java syntax, what would youlike different?
 
Alexander wrote:
>>> Please share your oppinion on anything you do not like in the C or C++
>>> or Java syntax (they're quite similar).


I don't like the way people start flame wars about something that doesn't
amount to a hill of beans in this world.

>>> In order to maintain the integrity of the discussion (have everything


*What* integrity?

>>> at the same place) please respond on comp.lang.c.


Stuart Golodetz wrote:
>> ...and thus began a long, pointless and heated debate :-)
>>
>> Doesn't sound like a good plan to me:
>>
>> 1) It will annoy the regulars in comp.lang.c with lots of off-topic
>> stuff about C++ and Java.
>> 2) It won't be actionable -- if you were serious about changing the
>> syntax, you'd need to get on the standards committees and spend about a
>> decade of effort working on the details.
>> 3) The syntax of each of the languages is different (despite a certain
>> amount they have in common) -- it's very hard to have a productive
>> discussion about three different languages at once.
>>
>> If I were a betting man, I'd say you were a troll.


red floyd wrote:
> Or else some guy posting his homework question.


I wouldn't bet against Stuart. The question doesn't really smell like
homework, but it reeks of troll doo-doo.

--
Lew
If you get on this discussion, you're going to regret it. Oh, not right away,
but soon and for the rest of your life.

Joshua Cranmer 10-08-2010 11:29 PM

Re: If you could change the C or C++ or Java syntax, what would youlike different?
 
On 10/08/2010 03:09 PM, Alexander wrote:
> Please share your oppinion on anything you do not like in the C or C++
> or Java syntax (they're quite similar).


Let me try int &c in C, List<List<Foo>> in C++, or int *x; in Java. Oh wait.

There is a not-insignificant amount of difference between C, C++, and
Java. The primary things that are really the same between the languages
is the use of curly braces for scope definition, semicolon-terminated
statements, the use of `\' as an escape character, and the function
calling syntax of func(args). The latter two are common even in those
languages which are not curly-braced delimited (e.g., python), and
aren't really anything that people would complain about.

That pretty much leaves the curly-brace-delimited and
semicolon-delimited natures as the only truly common parts of syntax
which are arguable, and probably anyone who would be inhabiting these
newsgroups are not going to be arguing against those.

I would like to note that many of my... issues with C++ and Java
syntaxes are of those constructs which are (more or less) unique to
those languages [1], so "they're quite similar" isn't good enough.

> In order to maintain the integrity of the discussion (have everything
> at the same place) please respond on comp.lang.c.


That sounds nice until you realize that many people on the other
newsgroups don't follow comp.lang.c, such as yours truly.

[1] Java generics and C++ templates are sufficiently different that I am
going to call them unique constructs.

--
Beware of bugs in the above code; I have only proved it correct, not
tried it. -- Donald E. Knuth

Keith H Duggar 10-09-2010 12:22 AM

Re: If you could change the C or C++ or Java syntax, what would youlike different?
 
On Oct 8, 6:26¬*pm, Lew <no...@lewscanon.com> wrote:
> red floyd wrote:
> Stuart Golodetz wrote:
> > > If I were a betting man, I'd say you were a troll.

> > Or else some guy posting his homework question.

>
> I wouldn't bet against Stuart. ¬*The question doesn't really smell like
> homework, but it reeks of troll doo-doo.


I'd bet on a guy with "I'm gonna design a better
language and write a compiler" day dreams.

KHD

James Dow Allen 10-09-2010 07:02 AM

Re: If you could change the C or C++ or Java syntax, what would youlike different?
 
On Oct 9, 2:09*am, Alexander <alva...@gmail.com> wrote:
> ... anything you do not like in the C ... syntax.


I'll offer 2 cents worth:

(1) I happen to *love* C syntax. You might prefer
Pascal syntax but, at the risk of sounding rude,
why don't you just then go code in Pascal? :-)

(2) Some will mention the second-class nature of arrays
as being bad. Some will mention the expression decay
(foo[0] becomes *foo) as being confusing. *I think these
facts result from a unique and wonderful elegance in
the C language*.

(3) That ==, etc. have precedence over & or | is annoying, but
easy to remember once you get used to it. (Ritchie explains
this is vestige of an early dialect which didn't distinguish
& and &&.)

(4) Declarations like char* a, b, c;
are confusing: a is a pointer but b and c are not.
(It's little problem for most of us, who write instead
char *a, b, c;
)

Problem (4) seems like a problem that might afflict any
linear language which, unlike Lisp, is not fully
parenthesized.

Uh oh. Someone's going to have the wonderful idea of
2-D languages where editing is done with a click-based
interface to open/close syntax nodes and get a "friendly"
2D-like effect. Fortunately I won't be around to see it. :-)

James Dow Allen


BGB / cr88192 10-09-2010 08:14 AM

Re: If you could change the C or C++ or Java syntax, what would you like different?
 

"James Dow Allen" <jdallen2000@yahoo.com> wrote in message
news:9ae021aa-dc20-4dfe-8dab-ea176d104e62@l38g2000pro.googlegroups.com...
On Oct 9, 2:09 am, Alexander <alva...@gmail.com> wrote:
> ... anything you do not like in the C ... syntax.


<--
I'll offer 2 cents worth:

(1) I happen to *love* C syntax. You might prefer
Pascal syntax but, at the risk of sounding rude,
why don't you just then go code in Pascal? :-)

(2) Some will mention the second-class nature of arrays
as being bad. Some will mention the expression decay
(foo[0] becomes *foo) as being confusing. *I think these
facts result from a unique and wonderful elegance in
the C language*.

(3) That ==, etc. have precedence over & or | is annoying, but
easy to remember once you get used to it. (Ritchie explains
this is vestige of an early dialect which didn't distinguish
& and &&.)

(4) Declarations like char* a, b, c;
are confusing: a is a pointer but b and c are not.
(It's little problem for most of us, who write instead
char *a, b, c;
)

Problem (4) seems like a problem that might afflict any
linear language which, unlike Lisp, is not fully
parenthesized.

Uh oh. Someone's going to have the wonderful idea of
2-D languages where editing is done with a click-based
interface to open/close syntax nodes and get a "friendly"
2D-like effect. Fortunately I won't be around to see it. :-)
-->

the only notable syntax alteration I would likely want to make would be be
to make the syntax non-ambiguous in the face of missing prior type
declarations (say by using a more Java or C#-like declaration syntax, as in
effectively requiring a single 'type name' which effectively terminates the
type part of a declaration, and with no modifiers which may follow it). this
is not likely to much effect the general look of the language much, or
likely even impact all that much code (except obscure cases). however,
as-is, absent typedefs the syntax is ambiguous and there is no real good
solution within the confines of the standard (it would necessarily break
standard conformance and cause some subset of otherwise conforming code to
break).

another would be to not require that, semantically, headers always behave as
if they were lexically included (although this is less certain as there are
many nifty things one can do with #if and #ifdef, and headers in general,
which could be impacted...). (as is, there are only a few scenarios in which
precompiled headers may be safely used).

possibly, less ugly function pointers (especially when returning function
pointers), but it is unclear what would be a solidly better syntax (many of
my ideas could add ambiguities, or require backtracking, which is not good).

so, alas, there is no solid way to "improve" the syntax in a general sense,
as most possible changes would also come with many costs...

or such...



Ian Collins 10-09-2010 08:24 AM

Re: If you could change the C or C++ or Java syntax, what would youlike different?
 
On 10/ 9/10 08:02 PM, James Dow Allen wrote:
> On Oct 9, 2:09 am, Alexander<alva...@gmail.com> wrote:
>> ... anything you do not like in the C ... syntax.

>
> (4) Declarations like char* a, b, c;
> are confusing: a is a pointer but b and c are not.
> (It's little problem for most of us, who write instead
> char *a, b, c;
> )


No problem at all for those of us who declare our variables at the point
of initialisation.

--
Ian Collins


All times are GMT. The time now is 12:20 AM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.