473,414 Members | 1,948 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,414 software developers and data experts.

Anti-rust programming language


I've been programming in C++ for a few years now. At one stage, I had a
great deal of it very fresh in my mind.

About two weeks ago, I started back programming in C++ having not been at it
for maybe a year. I opened a few of my old source files and was... well...
unfamiliar!

Looking at "p_k = &k" and the like left me staring blankly at the screen
trying to think exactly what that meant... ?

A day later I was grand, I had the syntax down.

But... I realised something about the C++ programming language. I'll try to
keep this objective, as I'm sure a few of you here would object to any
suggestion that this is a "flaw" in the language, but here goes:

C++ is not at all "anti-rust". By that, I mean that it's very easy to become
rusty at it, and once you do, you're perplexed looking at all the strange
syntax!

Compare this to Visual Basic. If you could do something like "p_k = &k" in
VB, then it'd probably look like:

SetPointer p_k = AddressOf( k )

, which we English speaking humans can understand very easily!

I'm not all suggesting that the language should be dumbed-downed or
deficienized (as is the case with VB), but I think it would be helpful if
actual English words were used in the place of symbols.

Don't get me wrong though -- I'm a fairly intelligent person and I've no
problem at all reading through a source file looking at all the different
symbols; I can interpret them swiftly on-the-fly, but if I go twelve months
without seeing them, then they're just unfamiliar alien language.

The whole "alien language" aspect is what makes C++ so daunting for
beginners. To a person who doesn't know C++, or who is rusty, a C++ source
code file looks like horribly complex gobledygook! Little do they know
though that we C++ programmers read through it as easy as our native
language... just so long as we're not rusty!

Anyway, I've said enough. I'm summarise:

Because we use symbols in C++, if we go a good deal of time without using
it, we become horribly rusty.

If we were to use actual English words instead of symbols (as does Visual
Basic), then the language would be learned more quickly, and also we
wouldn't spend as much time digging into the back of our brain once we
become rusty.

Maybe someone out there has made a parser to change symbols into words and
vice versa?

ToM_tOm
Sep 18 '05 #1
8 2775
Ian
>
Compare this to Visual Basic. If you could do something like "p_k = &k" in
VB, then it'd probably look like:

SetPointer p_k = AddressOf( k )

#define SetPointer
#define AddressOf( n ) &##n;

Ian
Sep 18 '05 #2

"Ian" <ia******@hotmail.com> wrote in message
news:11***************@drone2-svc-skyt.qsi.net.nz...

Compare this to Visual Basic. If you could do something like "p_k = &k" in VB, then it'd probably look like:

SetPointer p_k = AddressOf( k )

#define SetPointer
#define AddressOf( n ) &##n;


You forgot:

#define BEGIN {
#define END }

<g>
Sep 18 '05 #3
Ian wrote:

Compare this to Visual Basic. If you could do something like
"p_k = &k" in VB, then it'd probably look like:

SetPointer p_k = AddressOf( k )

#define SetPointer
#define AddressOf( n ) &##n;


Should be:
#define AddressOf(n) &(n)

We aren't making a new token here; the address-of operator and the
thing that we're taking the address of, are separate tokens.

Note that the OP is hoist by his own petard. He could easily
have written:
pointer_to_k = &k;

and then even a non-C++ programmer (who did know what a pointer was)
would be able to guess that & means address-of.

Sep 18 '05 #4
ToM_tOm wrote:

C++ is not at all "anti-rust". By that, I mean that it's very easy
to become rusty at it, and once you do, you're perplexed looking at
all the strange syntax!
The technical term would be that C++ is not "memorable".
But memorability means different things to different people...
SetPointer p_k = AddressOf( k )

which we English speaking humans can understand very easily!
And what about non-English-speaking humans? English is only
the first language of 9% of the world's population, and that
is declining.
Would you really have had any better luck with:

FijeLaDireccion p_k = IndicadorDe( k )

or perhaps even

设置尖 p_k = 地址( k )

which is about as sensible as your code would look to a Chinaman.
I'm not all suggesting that the language should be dumbed-downed
or deficienized
It would be helpful if you used actual English words ;)
(as is the case with VB), but I think it would be helpful if
actual English words were used in the place of symbols.
Why then did you not suggest:

SetPointer p_k Equals AddressOf OpenBracket k CloseBracket

Or is it only certain symbols that are not very memorable?
I, for one, find "&" more memorable than "k" and "p_k".

My opinion: usability is more important than memorability, for
a programming language. Once I've learned C (or once you have
applied rust-killer to your brain), it is more productive to
work with short symbols than with long words.
The whole "alien language" aspect is what makes C++ so daunting
for beginners. To a person who doesn't know C++, or who is rusty,
a C++ source code file looks like horribly complex gobledygook!
Be glad you've never tried to learn Perl.
Little do they know though that we C++ programmers read through it
as easy as our native language... just so long as we're not rusty!
Nobody ever gets rusty at their native language.
Because we use symbols in C++, if we go a good deal of time without
using it, we become horribly rusty.
I don't. Buy a C++ book and learn it a bit better!
Maybe someone out there has made a parser to change symbols into
words and vice versa?


#define is your friend. (But don't expect anybody else to
want to work on your code).

Sep 19 '05 #5
On 18 Sep 2005 16:55:48 -0700, "Old Wolf" <ol*****@inspire.net.nz> wrote:
Why then did you not suggest:

SetPointer p_k Equals AddressOf OpenBracket k CloseBracket


I've just had a COBOL flashback. Cold sweats!

The whole "alien language" aspect is what makes C++ so daunting
for beginners. To a person who doesn't know C++, or who is rusty,
a C++ source code file looks like horribly complex gobledygook!


Be glad you've never tried to learn Perl.


;^D

Because we use symbols in C++, if we go a good deal of time without
using it, we become horribly rusty.


I don't. Buy a C++ book and learn it a bit better!


To the OP: I think the secret is to think of the symbols as _part_ of the
language, just like words. If it helps, you can pronounce the symbols as
though they were words, just like you might do with mathematics symbols.

The use of symbols is important because they concisely express relatively
complicated ideas. The challenge is to find a balance between readability and
conciseness.

Compare Python to Perl, for example: Python is readable but tend to be more
verbose, while Perl is concise but can be a challenge to decipher; and both
languages are somewhat similar in capability.

-dr
Sep 19 '05 #6
Ian
Old Wolf wrote:
Ian wrote:
Compare this to Visual Basic. If you could do something like
"p_k = &k" in VB, then it'd probably look like:

SetPointer p_k = AddressOf( k )


#define SetPointer
#define AddressOf( n ) &##n;

Should be:
#define AddressOf(n) &(n)

Oops, didn't spot that.....

Ian
Sep 19 '05 #7
"Dave Rahardja" <as*@me.com> wrote in message
news:9v********************************@4ax.com...
On 18 Sep 2005 16:55:48 -0700, "Old Wolf" <ol*****@inspire.net.nz> wrote:
The whole "alien language" aspect is what makes C++ so daunting
for beginners. To a person who doesn't know C++, or who is rusty,
a C++ source code file looks like horribly complex gobledygook!


Be glad you've never tried to learn Perl.


;^D


Forget perl, try looking at APL code sometime!

Here's a sample to figure out the primes:
http://www-users.cs.york.ac.uk/~susan/cyc/p/apl.gif
Sep 19 '05 #8
ToM_tOm wrote:
Compare this to Visual Basic. If you could do something like "p_k = &k" in
VB, then it'd probably look like:

SetPointer p_k = AddressOf( k )

, which we English speaking humans can understand very easily!

I'm not all suggesting that the language should be dumbed-downed or
deficienized (as is the case with VB), but I think it would be helpful if
actual English words were used in the place of symbols.


You can do it easily:

template <typename T>
inline T & AddresOf (T & t)
{
return & t;
}

--
Salu2
Sep 19 '05 #9

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

Similar topics

0
by: Jason | last post by:
Hi guys, I am having problems with VML. I had been working on a problem for sometime now, and I just recently discovered what the problem really was: VML was anti-aliasing my rectangles, but I...
7
by: Maxim Shemanarev | last post by:
I'd like to announce my project called Anti-Grain Geometry. http://www.antigrain.com Anti-Grain Geometry (AGG) is an Open Source, free of charge graphic library, written in industrially standard...
3
by: Michel | last post by:
Is there a way I can anti-aliasing a gif to be able to get a hi-quality resizeable backgroundpicture. When a GIF of JPG is being resized by the browser you get wurse pictures because it needs a...
6
by: bissatch | last post by:
Hi, I want to display text on screen with anti aliasing to make it appear smoother. Is it possible to do this in browsers by perhaps applying a style to it or is it entirely up the the browser?...
22
by: Martin Eyles | last post by:
Hi, I have some text on a page in a small font. The font size has been OK in other applications, but in a web browser, the legebility suffers due to the anti-aliasing. Is there a way to turn off...
0
by: Mark Rae | last post by:
Hi, Just a general question, really... Is anyone here using any of Microsoft's latest anti-virus / anti-spyware software?...
4
by: Mike | last post by:
Hi, I took an interest a few months ago in an anti framebreaker javascript. All my research told me that it was impossible. If a website is loaded into a frame/iframe then if it has frame...
2
by: adam.timberlake | last post by:
I was following an article on a website earlier, and although it outputted the pie chart for me perfectly, I want to make it anti- aliased somehow. I have linked to the specific article below just...
11
by: blickensdoerfer | last post by:
i have a problem using ImageTTFText: I want a Text in Arial , 8pt, without Anti-Aliasing . The result is very ugly, how can i get it proper like it would be displayed in the browser window or...
6
by: Roderik | last post by:
Hi, On my website I implemented tooltip alike layers when you hover the category items in the sidebar on the right. See: http://www.roderik.net/ The layers that become visible have a...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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
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,...
0
jinu1996
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...
0
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
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 projectplanning, coding, testing,...
0
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...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

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.