Getting Started in Programming & Scripting

C

Chris Dutton

Phlip said:
Chris Dutton wrote:
>


No way. Ruby will spoil you, and make returning to those languages
miserable.

Well, yes. :)

Of course, the other way to look at it is that it'll make you appreciate
programming for fun in Ruby all the more. Also, you might be getting
paid by the hour, in which case using Java or C# or such isn't a bad thing.
 
Z

Zachary Kessin

Bibby said:
What would be your suggestion then, if not Java? Which starting language
would serve a newbie well on a quest to master many?

I'm going to be radical here... Lisp. In terms of the syntax it is
about as simple as you can get. But in terms of the power it gives
you you won't find anything better. Check out "guile" the GNU scheme
implementation.

Concentrate on concepts of recurssion and closure and the like. Its a
great language. Though I will admit I do most of my work in
javascript and php.

--Zach
 
F

Francis Glassborow

Zachary Kessin said:
I'm going to be radical here... Lisp. In terms of the syntax it is
about as simple as you can get. But in terms of the power it gives
you you won't find anything better. Check out "guile" the GNU scheme
implementation.
The problem is not that it isn't a great language but that there are
pitiful good teachers of it. Most think procedurally and then try to
translate that into Lisp. The result is rather worse than Japanese
English (and I mean no insult to the Japanese, their English is a heck
of a sight better than my Japanese, but then the average Lisp
programmer's use of a procedural language is ...)
 
J

Jussi Jumppanen

I wish it were that simple. A great deal of bad C has been
written by those who learnt Pascal as their first language.

IMHO all that proves is that if you can write bad Pascal then
you can also write bad C.

Jussi Jumppanen
Author of: Zeus for Windows, Win32 (Brief, WordStar, Emacs) Text Editor
"The C/C++, Java, Pacal, Cobol, Fortran programmers text editor"
Home Page: http://www.zeusedit.com
 
J

Jussi Jumppanen

Malcolm said:
Pointers, on the other hand, can be grasped in a few days, but
only if the beginner has the right mindset.

Is it possible to code anything without the concept of pointers?

Like it or CPU's works with memory which means working with
pointers, any when things go wrong it will usually means a
pointer has gone astray.

So like it or not I think a basic understanding of pointers
is essential when it comes to programming.

Jussi Jumppanen
Author of: Zeus for Windows, Win32 (Brief, WordStar, Emacs) Text Editor
"The C/C++, Java, Pacal, Cobol, Fortran programmers text editor"
Home Page: http://www.zeusedit.com
 
G

Gordon Burditt

Pointers, on the other hand, can be grasped in a few days, but
Is it possible to code anything without the concept of pointers?

Yes. For example, FORTRAN 77 had no pointers. It also had no
structures, which often resulted in "parallel arrays" where what C
would call structure.member ended up being written as member(i),
member2(i), member3(i), etc. You could even sorta do "linked lists"
(where the array subscript substituted for a pointer). And you
could screw up with out-of-range subscripts almost as badly as with
pointers.


Gordon L. Burditt
 
R

Richard Heathfield

Victor Bazarov said:
Most certainly, in some languages.

VS/BASIC certainly had no pointer concept. Some BASICs do, and others don't.
IIRC, Java has no pointers.

Imagine a blanket laid loosely on a quiverful of arrows. Look ma, no
pointers - but sit down *very* carefully...
 
B

Bill Godfrey

Victor Bazarov said:
Most certainly, in some languages. IIRC, Java has no pointers.

Hiding pointers can have its own problems.

(Discussing C# code with a programmer unfamilar with C#.)

MyClass x = myCollection.findAnObject("foo");
x.bar = "blip";

"Don't you have to put x back into the collection after you modify it?"
"No, x is a reference. Its pointing to the same object inside the
collection."

Bill, not the actual Bill, just a reference. He's over there.
 
F

Francis Glassborow

Jussi Jumppanen said:
Is it possible to code anything without the concept of pointers?

To the best of my knowledge Cobol has no pointers and Cobol programmers
have no need of the concept (indeed many of them find the idea of a
pointer quite bizarre)
 
R

Rob Thorpe

Jussi said:
Is it possible to code anything without the concept of pointers?

Yes. Several programming languages have no concept of pointer that's
visible to the programmer. For example Lisp, Java and Perl have no
pointers. Perl has references which refer, somehow, to another perl
object - effectively equivalent to a pointer.

Lisp's don't have pointers per se. Each name in a lisp program and
almost everything else is "bound" to a piece of data of some type, and
can be freely rebound. Some of these data types can store sequences of
values. So, altogether there is no need for visible pointers.

(There are naturally tons of pointers in actual implementation, but
they're invisible to the programmer).
Like it or CPU's works with memory which means working with
pointers, any when things go wrong it will usually means a
pointer has gone astray.

Often yes, but not always, and not in languages where they can't go
astray. There remain plenty of things to go wrong without them though.
So like it or not I think a basic understanding of pointers
is essential when it comes to programming.

Yes, because it's how real machines work.
 
P

Patricia Shanahan

Victor said:
I didn't know it called them anything other than "objects"...

According to the Java Language Specification, it has objects and
references, and non-null references are pointers to objects:

"4.3.1 Objects
An object is a class instance or an array.

The reference values (often just references) are pointers to these
objects, and a special null reference, which refers to no object."

[http://java.sun.com/docs/books/jls/second_edition/html/typesValues.doc.html#12028]

Patricia
 
K

Keith Thompson

Victor Bazarov said:
I didn't know it called them anything other than "objects"...

It's remarkable, given the number of newsgroup to which this
discussion is inappropriately cross-posted, that Java isn't topical in
*any* of them.
 
R

Richard Tobin

Most certainly, in some languages. IIRC, Java has no pointers.
[/QUOTE]
Well actually it does (it just calls them references)

It doesn't *just* call them references. It strongly restricts what
you can do with them. C pointers have an important feature that makes
them very different from the references that Java and most other
languages have: they let the programmer perform address-like
arithmetic on them. You can't use a Java reference to step through an
array, or take the difference between two references.

(Not to mention the unportable but almost universal ability to
convert them to and from integers.)

-- Richard
 
R

Richard Bos

C pointers have an important feature
(Not to mention the unportable but almost universal ability to
convert them to and from integers.)

Actually, that ability itself _is_ portable and Standard. The resulting
numbers c.q. pointers are not, of course; however, a compiler that
doesn't allow you to cast a pointer to an integer or v.v. is not a C
compiler.

Richard
 
C

Christopher Benson-Manica

In comp.lang.c Francis Glassborow said:
To the best of my knowledge Cobol has no pointers and Cobol programmers
have no need of the concept (indeed many of them find the idea of a
pointer quite bizarre)

I think the idea of a Cobol programmer is quite bizarre :)
 
W

Walter Roberson

(e-mail address removed) (Richard Tobin) wrote:
Actually, that ability itself _is_ portable and Standard. The resulting
numbers c.q. pointers are not, of course; however, a compiler that
doesn't allow you to cast a pointer to an integer or v.v. is not a C
compiler.

C89 does not, however, promise that you can meaningfully convert
a pointer to an integral type and back again. K&R2 did have such
a promise, that the back-converted pointer would compare equal
to the original pointer, but that promise did not make it into C89.
 
J

J French

I think the idea of a Cobol programmer is quite bizarre :)

Just shows that you know nothing about COBOL
- I was surprized to find out what a full instruction set it had

I do not consider the use of SQL to be programming
 

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
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top