Reputation: 0 Apprentice
- New Members
- Active Posts:
- 6 (0.01 per day)
- 16-April 12
- Profile Views:
- Last Active:
- Apr 23 2012 04:11 AM
- Who Cares
- OS Preference:
- Favorite Browser:
- Who Cares
- Favorite Processor:
- Favorite Gaming Platform:
- Your Car:
- Who Cares
- Dream Kudos:
Posts I've Made
Posted 18 Apr 2012I see others already brought up LISP and AI so I won't rehash it. The best way to think about it is to think about how your mind works, or specfically the mind of a young child; what are they doing but modifying their source?
Posted 18 Apr 2012While language choice is important, I feel it's much more important to learn how to abstract ideas and principles separate from languages. Then when you have a problem, you can pick out which would be the most useful language to use.
Now for your questions. OOP is most useful for things that lend naturally to object abstraction such as games, graphical interfaces, and the like. Don's let OOP partisans convince you it's the One True Paradigm. Most of the time it'll only make things harder or more bug prone, especially if you try to apply the obhect metaphor to every little thing.
Next, avoid Java as your first language. It teaches to approach things with a "plumber in a hardware store" mentality. A side effect of being OO in my opinion, but that's just my own conjecture. It isn't too bad for fast production once you're knowledgable, but I avoid it. Also note that Java will never be as fast as C++ owing to being interpreted/JITed at best.
I can't comment on Ruby much but I'd say regardless that either Perl or Python would be better.
Avoid mangled languages (every Visual- and -Sharp language, .NET, anything else M$ put their filthy fingers in too), BASIC, Pascal, and reliance on IDEs. Grab a copy of the GCC toolchain and a nice text editor.
I'd recommend either Python or C/C++ as a good entry point. C/C++ is sufficiently low enough to teach you many useful things; C is the mother tongue of UNIX and is indispensible if you ever try system programming. Python is easy and powerful, and is the top dog of scripting.
As for other languages, Perl has its uses especially for small scripts, and a suitable stand-in for awk and sed. I also recommend Common LISP, the mother tongue of AI. Often what you do in other languages, CL can do it better and more elegantly; it's also great for learning and is powerful in many regards no other language can match.
Now as for the question regarding how fast you'll grow, read Norvig's essay "Teach Yourself Programming in 10 Years". Look into Eric S. Raymond's "The Art of Unix Programming" for some good points. And some good books are K&R or K&R2 and ANSI Common Lisp.
Posted 17 Apr 2012Then I guess my problem isn't the pointer, which means that my original question is now irrelevant.
The whole problem I tried to solve is why my code doesn't read into the dynamic allocation. It's set up to read the file twice, once to find out how much memory it'll need, then a second pass to read it into the dynamic memory. First pass is fine, then I do a seekg call to set it back to the top for the second pass which seems to fill the memory with empty characters.
JOAT, the way I'm doing it is pretty ugly admittedly. I'll probably rewrite everything later once it does what I want it to.
Posted 17 Apr 2012"str" is a char pointer, "buffer" a char variable, and "file" is an ifstream.
char *str, buffer; ifstream file;
I try to refrain from more than the simplest types as much as possible, so I am not using STL strings. It takes in a text file through "file".
And as to where I want to put the *, in the code in my first post it would be next to 'str' making it '*str'.
- Member Title:
- New D.I.C Head
- 20 years old
- September 17, 1993
- Programming Languages:
- C/C++,Common LISP
- Click here to e-mail me
zeroLOGIK hasn't added any friends yet.