Web Hosting Talk







View Full Version : newbie question: best way to learn cgi?


StriderF1
05-17-2001, 09:59 PM
Hey guys, this is my first post, I just heard about these forums from someone at hardforum.com, so I decided to check this place out.

well, for my question, I already know HTML pretty well, and I've been making webpages with notepad and dreamweaver for a while now. But I now want to put in a BBS like this one on my page, and I was told it was done by using CGI. If it makes any difference, I was considering using the www.IKONboard.com bbs, cause that's free and I don't feel like spending a lot of money on UBB or vBulletin. If you guys know of a good book I could get from bn.com or amazon, that would be good, or a good website would be even better.

Also, while I'm asking about learning essential internet languages, do you guys know of anywhere that I can learn SSI? I don't really want to buy a book a for that, but I really think I should learn it for convience sake since I want to start building a fairly sizable webpage and I want everything to look uniform.

thanks guys, I appreciate the help. I saw all the great responses in the thread about registering domain names and I hope I can get the same knowledgeable responses here!:cool:

ksstudio
05-17-2001, 10:23 PM
StriderF1,

First of all wlecome you to this big family, you may find people here are very friendly and ready to help.

Besides ikonboard, there are a long list of free Bulletin Boards, here are some cool boards:
1. phpBB http://www.phpbb.com (we are using this on our site)
2. others click here http://cgi.resourceindex.com/Programs_and_Scripts/Perl/Bulletin_Board_Message_Systems/
3. and also here http://php.resourceindex.com/Complete_Scripts/Bulletin_Board_Message_Systems/


Good luck + all the best!

:)

StriderF1
05-17-2001, 10:31 PM
Thanks ksstudio, apreciate the responce. I found at leaste one other good, free bbs that I might use.

ok, while I'm at it, does anyone recomend anythign to learn php also? I am going to have a ton of free time this summer and I dont think it would be unreasonable to learn 3 languages- cgi/ssi/php. should I just buy a book, start reading and doing?

cperciva
05-17-2001, 10:34 PM
There are two paths to choose from here: You can take the easy path to writing sloppy code, or you can take the hard path to writing good code.

If all you want to do is write run-of-the-mill, sloppy, bug-ridden, security-hole-filled cgi scripts, go ahead and buy some "for dummies" books, and start writing code. You'll probably make lots of money doing that because the big rich companies which hire people to write cgi scripts for them don't look at your work to make sure it is any good.

If you want to learn to write good code, stop right now. Forget about the internet. Grab a C compiler, and start writing code in C. You might want to spend a while working with assembly language as well if you want to learn anything about writing fast code. Take a few university courses is at all possible (in order of importance: data structures, algorithms, databases, networking, anything else). Only after you have done all of that, return to the internet and start learning perl/php/ASP/the flavor of the month.

Given a good knowledge of programming and computer science you'll find that you can learn the "flavor of the month" within a couple hours whenever it changes; you'll also be able to write much better code than the people who have spent months floundering around, not understanding what they are doing, until they get something which "seems to work".

It's up to you whether you want to do things right or do things fast. My preference is for doing things right.

StriderF1
05-17-2001, 10:39 PM
I just finished a c++ class in my highschool this year, and all I have to say about it is 2 things- 1) the class and instructor sucked so I didn't learn much and 2) dang, c++ is tough.

I have the c++ book and Borlands C++ so I'm going to spend a lot of time working with that this summer. I was never really interested in the "dummy" books, but more of something that will really teach me the language, because even though I don't c++ as well as a lot of people, I understand the structures and everything else in there.

so, lets assume that in a couple of months I am really good with c++, should I just then proccede to go to Amazon and just buy a book on whatever I want to learn?

cperciva
05-17-2001, 10:53 PM
<RANT>C++ is a really ******* ****** stupid language to teach to people who haven't done any programming before. Object oriented programming has some value when it comes to building huge systems -- it reduces organizational complexity and enforces architectural delimitations -- but when you're writing HELOWRLD.C it is only going to confuse people. People who are programming for the first time need to be taught to think the way the computer does -- ie, with a procedural programming style -- and using an object-oriented language is simply going to make it harder for them to get the basic foundation necessary upon which to build.</RANT>

Ok, now that I've finished that... throw the C++ book away and get one on C. It doesn't matter if it is 15 years old... C hasn't changed significantly in those years. Get a book on C and a C compiler (borland will do, but find the "Force ANSI C" option and check that -- at this point being forced to write pure ANSI C will help your understanding) and start from scratch.

Once you can write code (in ANSI C of course) to read a command from STDIN (eg, "ADD myname,12345", "DEL myname", "SHO myname"), hash "myname", and add/delete/look up values from a 1MB binary database stored on disk [and perform at least 200 transactions/second on your PC], *that* is when you should start thinking about learning the "flavor of the month" internet scripting language.

StriderF1
05-17-2001, 10:58 PM
wow, so uhh, the last year was useless garbage? that nice to know:rolleyes:

well, I'll pick up a book on C and read through it, but I don't think I want to spend all summer memorizing a bunch of useless C code, I'll just learn the structures and operations and how it works, not every single little detail about it, is that fine? The way I figure it, if I go at a decent pace I could get pretty good with C in a few months it I read it everyday and some days all day, and then cgi etc will be easy, right? sounds a little tough, but why not, its summer and the whole point is so I can learn how to program.

BRossMac
05-17-2001, 11:39 PM
Hey Strider,

I'm a total newbie to coding too. I started by putting up a BB on my site as well. I just downloaded the various packages, read the instructions and started hacking away. It's a good way to start becoming familiar with some aspects of code. I like diving in and figuring out how to get a certain task done. It's kind of how I learned guitar. Taking lessons and starting at the beginning really frustrated me. Once I joined a band and started teaching myself songs, it was great.

People have recommended a number of BBs here and I installed and tested several, including PHPBB, Snitz (ASP), Ikonboard, XMB, T-forums and V-Bulletin lite. By far the best [IMO] is Ikonboard. PHPBB wasn't as easily or completely customizable as I would have liked. I would strongly recommend Ikonboard. If you're on a WIN server or have ChilliASP, I like Snitz.

Just some thoughts....

If you have any questions about any of this (especially since I just went through it...), let me know.

Brad

Foo-Dawg
05-17-2001, 11:39 PM
cperciva makes a good point but I don't think it is valid in this case. If you want to program purely on the web jumping into a web-based scripting language is the best way to do it. Less then 4 or 5 months ago I knew almost no HTML and no other languages. I eventually came accross PHP and jumped right into that. Within 2 weeks I was working with databases.

Learning how to use a binary db with C may be good offline but online that's certainly not the best choice (IMO) to start out at.

Also many of the web based languages (PHP especially) are very derivative of C and much easier to boot. I myself actually plan on using my PHP knowledge to jump into C.

As for the whole "flavor of the month" thing, today the most used web languages have been around for quite some time and I see no sign of them going away for quite a while.

Just my two cents.

cperciva
05-17-2001, 11:41 PM
Oh, knowing all the details isn't particularly important. I still have to look up the syntax for #typedef every time I use it. The point is getting into the right mindset and understanding of programming. And while I mentioned getting a book on C programming, the most important thing by far is just to write code... you can certainly learn some things from reading books but reading all the books ever written about C won't help you if you've never actually written any code.

StriderF1
05-18-2001, 12:17 AM
Just with my little c++ knowledge, I've been able to look at code for Java, Javascript, and other languages and been able to follow the basic sctructure of the code and what was going on. I'm not sure about the thing that you said that C++ was a waiste of time and only concentrate on C, but I'll certanly look at C and learn about it.

BRossMac: thats how I learned HTML, I just went to HTMLgoodies.com, took the tutorials and started writing html. But since I've extensively used Dreamweaver for over a year, there were no knew concepts for me, only the actual code to memorize. After I read a book on C and finish my C++ book then I'll probably jump into cgi and php, not sure which one first, though.

What code do you need to know to put up the IKONboard.com BBS? IT looks to be just CGI run, but I heard php mensioned a lot too.

Thanks for the responces guys, I apreciate it!

ksstudio
05-18-2001, 02:52 AM
StriderF1,

Here is another link for you to start with PHP (at least u will have some idea on it)

http://hotwired.lycos.com/webmonkey/99/21/index2a.html


:)

StriderF1
05-18-2001, 07:47 AM
thanks ksstudio, thats a good link

(SH)Saeed
05-18-2001, 08:28 AM
Originally posted by cperciva
Given a good knowledge of programming and computer science you'll find that you can learn the "flavor of the month" within a couple hours whenever it changes; you'll also be able to write much better code than the people who have spent months floundering around, not understanding what they are doing, until they get something which "seems to work".

That is very true. I can back that up with my own experiences.

BRossMac
05-18-2001, 01:40 PM
Originally posted by StriderF1


What code do you need to know to put up the IKONboard.com BBS? IT looks to be just CGI run, but I heard php mensioned a lot too.

Thanks for the responces guys, I apreciate it!

It's all Perl, I'm pretty sure. The instructions on how to install and customize it are pretty straightforward, I think. I did it all without ever seeing or using Perl before.... And I barely know HTML since I primarily use Front Page (sorry folks....:rolleyes: )

Brad

StriderF1
05-18-2001, 08:16 PM
Perl is the main thingy for cgi right?

cperciva
05-18-2001, 08:30 PM
Originally posted by StriderF1
Perl is the main thingy for cgi right?

It depends upon the context. Perl is used very often for tasks involving manipulating user input, because regexps are very concise (albeit exceedingly slow) ways of verifying the validity of user input. However, PHP is more common for tasks involving HTML layout[0], and of course C/fastcgi is common for any place where performance is of primary importance.

For each problem, there is an appropriate solution; half of the work is deciding which solution is the appropriate one.

[0] PHP is also generally prefered when interfacing with MySQL databases due to the simplicity of its interface.

StriderF1
05-18-2001, 10:13 PM
ahh thanks

kunal
05-19-2001, 05:58 AM
the best way to learn cgi.. hmm.. well the way i learnt it, or any of the other languages i know is, download free code... read it.. see how they did things.. and try re-doing it.. its always easier to learn when you have an example with you...

once you can read and understand code, take on projects on your own.. make them work..

i think the approach of learning the entire language, all its syntax etc etc is plain stupid.. i mean.. you wont ever use more then half of the commands youve learnt.. a major waste of time, dun you think??

(SH)Saeed
05-19-2001, 06:48 AM
Originally posted by kunal
the best way to learn cgi.. hmm.. well the way i learnt it, or any of the other languages i know is, download free code... read it.. see how they did things.. and try re-doing it.. its always easier to learn when you have an example with you...

once you can read and understand code, take on projects on your own.. make them work..

i think the approach of learning the entire language, all its syntax etc etc is plain stupid.. i mean.. you wont ever use more then half of the commands youve learnt.. a major waste of time, dun you think??


You are so wrong my friend. It's just like running before you learn to walk. When you're going to learn your first programming language, the best way to go is to buy a book and start reading it. Learn all the basic functions and commands. Do not jump over any pages. When you understand and know the basic of programming and you have worked with it for a while, then you can easily start programming other languages just by looking at examples. Offcourse, a few examples would help you even in the begining, but you should not try to only learn from those, you will miss a lot of important little things that do make a huge difference later.

kunal
05-19-2001, 06:56 AM
Originally posted by zolbian



You are so wrong my friend. It's just like running before you learn to walk. When you're going to learn your first programming language, the best way to go is to buy a book and start reading it. Learn all the basic functions and commands. Do not jump over any pages. When you understand and know the basic of programming and you have worked with it for a while, then you can easily start programming other languages just by looking at examples. Offcourse, a few examples would help you even in the begining, but you should not try to only learn from those, you will miss a lot of important little things that do make a huge difference later.


agreed.. what i meant to say is that, you should know the language, you should know how it works, know the flow of logic, but that doesnt necesarily mean learing the entire langauge, and all its syntax. you do offcourse need to know the basic... lol

(SH)Saeed
05-19-2001, 07:43 AM
Exactly, for example.. Currently I do most my work in PHP. Everytime there is something I wonder about or need more information about I look it up in the PHP manual at http://www.php.net/ . Before most my work was done in Perl/CGI, I had this great Perl book that I used as a referrence. I doubt that anyone can lean an entire language, so you will definitely need a book or a manual.

kunal
05-19-2001, 07:48 AM
Originally posted by zolbian
Exactly, for example.. Currently I do most my work in PHP. Everytime there is something I wonder about or need more information about I look it up in the PHP manual at http://www.php.net/ . Before most my work was done in Perl/CGI, I had this great Perl book that I used as a referrence. I doubt that anyone can lean an entire language, so you will definitely need a book or a manual.


Yup.. thats me too.. manuals, books, boards, icq :D lots of help everywhere :)


as for learning the entire language.. trust me.. there are ppl who learn the whole thing... and then start coding.. which is silli.. but they are who they are...

BRossMac
05-19-2001, 12:12 PM
Originally posted by zolbian



You are so wrong my friend. It's just like running before you learn to walk. When you're going to learn your first programming language, the best way to go is to buy a book and start reading it....

Well, there really isn't any one BEST way to learn anything. What research has shown is that there are many ways to learn various tasks and not everybody learns best the same one way. As a former teacher I know this as a fact. Different approaches for different people....

StriderF1
05-19-2001, 12:51 PM
I'll take everything into consideration, thanks for the replies guys, I now have a much broader understanding of how these things work

(SH)Saeed
05-19-2001, 03:32 PM
Originally posted by BRossMac


Well, there really isn't any one BEST way to learn anything. What research has shown is that there are many ways to learn various tasks and not everybody learns best the same one way. As a former teacher I know this as a fact. Different approaches for different people....

I agree with to some point. I've had the discussion before about how some people learn best by reading, some by hearing, etc.. But what I'm trying to say is that if you just download scripts you might miss a few small things that are important in building a reliable application. That is why I'm saying you should get a book and read it, just to get all the small pieces that build the whole.

For example, if StriderF1 wants to learn how to program Perl/CGI. He can download tons of scripts and get a good idea on how things are done. He might even be able to code some advanced scripts. But then one day he gets a newbie book and starts reading it, then he will notice some functions/commands he never saw in those scripts and they do make things a lot easier. To put it short.. You can not learn about that function/command since it has not been in those scripts you downloaded.

cimshimy
05-19-2001, 05:11 PM
CGI is a misnomer. You can't really learn CGI, you can only learn languages that use CGI to get their data from User -> Server -> Language Exec. -> Server -> User.

You probably mean Perl.


Andrew

StriderF1
05-19-2001, 06:20 PM
Originally posted by cimshimy
CGI is a misnomer. You can't really learn CGI, you can only learn languages that use CGI to get their data from User -> Server -> Language Exec. -> Server -> User.

You probably mean Perl.


Andrew

well, what I want to learn is whatever you make BBS systems out of, which is probably perl. and after that I want to tackle php, but right now perl/bbs's are what I want to learn how to do.