Good for referencing, but as far as learning? Learn by doing. Get in the code, tear things up, and fix them. Once you do that for a good while, you'll start understanding how things reference one another, and how they work. Your going to get mad, your going to get frustrated, and you'll lose sleep, but after a few years and some practice and dedication, you'll get there.
char *str; printf(Enter the string: ); scanf(%s,str); printf(\n%s,str);
Yeah, that's a guarenteed seg-fault right there.
C is not the best language to teach yourself programming, if you have absolutely no experience. It is very unforgiving. I'd actually suggest learning the basic ideas in a more modern language like ruby or python, or C# if you're using Windows. Once you're familiar with basic concepts like conditionals, loops, arrays, structures, etc… then pointers won't be so painful.
If the OP had an instructor, I'd say C or even assembly language is a great choice, because it teaches you how the machine actually does things, which makes it easier to understand coding in general.
C is not the best language to teach yourself programming, if you have absolutely no experience. It is very unforgiving. I'd actually suggest learning the basic ideas in a more modern language like ruby or python, or C# if you're using Windows.
I would actually agree with this. I started in C, as did many people in the MUD community. Its unforgiving nature can make you a great programmer, if you have the time and patience to suffer through the miserable and torturous learning process it inflicts upon you. However, there weren't a lot of alternatives in the 90s (and earlier). People starting these days have a wealth of options and resources. There's no need to suffer like that.
Likewise, I would not recommend new programmers learning from C++ or LPC. Ruby would be my recommendation, but that's partly personal bias against Python and C#.
I realize this was before my time, but I always understood it to be: Ada, Fortran, and Cobol as the choices before C. And Ada was really only chosen if dealing with the government.
But that could be prejudice with the programmers I talked to since I didn't live in that era.
However, there weren't a lot of alternatives in the 90s (and earlier).
Do you mean in muds specifically? It seems like if anything there were a lot moreoptions before C got popular.
In the context of what I wrote, I was referring to a lack of non-painful language alternatives (does someone here want to argue for Fortran or Cobol? maybe LISP!?), and freely available learning resources. And if you further narrow the context to learning programming for MUDs in the 90s, we're really only talking about C and LPC.
In the context of what I wrote, I was referring to a lack of non-painful language alternatives (does someone here want to argue for Fortran or Cobol? maybe LISP!?), and freely available learning resources. And if you further narrow the context to learning programming for MUDs in the 90s, we're really only talking about C and LPC.
Yes, I would argue for Lisp! :)
Your point about learning resources is a good one though. I just brought it up because I've been reading a pretty interesting book of interviews with programmers, most of whom came up in the 70s-80s, and there were a few comments that the language landscape in the 80s was richer than many people now assume. Then C really started to dominate.
Sadly, I did write a basic MUD in Lisp once for an undergrad assignment. I still haven't fully recovered my sanity.
02 May, 2013, Rarva.Riendf wrote in the 13th comment:
Votes: 0
Lisp is fine, coded Tetris on my HP48 with it. Still was hell better than the basic I had on my casio fx 850p :)
04 May, 2013, SteveThing wrote in the 14th comment:
Votes: 0
Another great option if you're using Windows is an interpreted language (a script that runs line by line) called AutoIt. The benefits here are:
* Don't need to worry about variable types since they are all the same. (i.e. an integer or a string can be saved to the same variable) * Immediate results with minimal "core" code. A few functions, variables, and boom, you've got a GUI * You can automate actual Windows actions like mouse movement and keystrokes. Such as automate opening notepad and writing text in it! * Strong help files, communities, and tutorial programs to teach you how to code * The development software (IDE) has syntax highlighting, debugging, and compiling all build in! It's called SCiTE.
EDIT: You can even compile you program and use it on ANY Windows system without needing extra files. Just one EXE.
I realize this was before my time, but I always understood it to be: Ada, Fortran, and Cobol as the choices before C. And Ada was really only chosen if dealing with the government.
The first MUD was written in PDP assembly. A few other early muds were written in Pascal. Pascal was very popular on VAX/VMS minicomputers and IBM microcomputers. Ada and COBOL were primarily used on mainframes which generally were not connected to the early internet. It is somewhat surprising that Fortran was (to my knowledge) never used, because it was commonly available on the Unix and VMS systems used in university settings.
I realize this was before my time, but I always understood it to be: Ada, Fortran, and Cobol as the choices before C. And Ada was really only chosen if dealing with the government.
The first MUD was written in PDP assembly. A few other early muds were written in Pascal. Pascal was very popular on VAX/VMS minicomputers and IBM microcomputers. Ada and COBOL were primarily used on mainframes which generally were not connected to the early internet. It is somewhat surprising that Fortran was (to my knowledge) never used, because it was commonly available on the Unix and VMS systems used in university settings.
I remember reading somewhere that Avalon's Hourglass engine was written in Fortran.
I have found the Lua language to be a good place to start.
Pick up Programming in Lua, work through the book. It will introduce many universal concepts (control structures, data structures, inheritance, functional vs OOP) in a pretty straightforward, easy to understand manner. It's also very forgiving. After you master the basics, transition to a language that offers static-typing, memory management, etc.
Just my two cents. Also, after getting a basic handle on Lua, try comparing it to other scripting languages, like Ruby, then Python, etc. Good luck! :)