R
r
-------------------------------------
A C language odditty 3000 (contents)
-------------------------------------
1. The Dawn of C (skipped)
2. The Luncy of C's syntax
3. Jupiter Mission, C in the 21st centry
4. Elegance and Beyond the Infinite
void warning {
If you worship the C/++ language(s) religiously and think it is the
perfect language "as is" {then stop reading immediately because you
may get offended! }
else {if you like the C/++ languages and think it could use some
improvements {then read on my brother! For we shall bring the archaic
C into the 21st century with much glory! -- kicking and screaming if
necessary ;-)}
}
---------------------------
2.The Luncy of C's syntax
---------------------------
[ground control to major tom]
Of the many asinine redundancies within the language called C, i find
the the syntax most disturbing. Observing from an outside perspective,
it seems that spoon feeding the compiler is more important than
readability of source code! And i cannot completely understand the
logic(or lack there of) behind this design choice.
Specifically i am referring to the redundant use of braces over
indention and the redundant declaring of variable types. Both of which
have a much more elegant solution that put the burden on your compiler
and in turn makes for much more readable code!
//-- Braces --\\
First lets talk about braces. Braces are as ugly on people as they
are in source code(just ask Ugly Betty!).
When you litter source with braces the eye has a hard time reading
the actual code. And besides, do you know anyone that writes C code
without also using indention? Well there may be a few sadomasochist
out there but i would think the vast majority uses indention even
though the language does not force it!
So, if clearly many many people see the advantage of indention over
braces, why has the language not dropped the redundant braces and
forced all to use indention to denote a block?
And why would any programmer do that which is not forced upon them?
Well because they get a good return value from such efforts --
readable code!
Ok!, Ok! for backward compatability and S&M practictioners reasons we
could do...
#include indention
//-- Variables --\\
Secondly the asinine declaration of variable types is nothing more
than a way to quickly muddy up even the most simple of code! Integers,
strings, floats, and Constants can be "typed" by the compiler, no need
to declare them. You may ask yourself...?
"""How on Gods green earth can a stupid compiler determine what a
variable type is without me declaring it first"""
....easy, you handle this at the syntactic level!
-Strings: are any repetition of any chars delimited by "
-Integers: are any repetitions of chars in the set {0123456789} and
are NOT delimited by " or '
-Floats: are in the set {integer} and have a single <period> char in
them AND are NOT delimited by " or '
-Constants: use all caps (VALUE = 10)
//-- Tribal Warfare --\\
Another problem with free form languages is this constant warring of
which free form paradigm should be followed (yes, i'll bet none of you
have experienced this before *sarcasm*)
In a "free form" language such as C you get so many personal opinions
on how braces should be styled...
Cprogrammer1: Braces should go here!
Cprogrammer2: No! they should go there!
Cprogrammer3: No! your both wrong!
Lets put an end to the madness once and for all. Force indentation or
at least give the programmer a choice between archaic redundancies and
elegant beauty.
Some say coding style and clean syntax is an art, i say it is a
necessity. Why you ask? Well so everyone can clearly and quickly
understand everyone else's code. Currently you C programmers are like
poor old major tom, just floating aroung in a tin can, your syntax has
left you blue, and you just don't know what to do?! but your circuit's
dead, there's something wrong, can you hear me major tom?
---------------------------------------
Jupiter Mission, C in the 21st centry
---------------------------------------
Here are three version of a very simple function. You decide which is
easier on the eye.
// el feo!
static void* function( obj)
{
newobj = convert(obj);
if (obj && newobj)
{
DECREF(newobj);
return obj;
} else {
if (newobj) {
DECREF(newobj);
}
ErrorClear();
return 0;
}
}
}
// el malo!
static void* function( obj) {
newobj = convert(obj);
if (obj && newobj) {
DECREF(newobj);
return obj;}
else {
if (newobj) {
DECREF(newobj);}
ErrorClear();
return 0;
}
#using indention
#using clear_syntax
#using your_brain_and_not_your_back!
// el muy bueno!
def function(obj)
newobj = convert(obj)
if obj and newobj
DECREF(newobj)
return obj
elif newobj
DECREF(newobj)
----------------------------------------
Syntax Elegance and Beyond Infinity
----------------------------------------
And now with the chains of redundancy broken a new evolutionary path
has been laid before your eyes. You are reborn as the starchild.
Master of your coding universe!
....This is Major tom to Ground Control
....I'm doing so much more!
....because I'm writing code in a most intelligent way-ah
....And the code looks very elegant tody-ah-ah!
The black monolith of evolutions next step is before you. Will you be
intelligent enough to use the knowledge contained within, or run away
with tail tucked, you be be the judge...?
A C language odditty 3000 (contents)
-------------------------------------
1. The Dawn of C (skipped)
2. The Luncy of C's syntax
3. Jupiter Mission, C in the 21st centry
4. Elegance and Beyond the Infinite
void warning {
If you worship the C/++ language(s) religiously and think it is the
perfect language "as is" {then stop reading immediately because you
may get offended! }
else {if you like the C/++ languages and think it could use some
improvements {then read on my brother! For we shall bring the archaic
C into the 21st century with much glory! -- kicking and screaming if
necessary ;-)}
}
---------------------------
2.The Luncy of C's syntax
---------------------------
[ground control to major tom]
Of the many asinine redundancies within the language called C, i find
the the syntax most disturbing. Observing from an outside perspective,
it seems that spoon feeding the compiler is more important than
readability of source code! And i cannot completely understand the
logic(or lack there of) behind this design choice.
Specifically i am referring to the redundant use of braces over
indention and the redundant declaring of variable types. Both of which
have a much more elegant solution that put the burden on your compiler
and in turn makes for much more readable code!
//-- Braces --\\
First lets talk about braces. Braces are as ugly on people as they
are in source code(just ask Ugly Betty!).
When you litter source with braces the eye has a hard time reading
the actual code. And besides, do you know anyone that writes C code
without also using indention? Well there may be a few sadomasochist
out there but i would think the vast majority uses indention even
though the language does not force it!
So, if clearly many many people see the advantage of indention over
braces, why has the language not dropped the redundant braces and
forced all to use indention to denote a block?
And why would any programmer do that which is not forced upon them?
Well because they get a good return value from such efforts --
readable code!
Ok!, Ok! for backward compatability and S&M practictioners reasons we
could do...
#include indention
//-- Variables --\\
Secondly the asinine declaration of variable types is nothing more
than a way to quickly muddy up even the most simple of code! Integers,
strings, floats, and Constants can be "typed" by the compiler, no need
to declare them. You may ask yourself...?
"""How on Gods green earth can a stupid compiler determine what a
variable type is without me declaring it first"""
....easy, you handle this at the syntactic level!
-Strings: are any repetition of any chars delimited by "
-Integers: are any repetitions of chars in the set {0123456789} and
are NOT delimited by " or '
-Floats: are in the set {integer} and have a single <period> char in
them AND are NOT delimited by " or '
-Constants: use all caps (VALUE = 10)
//-- Tribal Warfare --\\
Another problem with free form languages is this constant warring of
which free form paradigm should be followed (yes, i'll bet none of you
have experienced this before *sarcasm*)
In a "free form" language such as C you get so many personal opinions
on how braces should be styled...
Cprogrammer1: Braces should go here!
Cprogrammer2: No! they should go there!
Cprogrammer3: No! your both wrong!
Lets put an end to the madness once and for all. Force indentation or
at least give the programmer a choice between archaic redundancies and
elegant beauty.
Some say coding style and clean syntax is an art, i say it is a
necessity. Why you ask? Well so everyone can clearly and quickly
understand everyone else's code. Currently you C programmers are like
poor old major tom, just floating aroung in a tin can, your syntax has
left you blue, and you just don't know what to do?! but your circuit's
dead, there's something wrong, can you hear me major tom?
---------------------------------------
Jupiter Mission, C in the 21st centry
---------------------------------------
Here are three version of a very simple function. You decide which is
easier on the eye.
// el feo!
static void* function( obj)
{
newobj = convert(obj);
if (obj && newobj)
{
DECREF(newobj);
return obj;
} else {
if (newobj) {
DECREF(newobj);
}
ErrorClear();
return 0;
}
}
}
// el malo!
static void* function( obj) {
newobj = convert(obj);
if (obj && newobj) {
DECREF(newobj);
return obj;}
else {
if (newobj) {
DECREF(newobj);}
ErrorClear();
return 0;
}
#using indention
#using clear_syntax
#using your_brain_and_not_your_back!
// el muy bueno!
def function(obj)
newobj = convert(obj)
if obj and newobj
DECREF(newobj)
return obj
elif newobj
DECREF(newobj)
----------------------------------------
Syntax Elegance and Beyond Infinity
----------------------------------------
And now with the chains of redundancy broken a new evolutionary path
has been laid before your eyes. You are reborn as the starchild.
Master of your coding universe!
....This is Major tom to Ground Control
....I'm doing so much more!
....because I'm writing code in a most intelligent way-ah
....And the code looks very elegant tody-ah-ah!
The black monolith of evolutions next step is before you. Will you be
intelligent enough to use the knowledge contained within, or run away
with tail tucked, you be be the judge...?