473,320 Members | 1,879 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,320 software developers and data experts.

Wanting to Learn

Hello All,

I would like to learn C, I have 0 programming experience. If anyone has
links to good tutorials It would be appreciated, especially stuff that can
be downloaded. I am in the military and will be spending the next year in
Iraq. I will have my laptop with me and will use my free time to learn,
but I will have no net access. So whatever I can get on my hard drive to
bring with would be appreciated. Thanks

Sgt Tim Apple
US Army
Nov 14 '05 #1
25 2267
Tim Apple <sg******@the-apples.com> wrote:
I would like to learn C, I have 0 programming experience.


Warning: C can be full of traps for the absolute beginner, especially
without a proper teacher. It _is_ possible to learn to be a good
programmer starting with C, but trying to do so on your own is asking
for trouble, especially from a web tutorial - most aren't very good.

It's wiser, IMO, to learn to be a good programmer first, and then learn
C. C assumes that the programmer knows what he's doing. Learning to
program is easier using a language that assumes you don't know what
you're doing. I personally suggest Pascal, but other people will
recommend other languages, most of whom I haven't tried, so can't judge.

Richard
Nov 14 '05 #2
* Thus spoke Tim Apple <sg******@the-apples.com>:

Hallo,
I would like to learn C, I have 0 programming experience. If anyone has
links to good tutorials It would be appreciated, especially stuff that can
be downloaded.


o <http://www.contrib.andrew.cmu.edu/~ajo/docs/FAQ-acllc.html#q6.2>
o <http://www.contrib.andrew.cmu.edu/~ajo/docs/FAQ-acllc.html#q7.1>
Wolfgang.
--
"I can remember the exact instant when I realized that a large part of my life
from then on was going to be spent in finding mistakes in my own programs."
-- Maurice Wilkes
Nov 14 '05 #3
On Wed, 04 Feb 2004 14:56:44 GMT, Tim Apple <sg******@the-apples.com>
wrote:
Hello All,

I would like to learn C, I have 0 programming experience. If anyone has
links to good tutorials It would be appreciated, especially stuff that can
be downloaded. I am in the military and will be spending the next year in
Iraq. I will have my laptop with me and will use my free time to learn,
but I will have no net access. So whatever I can get on my hard drive to
bring with would be appreciated. Thanks

Sgt Tim Apple
US Army


It's true that C and C++ aren't the best "first" programming
languages; you may be told by the compiler that you've done something
wrong, but you'll still have a lot of trouble knowing how to fix it.
(That's still true for me right now, actually, for template messages
in C++...)

If you do decide to tackle C, a couple of suggestions:

1), 2), 3), and 4) Find someone who already knows it that will let you
ask him/her questions. That's IMO by far the most important resource
you'll ever have.

5) Get a copy of K&R 2nd ed. , and then either "The C Answer Book"
(hard copy) or you can grab this site off the web (using, say,
TelePort Pro):
http://users.powernet.co.uk/eton/kandr2/

Do all the exercises yourself, then compare your solutions. If you
make it through all that, you'll know C pretty well ;-)
-leor
Leor Zolman
BD Software
le**@bdsoft.com
www.bdsoft.com -- On-Site Training in C/C++, Java, Perl & Unix
C++ users: Download BD Software's free STL Error Message
Decryptor at www.bdsoft.com/tools/stlfilt.html
Nov 14 '05 #4
Some of you are saying c is not the best language to start with pascal was
a recomendation, any others?

Sgt Tim Apple



On Wed, 04 Feb 2004 14:56:44 +0000, Tim Apple wrote:
Hello All,

I would like to learn C, I have 0 programming experience. If anyone has
links to good tutorials It would be appreciated, especially stuff that can
be downloaded. I am in the military and will be spending the next year in
Iraq. I will have my laptop with me and will use my free time to learn,
but I will have no net access. So whatever I can get on my hard drive to
bring with would be appreciated. Thanks

Sgt Tim Apple
US Army


Nov 14 '05 #5
Tim Apple wrote:
Some of you are saying c is not the best language to start with pascal
was a recomendation, any others?


Well, what do you want to do? I know a lot of military people who are
trying to figure out what to do afterwards, and they choose to get into
programming. Is this you?

There are a lot of things to consider, specially the type of programming
that you want to get into. If you would like to tinker with "system" stuff
like operating systems, very scientific algorithms, or you would like to
squeeze out every possible bit of performance out of the processor (and who
cares if it takes a year to write), then C is a great place to start.

If you would like to learn computer science in general, then I would start
out with C#, Java, or Delphi, but only because, as others said, starting in
C without a mentor nearby is suicide.

If you want to write GUI programs with the nice screens and friendly
interfaces, database access, and rapid development, then you would do
better to go to the anti-Christ (at least in this group) sort of
technologies (Microsoft Visual Basic, or .NET), or a more sensible choice
which is Delphi (Borland's Object-Oriented Pascal). The focus in these
kinds of languages is to let you put something out the door quicker,
looking nicer, and you did not spend a long time producing it. Also, when
writing with these kinds of languages and compilers, you concentrate more
on _what_ you are solving rather than _how_ you are solving it.

--
gabriel
Nov 14 '05 #6
Tim Apple wrote:
Some of you are saying c is not the best language to start with pascal was
a recomendation, any others?

Sgt Tim Apple


#include <evangelism/python.h>

Python is a simple but powerful (in term of what you can do, not of
execution speed !-) language that may be a good choice for absolute
beginners, since
- the syntax is clear and readable
- the language supports many paradigms (procedural - as C and Pascal-,
object - as C++ and Java and... -, functional - as Lisp, ML etc)
- it comes with an interpreter and a shell, so you can test code in
'real time'
- there are some Python tutorials for absolute beginners.

http://www.python.org

Well, it's quite a good replacement for grand dad's basic, and you can
also use it to write real, non trivial, working apps.

Now it won't learn you the low-level details of memory management and
the like...

My 2 cents
Bruno

Nov 14 '05 #7
Tim Apple wrote:
Some of you are saying c is not the best language to start with pascal was
a recomendation, any others?


Python was recommended as well. Perhaps the ideal learning path would
consist of a couple of months Python (which is an interpreted language
without strongly typed variables), followed by a transition to the much
stricter Pascal. This would give you a great deal of insight into the
relative strengths and weeknesses of both types of languages.

After mastering Pascal you will be ready to take on C. It has many more
'degrees of freedom', i.e. it is (somewhat) more powerful, but it is
also much harder to use properly.

For Pascal, I'd recommend you get your hands on Turbo Pascal 7, which is
very old, but it was /way/ ahead of its time. As a didactic device, I
think the environment (with the integrated debugger) cannot be beaten.

Turbo Pascal is a superset of Pascal by the way, meaning that you get
many (sensible!) extensions to plain (ISO) Pascal.
Have a good mission and a safe return.
Best regards,

Sidney

Nov 14 '05 #8
Tim Apple wrote:
I would like to learn C, I have 0 programming experience.


Tim...

Then go for it! Everyone has to start somewhere. You'll need
access to a computer with a C compiler and some reading material.
Start by writing tiny, simple programs and work your way up to
larger, more complex, programs.

Feel free to make mistakes - you'll probably learn more from
those than from any other single source.

You've already found comp.lang.c - feel welcome to come here for
help with any C difficulties you might have.

My sig has a link to a page of links for beginners. Take time to
read about asking smart questions and the comp.lang.c welcome and
FAQ pages.

There's info there that'll help you download a free C compiler if
you don't have one available.

--
Morris Dovey
West Des Moines, Iowa USA
C links at http://www.iedu.com/c
Read my lips: The apple doesn't fall far from the tree.

Nov 14 '05 #9

"Tim Apple" <sg******@the-apples.com> wrote in message
news:pa****************************@the-apples.com...
Hello All,

I would like to learn C, I have 0 programming experience. If anyone has
links to good tutorials It would be appreciated, especially stuff that can
be downloaded. I am in the military and will be spending the next year in
Iraq. I will have my laptop with me and will use my free time to learn,
but I will have no net access. So whatever I can get on my hard drive to
bring with would be appreciated. Thanks

Sgt Tim Apple
US Army


Tim, get a good C book with lots of examples, and a free (or non-free) C
compiler.
One book which I used many years ago, when I started learning C, was
'Mastering Turbo C' by Tenanbaum. It has lots of good examples. Others may
have better advices for books, though.

HTH
-Ashish
Nov 14 '05 #10
Sidney Cadot wrote:
Tim Apple wrote:
Some of you are saying c is not the best language to start with pascal was
a recomendation, any others?


Python was recommended as well. Perhaps the ideal learning path would
consist of a couple of months Python (which is an interpreted language
without strongly typed variables), followed by a transition to the much
stricter Pascal. This would give you a great deal of insight into the
relative strengths and weeknesses of both types of languages.

After mastering Pascal you will be ready to take on C. It has many more
'degrees of freedom', i.e. it is (somewhat) more powerful, but it is
also much harder to use properly.

For Pascal, I'd recommend you get your hands on Turbo Pascal 7, which is
very old, but it was /way/ ahead of its time. As a didactic device, I
think the environment (with the integrated debugger) cannot be beaten.

Turbo Pascal is a superset of Pascal by the way, meaning that you get
many (sensible!) extensions to plain (ISO) Pascal.


In the interests of accuracy, TP is not a superset, it is a
subset, with many extensions. It has very serious omissions of
standard Pascal capabilities. The extensions introduce many
insecurities, but you don't have to use them. Unfortunately it
won't tell you what IS standard and what is extension.

--
Chuck F (cb********@yahoo.com) (cb********@worldnet.att.net)
Available for consulting/temporary embedded and systems.
<http://cbfalconer.home.att.net> USE worldnet address!
Nov 14 '05 #11
Sidney Cadot wrote:
Tim Apple wrote:
Some of you are saying c is not the best language to start with pascal
was
a recomendation, any others?

Python was recommended as well. Perhaps the ideal learning path would
consist of a couple of months Python (which is an interpreted language
without strongly typed variables),


<ot topic='python'>
Er... I would not start the Standard Holy War n°2 (tm) [1], but just a
correction : Python *is* strongly typed [2] - but dynamically. Which
means that the type is bound to the object, not to the id the object is
bound to.

[1] which is "dynamic vs static typing"
[2] You just can't add a string, an integer and a list together, this
would raise an exception.

</ot>

(snip the rest)

Bruno

Nov 14 '05 #12
Bruno Desthuilliers wrote:
Sidney Cadot wrote:
Tim Apple wrote:
Some of you are saying c is not the best language to start with
pascal was
a recomendation, any others?


Python was recommended as well. Perhaps the ideal learning path would
consist of a couple of months Python (which is an interpreted language
without strongly typed variables),

<ot topic='python'>
Er... I would not start the Standard Holy War n°2 (tm) [1], but just a
correction : Python *is* strongly typed [2] - but dynamically. Which
means that the type is bound to the object, not to the id the object is
bound to.

[1] which is "dynamic vs static typing"
[2] You just can't add a string, an integer and a list together, this
would raise an exception.

</ot>


Your terminology is, indeed, less prone to confusion. However, it is
debatable what "strongly typed language" really means; personally, I
take it to be equivalent to what you call a "statically typed" language.

If someone else has a different idea, I'd love to hear it; I'd also like
to see examples of non-strongly-typed languages, for an alternative
definition.

Best regards,

Sidney

Nov 14 '05 #13
Sidney Cadot wrote:
Bruno Desthuilliers wrote:
Sidney Cadot wrote:
(snip)
Python was recommended as well. Perhaps the ideal learning path would
consist of a couple of months Python (which is an interpreted
language without strongly typed variables),
<ot topic='python'>
Er... I would not start the Standard Holy War n°2 (tm) [1], but just a
correction : Python *is* strongly typed [2] - but dynamically. Which
means that the type is bound to the object, not to the id the object
is bound to.

[1] which is "dynamic vs static typing"
[2] You just can't add a string, an integer and a list together, this
would raise an exception.

</ot>


Your terminology is, indeed, less prone to confusion. However, it is
debatable what "strongly typed language" really means;


Indeed. The meaning of a whole lot of things is debatable.
What about : "a strongly typed language is a language that won't let you
add an integer and a string" ?-)
personally, I
take it to be equivalent to what you call a "statically typed" language.
And you're wrong - at least with the above definition.
If someone else has a different idea, I'd love to hear it;
You did !-)
I'd also like
to see examples of non-strongly-typed languages, for an alternative
definition.


<no-holy-war-please>

You've got one right here : the C programming language.

[laotseu@localhost fclc]$ cat add.c

int main(void)
{
int z;
char *y;
int a = 10;
char *b = "30";
a + b;
z = a + b;
y = a + b;
return 0;
}
[laotseu@localhost fclc]$ gcc -Wall -ansi -pedantic add.c
add.c: In function `main':
add.c:9: warning: assignment makes integer from pointer without a cast
add.c:8: warning: statement with no effect
[laotseu@localhost fclc]$
Well... As you can see, adding an integer and a char pointeur is not a
problem for gcc.
Now in python :

[laotseu@localhost fclc]$ python
Python 2.3.2 (#1, Oct 27 2003, 01:23:54)
a = 10
b = "30"
a + b Traceback (most recent call last):
File "<stdin>", line 1, in ?
TypeError: unsupported operand type(s) for +: 'int' and 'str'


Now here you just *can't* add an integer and a string.

</no-holy-war-please>

Ok, I know, I gave a *really* debatable definition of "strongly typed",
and one that did fit my needs. Call me a cheater if you want (time to
put my bullet-proof jacket on, I think).

Bruno

Nov 14 '05 #14
In article <40***********************@news.free.fr> Bruno Desthuilliers <bd*****************@free.quelquepart.fr> writes:
Sidney Cadot wrote:

....
Your terminology is, indeed, less prone to confusion. However, it is
debatable what "strongly typed language" really means;


Indeed. The meaning of a whole lot of things is debatable.
What about : "a strongly typed language is a language that won't let you
add an integer and a string" ?-)


Would make Algol 68 a weakly-typed language if you add the following
declaration:
'op'('int','string') + = (('int' i, 'string' s): i);
(Darn, I am forgetting the syntax, the above is probably not entirely
correct.)

But have a look at <http://c2.com/cgi/wiki?StronglyTyped>, I personally
prefer definition 8. Python does not satisfy quite a few of those 8
definitions.
--
dik t. winter, cwi, kruislaan 413, 1098 sj amsterdam, nederland, +31205924131
home: bovenover 215, 1025 jn amsterdam, nederland; http://www.cwi.nl/~dik/
Nov 14 '05 #15
Tim Apple wrote:
Hello All,

I would like to learn C, I have 0 programming experience. If anyone has
links to good tutorials It would be appreciated, especially stuff that can
be downloaded. I am in the military and will be spending the next year in
Iraq. I will have my laptop with me and will use my free time to learn,
but I will have no net access. So whatever I can get on my hard drive to
bring with would be appreciated. Thanks

Sgt Tim Apple
US Army


Sgt. Apple,

In much appreciation of your willingness to serve in the armed forces to
protect the citizens (myself a citizen of this great nation) of this
nation, I am willing to send you a book from my personal library as a
small token of my appreciation.

The book is titled C How to Program 2nd edition and is written by
H.M.Deitel and P.J. Deitel. It is a paperback text with an ISBN number
of 0-13-226119-7 in case you want to look at it on amazon.com or another
book seller online.

This is the text I used when I took my first programming class and I
thought it was a pretty good book.

If you are interested, please write me at re******@yahoo.com.

Thank you, Best Wishes, and God Speed.

Sincerely,

Jason Smith
Nov 14 '05 #16
Dik T. Winter wrote:
In article <40***********************@news.free.fr> Bruno Desthuilliers <bd*****************@free.quelquepart.fr> writes:
> Sidney Cadot wrote:

...
> > Your terminology is, indeed, less prone to confusion. However, it is
> > debatable what "strongly typed language" really means;

>
> Indeed. The meaning of a whole lot of things is debatable.
> What about : "a strongly typed language is a language that won't let you
> add an integer and a string" ?-)


Would make Algol 68 a weakly-typed language if you add the following
declaration:
'op'('int','string') + = (('int' i, 'string' s): i);
(Darn, I am forgetting the syntax, the above is probably not entirely
correct.)

But have a look at <http://c2.com/cgi/wiki?StronglyTyped>, I personally
prefer definition 8. Python does not satisfy quite a few of those 8
definitions.


Nice page. It is strange to see that a term that is so often used seems
to lack a proper definition.

Anyway, an excuse for me using "strongly typed", originally, is that I
used it to refer to "variables", not the "language".

Best regards,

Sidney

Nov 14 '05 #17
Dik T. Winter wrote:
But have a look at <http://c2.com/cgi/wiki?StronglyTyped>, I personally
prefer definition 8. Python does not satisfy quite a few of those 8
definitions.


Neither does C! C fails to satisfy at least the following:

4. A language is strongly typed if conversions between different
types are forbidden. If such conversions are allowed, it is
weakly typed.

5. A language is strongly typed if conversions between different
types must be indicated explicitly. If implicit conversions are
performed, it is weakly typed.

6. A language is strongly typed if there is no language-level way
to disable or evade the type system. If there are casts or
other type-evasive mechanisms, it is weakly typed.

8. A language is strongly typed if the type of its data objects is
fixed and does not vary over the lifetime of the object. If the
type of a datum can change, the language is weakly typed.

Is there /any/ language that forbids "conversions between different
types" unconditionally?

Jeremy.
Nov 14 '05 #18
Jeremy Yallop <je****@jdyallop.freeserve.co.uk> wrote:
Dik T. Winter wrote:
But have a look at <http://c2.com/cgi/wiki?StronglyTyped>, I personally
prefer definition 8. Python does not satisfy quite a few of those 8
definitions.


Neither does C! C fails to satisfy at least the following:

4. A language is strongly typed if conversions between different
types are forbidden. If such conversions are allowed, it is
weakly typed.

5. A language is strongly typed if conversions between different
types must be indicated explicitly. If implicit conversions are
performed, it is weakly typed.


_Every_ language must, inevitably, fail at least one of the above -
they're mutually exclusive. I think you're supposed to pick the one you
prefer, not take them all at once.

Richard
Nov 14 '05 #19
In article <sl*******************@hehe.cl.cam.ac.uk> Jeremy Yallop <je****@jdyallop.freeserve.co.uk> writes:
Dik T. Winter wrote:
But have a look at <http://c2.com/cgi/wiki?StronglyTyped>, I personally
prefer definition 8. Python does not satisfy quite a few of those 8
definitions.
Neither does C! C fails to satisfy at least the following:

.... 8. A language is strongly typed if the type of its data objects is
fixed and does not vary over the lifetime of the object. If the
type of a datum can change, the language is weakly typed.


In what way does C fail here?
--
dik t. winter, cwi, kruislaan 413, 1098 sj amsterdam, nederland, +31205924131
home: bovenover 215, 1025 jn amsterdam, nederland; http://www.cwi.nl/~dik/
Nov 14 '05 #20
Dik T. Winter wrote:
In article <sl*******************@hehe.cl.cam.ac.uk> Jeremy Yallop <je****@jdyallop.freeserve.co.uk> writes:
Dik T. Winter wrote:
But have a look at <http://c2.com/cgi/wiki?StronglyTyped>, I personally
prefer definition 8. Python does not satisfy quite a few of those 8
definitions.


Neither does C! C fails to satisfy at least the following:

...
8. A language is strongly typed if the type of its data objects is
fixed and does not vary over the lifetime of the object. If the
type of a datum can change, the language is weakly typed.


In what way does C fail here?


In that the connection between object and type in C is very weak.
Objects are almost typeless: the type of the expression used to access
the object is the important thing. This is particularly apparent in
the case of the objects for which malloc allocates space:

int max(int x, int y) { return x > y ? x : y; }

void *pv = malloc(max(sizeof(double), sizeof(int)));
sin(*(double *)pv = 3.5); /* the object "has" type double */
abs(*(int *)pv = 3); /* the object "has" type int */

Jeremy.
Nov 14 '05 #21
Dik T. Winter wrote:
In article <40***********************@news.free.fr> Bruno Desthuilliers <bd*****************@free.quelquepart.fr> writes:
> Sidney Cadot wrote: ...
> > Your terminology is, indeed, less prone to confusion. However, it is
> > debatable what "strongly typed language" really means;

>
> Indeed. The meaning of a whole lot of things is debatable.
> What about : "a strongly typed language is a language that won't let you
> add an integer and a string" ?-)


Would make Algol 68 a weakly-typed language if you add the following
declaration:
'op'('int','string') + = (('int' i, 'string' s): i);
(Darn, I am forgetting the syntax, the above is probably not entirely
correct.)


Sorry, but Algol 68 is not part of my (small) knowledge !-)
But have a look at <http://c2.com/cgi/wiki?StronglyTyped>
Interesting link, thanks
, I personally
prefer definition 8.
"A language is strongly typed if the type of its data objects is fixed
and does not vary over the lifetime of the object. If the type of a
datum can change, the language is weakly typed."

Well... Almost true for Python ('almost' because it's technically
possible to change the class of an object at runtime, but this is more
of a trick than common use).
Python does not satisfy quite a few of those 8
definitions.


Is there any way that a language could satisfy the 8 (more or less
mutually exclusives) definitions ?

Language & type theory is really a domain worth of interest. Could
anyone here recommend some good online resource on that subject, so I
have a chance to become a little less stupid before I die ?

Bruno

Nov 14 '05 #22
In article <40***********************@news.free.fr> Bruno Desthuilliers <bd*****************@free.quelquepart.fr> writes:
Dik T. Winter wrote:

....
, I personally
prefer definition 8.


"A language is strongly typed if the type of its data objects is fixed
and does not vary over the lifetime of the object. If the type of a
datum can change, the language is weakly typed."

Well... Almost true for Python ('almost' because it's technically
possible to change the class of an object at runtime, but this is more
of a trick than common use).


Certainly not true for Python:
a = "1234"
a = 1.5
is valid, it would not be when it was strongly typed according to
definition 8.
--
dik t. winter, cwi, kruislaan 413, 1098 sj amsterdam, nederland, +31205924131
home: bovenover 215, 1025 jn amsterdam, nederland; http://www.cwi.nl/~dik/
Nov 14 '05 #23
Dik T. Winter wrote:
In article <40***********************@news.free.fr> Bruno Desthuilliers <bd*****************@free.quelquepart.fr> writes:
> Dik T. Winter wrote:

...
> >, I personally
> > prefer definition 8.

>
> "A language is strongly typed if the type of its data objects is fixed
> and does not vary over the lifetime of the object. If the type of a
> datum can change, the language is weakly typed."
>
> Well... Almost true for Python ('almost' because it's technically
> possible to change the class of an object at runtime, but this is more
> of a trick than common use).


Certainly not true for Python:
a = "1234"
a = 1.5
is valid, it would not be when it was strongly typed according to
definition 8.


You seem to equate "data object" with "variable", no? I'd call "1234"
and 1.5 data objects (that have fixed types). An assignment in Python
just provides a binding of a name to a data object, at least that's how
I view it.

Best regards,

sidney

Nov 14 '05 #24
Dik T. Winter wrote:
In article <40***********************@news.free.fr> Bruno Desthuilliers <bd*****************@free.quelquepart.fr> writes:
> Dik T. Winter wrote:

...
> >, I personally
> > prefer definition 8.

>
> "A language is strongly typed if the type of its data objects is fixed
> and does not vary over the lifetime of the object. If the type of a
> datum can change, the language is weakly typed."
>
> Well... Almost true for Python ('almost' because it's technically
> possible to change the class of an object at runtime, but this is more
> of a trick than common use).


Certainly not true for Python:
a = "1234"
a = 1.5
is valid, it would not be when it was strongly typed according to
definition 8.

Yes it is :
"A language is strongly typed if the type of its data objects is fixed,
and does not vary over the lifetime of the object."

The definition does say 'object', not 'identifier referencing an object'.

Python 2.3.2 (#1, Oct 27 2003, 01:23:54)
type("foo") <type 'str'> type(42) <type 'int'> a = "foo"
b = 42
type(a) <type 'str'> type(b) <type 'int'> a, b = b, a #swap bindings
type(a) <type 'int'> type(b)

<type 'str'>

As you see, neither the type of "foo" nor the type of 42 have changed.
In Python type info are bound to the object itself, the identifier being
nothing more than... you guessed, an identifier. This does not mean that
the object itself is typeless.

But with your permission, I'll stop here because this is totally OT on
clc !-)

Nov 14 '05 #25
In article <c0**********@news.tudelft.nl> Sidney Cadot <si****@jigsaw.nl> writes:
Dik T. Winter wrote:
In article <40***********************@news.free.fr> Bruno Desthuilliers <bd*****************@free.quelquepart.fr> writes:
> Dik T. Winter wrote:

...
> >, I personally
> > prefer definition 8.
>
> "A language is strongly typed if the type of its data objects is fixed
> and does not vary over the lifetime of the object. If the type of a
> datum can change, the language is weakly typed."
>
> Well... Almost true for Python ('almost' because it's technically
> possible to change the class of an object at runtime, but this is more
> of a trick than common use).


Certainly not true for Python:
a = "1234"
a = 1.5
is valid, it would not be when it was strongly typed according to
definition 8.


You seem to equate "data object" with "variable", no?


No. It depends on how you define "data object", but that is another
discussion. Algol 68 had the clearest distinction between what was
a variable and what was a constant, this distinction is a bit blurred
in other languages. So if I wrote 1, it would be an object of type
int. If I wrote the declaration "int" a;, 'a' would be an object of
type "ref" "int". (Actually, "int" a; was a short-cut for the more
formal "ref" "int" a = "loc" "int", meaning that 'a' was a variable that
could hold values of type int, local to the enclosing construct.) (And
such would make all discussion about l-value irrelevant.) So in this,
the Python statement:
a = "1234"
creates a data object of type "ref" "string" to which is assigned an
object of type "string". Stating later
a = 1.5
makes 'a' a data object of type "ref" "float", a change of type.

This reference stuff in Algol 68 made it abundantly clear which assignments
were allowed and which were not. But we are seriously getting off-topic.
--
dik t. winter, cwi, kruislaan 413, 1098 sj amsterdam, nederland, +31205924131
home: bovenover 215, 1025 jn amsterdam, nederland; http://www.cwi.nl/~dik/
Nov 14 '05 #26

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

Similar topics

17
by: Rob | last post by:
i know javascript, vbscript, asp css and alot more and im only 14 i was wondering which is easier to learn php or cgi. any help?
13
by: Zeljko Vrba | last post by:
Now, why would I like to learn Python: because of IronPython port to CLR. Perl port to CLR doesn't seem to be coming soon. First Perl6 for Parrot has to be written, and then other backends.. ...
64
by: Chris Rodriguez | last post by:
after creating a couple of mediocre sites and talking too much about them, i've been overwhelmed w/ requests for new sites & site make-overs. i have a full-time job and i don't have the time or...
2
by: James Walker | last post by:
I am an experienced c++ programmer and I have done most of my c++ programming with .net as console or directx programs. I want to learn windows programming and make quality applications going...
7
by: arsl89 | last post by:
hy gys i m wanting python programming language. plz snd me the backup of python
31
by: anand devarajan | last post by:
hi friends, im anand im just a beginner in c learning for the past two weeksnow i can write simple prgs can anyone help me to get well known to c lang so that i should able to write even tough...
65
by: Chris Carlen | last post by:
Hi: From what I've read of OOP, I don't get it. I have also found some articles profoundly critical of OOP. I tend to relate to these articles. However, those articles were no more objective...
3
scubak1w1
by: scubak1w1 | last post by:
Hello, I am wanting a "pretty output" of tabular data generated on the fly and saved in an array (PHP)... That is, I have a link so users can chart (JpGraph) and download (CSV) tabular data,...
4
raubana
by: raubana | last post by:
...yeah, I already know some 'action script' (Flash programing) and I definetly know some Python, so I think I'm ready to learn Java. The problem is I don't know where to start. So what should I do
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.