|
|
|
|
|
|
| |
| |
|
|
|
|
| |
| |
|
|
On 7/29/2011 19:39, H. Karsten wrote:
> Maybe I should give myself a push and move-one to c++.
> As well I thought to go to Forth maybe, because of the stack, that makes it
> possible to get lots and lots of results, coming from just one function.
You know, as a novice programmer, I wouldn't go with either of those.
If you make a mistake in C++, it can be extremely confusing to figure out
where the mistake is. Just like C. And, indeed, Forth is just as bad in
that respect.(*) Both Forth and C++ are low-level powerful languages, full
of amazing capabilities, but easy to screw up in hard-to-fix ways.
I would recommend that if you want to learn something powerful as a first
step, you consider Python or perhaps Ruby. Once you're comfortable writing a
few hundred lines of code, or getting 1000 lines of your own code working
without giving up and tearing your hair out, you'll be in a much better
position to learn things that sacrifice easiness for speed. *Then* decide
whether you want to learn C++ so you can program system tools compatible
with everyone else, or learn Forth so you can write your own custom computer
languages easily, or whatever you want to do.
Smalltalk might also be a good choice, except that it's "strange" and
therefore might make learning things that are more "normal" difficult. For
example, Smalltalk pretends to be the entire operating system, so there's no
real concept of a Smalltalk "program".
(*) In spite of having written two Forth interpreters in assembly language,
I don't think I ever got a Forth procedure more than 5 lines long to work,
regardless of how long I tried to debug.
--
Darren New, San Diego CA, USA (PST)
How come I never get only one kudo?
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
On 7/29/2011 7:39 PM, H. Karsten wrote:
>
> Actually I've did a lot of little things, using Free-Basic. But that becomes to
> buggy, so I moved to Rebol than.
I myself have just started using FreeBASIC, because my brother might be
programming again and I wanted to find him a good BASIC dialect. While
it's great to just get a program up-and-running with gfx, input, etc.,
it's an absolutely horrible language in all other respects. It's been
maybe a week since I got into it, and I'm beginning to realize that any
advantages I thought it had over C are far outweighed by its manifold
problems.
> Maybe I should give myself a push and move-one to c++.
The basics of C++ aren't so hard to learn, and it's nice to know
exactly_what_data_types you are using. The code is much cleaner than any
BASIC. Just make sure you free up any memory you allocate, as you don't
need leaks.
With C's vector class, you can create easily-manipulated dynamic arrays.
And if I'm not mistaken, it cleans up after itself so you don't need to
call a destructor at the end of your code.
~Sam
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
stbenge <"egnebts <-inverted"@hotmail.com> wrote:
> The basics of C++ aren't so hard to learn, and it's nice to know
> exactly_what_data_types you are using. The code is much cleaner than any
> BASIC. Just make sure you free up any memory you allocate, as you don't
> need leaks.
You can get pretty far without ever writing a single 'new' (or 'malloc').
And if you never write a single 'new', you never have to write a single
'delete' either.
One of the major problems with people who start learning C++ for the
first time is that in many cases they come from either a C or a Java (or
similar) background, both of which have explicit dynamic allocation as a
central concept. People who have that kind of background often have a hard
time "unlearning" that. Hence the C++ code made by these people will be rife
with unneeded dynamic allocations (which make the whole program needlessly
complex and unsafe).
(Of course using 'new' is not the only way to easily screw up memory
management by mistake. If you start using pointers, or even iterators,
chances are that you are going make a mistake sooner or later. C++ is a
bit complicated like that.)
It can be difficult to teach/learn C++ in a way that the safe practices
are learnt first.
> With C's vector class, you can create easily-manipulated dynamic arrays.
Don't you mean C++'s?
--
- Warp
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
On 7/30/2011 12:23 PM, Warp wrote:
> stbenge<"egnebts<-inverted"@hotmail.com> wrote:
>
>> With C's vector class, you can create easily-manipulated dynamic arrays.
>
> Don't you mean C++'s?
Yes... I jumped straight to C++, which was probably a mistake since I
haven't clearly defined the differences between it and its predecessor
:| I'm guessing /the/ major difference is C++'s OOP capabilities,
without which the vector class couldn't be possible, right?
Despite having written a few programs, I'm still undereducated on the
whole subject. My biggest concern is to prevent memory leaks and
outright crashes. As for writing clean code... I still have yet to
finish one program that doesn't use global variables `:/
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
On 7/30/2011 14:08, stbenge wrote:
> I'm guessing /the/ major difference is C++'s OOP capabilities, without which
> the vector class couldn't be possible, right?
That and templates. The vector class isn't a class as much as it is a template.
--
Darren New, San Diego CA, USA (PST)
How come I never get only one kudo?
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
On 7/30/2011 11:30, stbenge wrote:
> great to just get a program up-and-running with gfx, input, etc., it's an
> absolutely horrible language in all other respects.
On that front, you could look into Tcl, or Java, or C#. If you're just
learning, I'd say C# is an excellent introduction to the C-like languages.
It has powerful development tools, "visual" builders to make input and forms
easy, portable file I/O stuff, fairly portable (if older) windowing stuff,
etc etc etc. I.e., it has an excellent development environment, along with
being a quite powerful language in the C family.
Tcl is really easy and portable with good I/O and graphics and stuff, but
it's so unlike other languages that what you learn there isn't really going
to apply to other systems as much, so it's probably not a real good first
language.
I'd stay away from "Visual Basic" or "VB.NET" myself. That's a rapidly
decaying body that the worms are still feasting on.
> The basics of C++ aren't so hard to learn,
It's annoying, tho, for a beginner. There are a large number of fairly
senseless rules that just become frustrating fairly quickly, not even
counting ho hard it can be to debug a fairly simple mistake like using an
uninitialized variable. It's like someone's learning to drive, and you give
them an 18-wheeler and say "this'll do everything, as soon as you learn the
14 different gears, and as long as you remember to hook up the air brakes
before you drive." I'd never start a student learning on their own with an
unsafe language that doesn't tell them when they've made a mistake.
--
Darren New, San Diego CA, USA (PST)
How come I never get only one kudo?
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Darren New <dne### [at] sanrrcom> wrote:
> That and templates. The vector class isn't a class as much as it is a template.
It's both. (Being a class is important because of RAII.)
--
- Warp
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Darren New <dne### [at] sanrrcom> wrote:
> I'd never start a student learning on their own with an
> unsafe language that doesn't tell them when they've made a mistake.
Using a good compiler with a good debug mode helps a lot. For example
VC++ adds bounds and other checks to all STL operations in debug mode,
as well as many other things. (gcc also has support for this, but
unfortunately it's such an obscure flag that a newbie will never find
it unless someone tells him.)
--
- Warp
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
On 7/31/2011 0:12, Warp wrote:
> Darren New<dne### [at] sanrrcom> wrote:
>> I'd never start a student learning on their own with an
>> unsafe language that doesn't tell them when they've made a mistake.
>
> Using a good compiler with a good debug mode helps a lot.
That's probably true. The only time I've really been using C or C++ lately
is in environments that were so sucky that's the best they could manage. :-)
I guess if you get a compiler that detects stuff like uninitialized
variables and you stay away from the native types that are most dangerous,
it probably wouldn't be too hard. I'm not sure why you *would* want to
start with something like that, mind.
When you gaze into the void, the void gazes back. When you cast into the
void, you get a type error, which just means Nietzsche wasn't a C programmer.
--
Darren New, San Diego CA, USA (PST)
How come I never get only one kudo?
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Ok, sorry for the delay first, I was off over the last days.
Well, after all of this very good information, I guess I try Ruby and go on from
that. My experience with C was only, using PovMan's shading language and I tried
Prosessing as well before (nice toy... ;)
Thanx for all hints, folks :)
Best rgds,
Holger
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
|
|