PDA

View Full Version : Programming - Where do I start?


Seph
04-14-2003, 09:06 PM
please delete

GnuVince
04-14-2003, 09:30 PM
IMO, someone starting programming should probably select a simple, high-level language with a top-level loop to test commands interactively. Languages which fit this description: Python (most recommended), Ruby, Lisp, Scheme. You should start by writing command-line applications, because they are more simple than GUI applications.

gufmn
04-14-2003, 09:39 PM
I'm not sure jumping into programming with a specific goal(like building a web control panel)is the best way to approach it. Without learning the basics, such a task could end up causing much frustration. I would suggest(like many others here would)starting out with python. It's easy to learn and very powerful. Once you get a feel for coding in general, then start looking into other languages. Since you seem to be driven to write web apps, I would say PHP might be usefull for you(although I haven't played with it myself). Eventually all the pieces will start coming together and writing a control panel won't seem so far out of reach.

</2 cents>

Seph
04-14-2003, 10:06 PM
please delete

GnuVince
04-14-2003, 10:31 PM
#1. Downloading Python and learning how to program it.
#2. Read through the PHP manual and write basic web programs.
#3. Buy a good book about C++ and begin programming. Perhaps even going back to fully learn all of Python and PHP.
#4. Years from now and after having experience in C++ I could start learning assembly.


Forget 2, 3 and 4 for now. Think about Python for now, maybe when you master it, you will find another path that you find more interesting.


Originally posted by Seph

1. In a game how and why is it written in multiple programming languages? In that thread people were saying that games were made with C++ and ASM.


They use C or C++ (and even ASM) for the core of the game, to get the maximum speed, but the biggest chunk of the game is done in a scripting language to ease development.


2. Is there any way to load a Python program in Windows? Meaning is there any way to use it outside of the GUI programs that comes with the download and installation of Python. Can you compile Python?


Yes, there are ways to compile Python. Free is py2exe. I recall hearing about a commercial product, but can't remember the name


3. Will all C++ code I try out in Windows work on Linux?


No.


4. What book series would you recommend? Do you think that O Reilly is good?


O'Reilly is very good. Wrox is good for PHP stuff.


5. Are there any good free C++ compilers?

gcc, TenDRA.

Seph
04-14-2003, 10:35 PM
please delete

GnuVince
04-15-2003, 12:10 AM
Originally posted by Seph
Thanks for quoting my post, that was quite organized.

1. What type of path would you recommend instead of going towards PHP and C++?


I am not suggesting anything, you will find your own path. But if you say "I want to learn Python and PHP, then C++, then Assembly so that in 6 years I can make a game", you should concentrate on the present. Do things with Python, maybe something will spark your interest and C++ is not the lanugage (AI, or whatnot).


2. Well, is C++ syntax the same for Windows and Linux or are they much different? [/B]

Oh, syntax-wise they are identical, but a program that compiles on Windows, unless very trivial or sticking very much to ANSI standards, won't compile on Linux.

Seph
04-15-2003, 07:46 AM
please delete

Ludootje
04-16-2003, 03:36 PM
Originally posted by Seph
3. What C++ compiler would you recommend?
Assuming you mean for GNU/Linux and not windows: gcc

Ludootje
04-16-2003, 03:37 PM
Originally posted by GnuVince
IMO, someone starting programming should probably select a simple, high-level language with a top-level loop to test commands interactively. Languages which fit this description: Python (most recommended), Ruby, Lisp, Scheme. You should start by writing command-line applications, because they are more simple than GUI applications.
Lisp is high-level? I thought all old languages were pretty much more low-level then newer ones like python etc, am I completely wrong here?

Seph
04-16-2003, 04:11 PM
please delete

gish
04-16-2003, 05:18 PM
tons of errose cause of bad syntax...the IDE is one of the most popular for the windows environment.

inkedmn
04-17-2003, 07:48 PM
IDE's suck. use gvim in windows :)

GnuVince
04-17-2003, 07:56 PM
Originally posted by Ludootje
Lisp is high-level? I thought all old languages were pretty much more low-level then newer ones like python etc, am I completely wrong here?

I'd argue that Lisp is even higher-level than Python. Here are some thing they both have:
- Garbage collection
- Higher-order functions (also called first-class functions)
- OO (though CLOS is more advanced that Python's OO)
- Dynamic typing

But Lisp has something that Python doesn't: macros. Macros are basically programs that write programs. For instance, Common Lisp does not have a while operator. But using macros it is possible to write that new operator. You could also write your own OOP system with them and many other things that are usually impossible or very hard in other lanugages. Macros are something you find only in Lisp (and Scheme).

Ludootje
04-18-2003, 09:59 AM
Why doesn't Lisp have a while operator? After all, it can be very useful and I suppose there aren't tons of ways to write one, no? So I guess everyone using Lisp writes pretty much the same operator over and over again...
But I do get your point, thanks for explaining :)

Seph
04-18-2003, 11:25 AM
please delete

inkedmn
04-18-2003, 11:57 AM
Originally posted by Ludootje
Why doesn't Lisp have a while operator?

functional languages don't have looping constructs, they use recursion instead...

GnuVince
04-18-2003, 07:18 PM
Originally posted by Ludootje
Why doesn't Lisp have a while operator? After all, it can be very useful and I suppose there aren't tons of ways to write one, no? So I guess everyone using Lisp writes pretty much the same operator over and over again...
But I do get your point, thanks for explaining :)

Like inkedmn pointed out, Common Lisp is a functional lanugage and most people prefer to use recursion. So instead of this:


(defun fact (n)
(let ((ans 1)
(i 1))
(while (/= i n)
(setf ans (* ans i))
(setf i (1+ i)))
(ans)))


Lisp programmers write this:

(defun fact (n)
(if (<= n 1)
1
(* n (fact (1- n)))))


Or, the tail-recursive version (to avoid stack overflows):

(defun fact (n)
(labels ((fact/tr (acc n)
(if (<= n 1)
acc
(fact/tr (* n acc) (1- n)))))
(fact/tr 1 n)))

file13
04-21-2003, 11:28 AM
Originally posted by Ludootje
Why doesn't Lisp have a while operator?

it does! the loop macro:

a similar question was just posted in usenet and it got a nice answer:

http://groups.google.com/groups?dq=&hl=en&lr=&ie=UTF-8&frame=right&th=6af2c653c0b28b62&seekm=xcv65p8nysb.fsf%40apocalypse.OCF.Berkeley.EDU#link1


(loop do some-code
while test)


some Lisp hackers don't like the "loop" macro (like Paul Graham), but other love it.

also check out he do-while macro by kenny hilton. this is why Lisp hackers call Lisp a "Programmable programming language" since you can hack with the syntax quite easily. :D

Ludootje
04-26-2003, 03:01 PM
thanks for the explanations people, but I don't really get it since I don't know what 'functional languages' and 'recursion', but that's no problem, I understood most stuff anyway with the usenet thread etc :)

Seph: if you need help with finding a compiler because Dev C++ gives you errors, you should post your code I think so people can see what's wrong with it.