Why is C syntax so uneasy on the eye?
In its day, was it _really_ designed by snobby programmers to scare away
potential "n00bs"? If so, and after 50+ years of programming research,
why are programming languages still being designed with C's syntax?
These questions drive me insane. Every waking minute...
Nov 14 '05
177 7089
In article <V7************ ********@news20 .bellglobal.com >, Lew Pitcher <lp******@sympa tico.ca> writes: FWIW, if you want a computer language that's really "uneasy on the eye", try APL or RPG2. Even Lisp isn't very easy to read.
APL?!! APL is beauty itself, manifesting as a swell set of new
keyboard caps. C'mon - just look at that cute little rho, or the
noble edifice of the dotted-quad.
Of course, few languages can produce source as readable as ETA's.[1]
OTOH, I've had to read through pages of Java recently (analysis and design of a new web component for my corporate masters, requiring review of our current j2ee web apps), and if Java is the new "readabilit y", then give me C any day. Worse spaghetti code than you could find in any assembly program. I have no doubt that C# and C++ are just as bad.
It's possible to write highly readable code in Java, of course, just
as it is in C, but many Java programmers for some reason seem to suffer
from a variety of common style deficiencies. I've seen a lot of Java
source which was apparently written in an editor with a 200-character
line length, for example.
As untold commentators have pointed out untold times, a talented
programmer can produce a mess in any language. There *are* languages
which make it more or less convenient to produce readable source, but
for all but the worst offenders it's possible. (The only real
counterexample I can think of would be an evil esoteric language,
even then perhaps only if it didn't permit comments. I don't think
Unlambda[2] has any provision for comments, for example. If it had
them, even an Unlambda program might be rendered readable, for
suitably small values of "unreadable ".)
1. http://www.miketaylor.org.uk/tech/eta/doc/
2. http://www.eleves.ens.fr:8080/home/m...rams/unlambda/
--
Michael Wojcik mi************@ microfocus.com
Vinegar keeps more flies away than honey does.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Grumble wrote: Lew Pitcher wrote:
I resemble that remark! :-)
You resemble[1] that remark? Are you intangible?
Old joke, obviously forgotten.
- --
Lew Pitcher
IT Consultant, Enterprise Application Architecture,
Enterprise Technology Solutions, TD Bank Financial Group
(Opinions expressed are my own, not my employers')
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (MingW32)
iD8DBQFAtd2LagV FX4UWr64RArazAJ 0W5D7pR59pWn/nCYBpIbPSRP4YZg CgohYK
Wmdduf6UQMxLBkR VJdhNwnA=
=hfB0
-----END PGP SIGNATURE-----
"C# Learner" <cs****@learner .here> wrote in message
news:eF******** ******@TK2MSFTN GP12.phx.gbl... These are trivialities. Learn five or six computer languages (or three or four that are entirely unrelated to each other), /then/ formulate your opinion.
Well, I have learned BASIC, C-like languages (C and C++), Delphi (formerly named 'Object Pascal') and Smalltalk.
So, basically, I've learned a couple of procedural languages, and a couple of OO ones.
And which one do seems you the best? Which one seems to have the best syntax?
I'd say Delphi has the clearest syntax.
Delphi is boring. IMO syntax of C is much more funny.
[...]
I don't understand why I'd need to learn a few more languages to understand that C's basic syntax could be nicer. Suggest some improvements and I'll say you, why you're wrong ;-)
Simply:
Well, rephrasing Paul Graham, I should say "Don't wait until C will become
as
clear as Python, use Python instead".
1) Remove the need to specify parentheses for test conditions -- substitute a test condition terminator, such as Python's ':'.
Actually in C it is permitted to build much more complicated conditions.
It's generally bad programming style, but that feature requires parenteses.
2) Remove begin/end code block markers and require indentation instead.
Block markers vs. indentation is IMO eternal flame war.
Lew Pitcher wrote: Old joke, obviously forgotten.
Obviously :-)
On Thu, 27 May 2004 00:56:59 +0100, in comp.lang.c , C# Learner
<cs****@learner .here> wrote: One of the biggest flaws in C syntax, in my opinion, is the required parentheses for test conditions.
if (FooBar(Parse(P rocess(GetInput ()))) DoSomething();
(he prefers)
if FooBar(Parse(Pr ocess(GetInput( ))): DoSomething();
Okay, I'll bite. Why on earth do you consider this in any way an
improvement? What difference does it make to anything?
--
Mark McIntyre
CLC FAQ <http://www.eskimo.com/~scs/C-faq/top.html>
CLC readme: <http://www.angelfire.c om/ms3/bchambless0/welcome_to_clc. html>
----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet News==---- http://www.newsfeed.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption =---
----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet News==---- http://www.newsfeed.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption =---
On Thu, 27 May 2004 04:36:24 +0100, in comp.lang.c , C# Learner
<cs****@learner .here> wrote: Aha, but I only saw Python code for the /first/ time yesterday. :-)
*shrug*
Me too. And C is much easier to read. YMMV. Obviously this entire post is off-topic. Python is not C, C will never be Python and you've cross-posted to C# which is not C either.
Hmm... I have to disagree. I feel that this discussion is about C's basic syntax and its ubiquity in popular modern-day languages.
But the topic of CLC is the C /language/ and using it, not whether there's
a neater way to structure the language. You could try talking about that
over in comp.std.c, but I warn you, you'll get roasted in about 2 seconds.
--
Mark McIntyre
CLC FAQ <http://www.eskimo.com/~scs/C-faq/top.html>
CLC readme: <http://www.angelfire.c om/ms3/bchambless0/welcome_to_clc. html>
----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet News==---- http://www.newsfeed.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption =---
----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet News==---- http://www.newsfeed.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption =---
On Thu, 27 May 2004 04:36:24 +0100, in comp.lang.c , C# Learner
<cs****@learner .here> wrote: Aha, but I only saw Python code for the /first/ time yesterday. :-)
*shrug*
Me too. And C is much easier to read. YMMV. Obviously this entire post is off-topic. Python is not C, C will never be Python and you've cross-posted to C# which is not C either.
Hmm... I have to disagree. I feel that this discussion is about C's basic syntax and its ubiquity in popular modern-day languages.
But the topic of CLC is the C /language/ and using it, not whether there's
a neater way to structure the language. You could try talking about that
over in comp.std.c, but I warn you, you'll get roasted in about 2 seconds.
--
Mark McIntyre
CLC FAQ <http://www.eskimo.com/~scs/C-faq/top.html>
CLC readme: <http://www.angelfire.c om/ms3/bchambless0/welcome_to_clc. html>
----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet News==---- http://www.newsfeed.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption =---
----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet News==---- http://www.newsfeed.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption =---
Irrwahn Grausewitz wrote:
[...snip...] Smalltalk is a functional language.
How do you define "functional language" ?
On Thu, 27 May 2004 03:40:42 +0100, "Kieran Simkin"
<ki****@digit al-crocus.com> wrote: Another nicety about Python is the fact that whitespace is used for defining code blocks.
What you call a nicety <sic>, I call a liability.
--
Al Balmer
Balmer Consulting re************* ***********@att .net
On Thu, 27 May 2004 04:36:24 +0100, C# Learner <cs****@learner .here>
wrote: Also, I guess I'm just trying to make a point and get heard here; and, at the same time, I want to hear what those who are more experienced than me have to say on the matter -- especially C gurus!
For the record, I don't /hate/ this C syntax of which I talk. I just have a feeling of disbelief, perhaps, that some badly-implemented (in my opinion) syntactial elements of the C language have passed through to modern programming languages.
Forgive me if I'm wrong, but my impression is that you don't have a
deep enough understanding of the C language, and indeed of programming
languages in general, to appreciate the reasons for the syntax
features you're commenting on. Take your original example of
eliminating the deli meters around the conditional in an if statement.
Think about what this would mean for compound conditions. Combine that
with the Python-style blocking and then think about an if statement
which tests for several conditions, requiring more than one line to
write.
As you study and understand the language, you'll find that it's all
nicely consistent, and that there are good reasons for most of the
features which seem odd to you. One of the characteristics of C is
terseness, and extra parens aren't required by the language for no
reason.
Also, think about the fact that language inventors and implementers
are, by and large, a pretty bright bunch. In general, they probably
have more and wider experience in the field than you do, and some of
them might even be as smart ;-) Those features which have passed
through to modern languages have done so for a reason.
--
Al Balmer
Balmer Consulting re************* ***********@att .net This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: mike420 |
last post by:
I think everyone who used Python will agree that its syntax is
the best thing going for it. It is very readable and easy
for everyone to learn. But, Python does not a have very good
macro capabilities, unfortunately. I'd like to know if it may
be possible to add a powerful macro system to Python, while
keeping its amazing syntax, and if it could be possible to
add Pythonistic syntax to Lisp or Scheme, while keeping all
of the...
|
by: Tuang |
last post by:
I'm checking out Python as a candidate for replacing Perl as my "Swiss
Army knife" tool. The longer I can remember the syntax for performing
a task, the more likely I am to use it on the spot if the need arises.
If I have to go off and look it up, as I increasingly have to do with
Perl's ever hairier syntax, I'm more likely to just skip it, making me
even less likely to remember the syntax the next time.
So I hear that Python is easier...
|
by: Sandy Norton |
last post by:
If we are going to be stuck with @decorators for 2.4, then how about
using blocks and indentation to elminate repetition and increase
readability:
Example 1
---------
class Klass:
def __init__(self, name):
|
by: George Sakkis |
last post by:
I'm sure there must have been a past thread about this topic but I don't know how to find it: How
about extending the "for <X> in" syntax so that X can include default arguments ? This would be very
useful for list/generator comprehensions, for example being able to write something like:
instead of the less elegant explicit loop version that has to check for the length of each sequence.
What do you think ?
George
|
by: Carter Smith |
last post by:
http://www.icarusindie.com/Literature/ebooks/
Rather than advocating wasting money on expensive books for beginners,
here's my collection
of ebooks that have been made freely available on-line by their authors.
There are lots of them out there but this selection cuts out the junk.
If you know of any other good books that are freely available please post a
link to them here and I'll consider adding them to the site.
| |
by: Nicolas Fleury |
last post by:
Hi everyone, I would to know what do you think of this PEP. Any comment
welcomed (even about English mistakes).
PEP: XXX
Title: Specialization Syntax
Version: $Revision: 1.10 $
Last-Modified: $Date: 2003/09/22 04:51:49 $
Author: Nicolas Fleury <nidoizo at gmail.com>
Status: Draft
Type: Standards Track
|
by: Jeremy Yallop |
last post by:
Looking over some code I came across a line like this
if isalnum((unsigned char)c) {
which was accepted by the compiler without complaint. Should the
compiler have issued a diagnostic in this case? (I think it's not
required to, but I'd like confirmation).
Jeremy.
|
by: Bob hotmail.com> |
last post by:
Everyone
I have been spending weeks looking on the web for a good tutorial on how to use regular expressions and other methods to satisfy my craving for learning how to do FAST c-style syntax highlighting in C# but I have yet to find anything useful
I know there are people at MS that know this stuff like the front of their hand and I know there are many people out on the web that are proficient in doing this as well but it seems nobody...
|
by: Manuel |
last post by:
I'm trying to compile glut 3.7.6 (dowbloaded from official site)using
devc++.
So I've imported the glut32.dsp into devc++, included manually some
headers, and start to compile.
It return a very strange error. In your experience, where I should
looking to find the real error? Surely the sintax of glut is correct...
gcc.exe -c glut_bitmap.c -o glut_bitmap.o -I"C:/Dev-Cpp/include"
-I"../../include" -D__GNUWIN32__ -W -DWIN32 -DNDEBUG...
|
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...
|
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...
| |
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
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...
|
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...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |