Author Topic: How to start  (Read 1790 times)

tangerine

  • Hydlaa Resident
  • *
  • Posts: 192
    • View Profile
(No subject)
« Reply #15 on: December 04, 2003, 02:48:03 am »
HTML is not a programming language, it\'s language for defining contents of web pages. There are no data structures, no algorithms, just text, images and controls layered in some structure.

C++ is not only much more complex than HTML, it is completely different kind of thing. You can\'t suddenly start programming games in C++ when everything you know is HTML (i.e. you don\'t know any programming language). There is a LONG WAY to go before you can write serious computer games. Or any computer games. Good luck.

> i tought my self html by looking at the source for each page

> of a website and experimenting just wondering if its
> possible to do the same

Believe me, it is not.

http://cvs.sourceforge.net/viewcvs.py/planeshift/planeshift/src/

Btw the system for viewing the sources is written in .... Python (\"scripting lang\")

Leander256

  • Guest
(No subject)
« Reply #16 on: December 04, 2003, 02:50:20 am »
Quote
Originally posted by Sifright
i havent used program langs before but  html is some what simular :P in that are several features that are the same athough i admit html is no where near near as complex.

No! Please no! HTML is a formatting language, not a programming language!

And if the price is a problem for you, you should borrow books from your school or town\'s library. It\'s a very good way to give a try to several languages and pick up the one fitting you the best at the moment.

tangerine

  • Hydlaa Resident
  • *
  • Posts: 192
    • View Profile
(No subject)
« Reply #17 on: December 04, 2003, 03:07:06 am »

Xandria

  • Hydlaa Citizen
  • *
  • Posts: 453
    • View Profile
(No subject)
« Reply #18 on: December 04, 2003, 03:34:29 am »
Quote
Originally posted by Mogura
I\'ve learnt VB in college, this isn\'t very different. :) Of course, half of it is logic anyway.


It\'s more like this:

90% - Programming theory (Logic, as Moogie would put it): knowing what a program is, how computers process instructions, understanding varibles, memory, loops, conditional statements, functions/subroutines (these are the same, but VB treats them differently :P), templates, and if you\'re programming with an OOP (like C++): encapsulation, inheritance, and polymorphism.

10% - Grammar: While most every programming language will have loops, variables, etc., they all use a different sequence of characters that inform the compiler as to what it is.  Also includes things like the use of curly braces and semicolons.

The nice part is, once you learn programming theory, you can pick up on just about any other programming lanuage very quickly, because all you need to learn is what words and symbols are used to perform the various programming tasks.

Quote
Originally posted by Keldorn
just a small note really, you don\'t have to declare every variable by starting a new int, you can just as easily use a comma (ex, int v1, v2, v3, sum; )


This is really a matter of personal preference.  My C++ instructors were all very strict about never using the comma separation method, so that\'s just the way I was brought up.  It\'s just the way that i\'m comfortable with.


And finally, I am SHOCKED that a) no one caught the mistake in the code posted by Sifright, and b) that sample code was so malicious in teaching people bad habits.

NEVER EVER EVER EVER EVER EVER have \"main()\" return void!!!  \"main()\" must ALWAYS return an int!!  It has been this way since the beginning of C programming, and it should always be used, no matter how simple of a program you making.  Declare \"int main()\" (or for those of us rigid types, \"int main(void)\") or if you need command line parsing, go ahead and use \"int main (int argc, char *argv[])\" but NEVER use \"void main()\"!!  That\'s all you need to do, besides returning a value.  If you\'re really lazy, you can type \"return 0;\" at the end of \"main()\" but you really should have \"#include \" up with your includes, and \"return EXIT_SUCCESS;\" for reasons of compatibility and portability.

I just can\'t believe the things people are posting on webisites nowadays  :(

How I set my timezone:

ln -sf /usr/share/zoneinfo/Antarctica/Davis /etc/localtime

Ghostslayer

  • Hydlaa Citizen
  • *
  • Posts: 402
    • View Profile
(No subject)
« Reply #19 on: December 04, 2003, 06:17:23 am »
Quote
Originally posted by Xandria

NEVER EVER EVER EVER EVER EVER have \"main()\" return void!!!  \"main()\" must ALWAYS return an int!!  It has been this way since the beginning of C programming, and it should always be used, no matter how simple of a program you making.  Declare \"int main()\" (or for those of us rigid types, \"int main(void)\") or if you need command line parsing, go ahead and use \"int main (int argc, char *argv[])\" but NEVER use \"void main()\"!!  That\'s all you need to do, besides returning a value.  If you\'re really lazy, you can type \"return 0;\" at the end of \"main()\" but you really should have \"#include \" up with your includes, and \"return EXIT_SUCCESS;\" for reasons of compatibility and portability.

I just can\'t believe the things people are posting on webisites nowadays  :(


Funny thing is, I took a C++ programing class last year and we almost always used void main... lol
The only time this changed is when we got later in the year when our programs became more complicated.  So I guess it isnt just the internet teaching bad habits :D
Blitzers Guild
Hard Work Often Pays Off After Time, but Laziness Always Pays Off Now.

Kramy

  • Hydlaa Citizen
  • *
  • Posts: 246
    • View Profile
(No subject)
« Reply #20 on: December 04, 2003, 06:51:44 am »
Lots of sites on the internet have bad javascript coding. I can tell because they work fine in IE, but not in any other browsers. :D

Although not useful for programming applications, javascript can really enhance any sties you make, and introduces you to many fundementals of programming(structure, the weird {} [] // ; : \' \" symbols, etc.)

lynx_lupo

  • Veteran
  • *
  • Posts: 1431
  • Sorbus aria!
    • View Profile
    • Linux pri nas
(No subject)
« Reply #21 on: December 04, 2003, 10:27:17 am »
Yep, nope. Microsoft made their version of javascript, jscript...which has more options but is I(n)Et(h)ic.;) AFAIK
"Amor sceleratus habendi"- Ovid
"First they ignore you, then they laugh at you, then they fight you, then you eat them." -Godzilla

Sifright

  • Hydlaa Resident
  • *
  • Posts: 156
    • View Profile
(No subject)
« Reply #22 on: December 04, 2003, 10:46:52 am »
(Cough cough i know html is not a programing languegue) but it does have some simularitys in the way it is structured  any how i am going to get a book on saterday for programing its about 2000 pages long : / its suposed to teach from the very basics all the way trough to the hard stuff :p  (this will take a long time to work trough)

lynx_lupo

  • Veteran
  • *
  • Posts: 1431
  • Sorbus aria!
    • View Profile
    • Linux pri nas
(No subject)
« Reply #23 on: December 04, 2003, 11:00:45 am »
Yup. When you\'ve learned some of the basics, leave the book alone(boring examples) and try sth interesting yourself...then only return to the book when you don\'t know sth or want to get to know the next level.
"Amor sceleratus habendi"- Ovid
"First they ignore you, then they laugh at you, then they fight you, then you eat them." -Godzilla

Leander256

  • Guest
(No subject)
« Reply #24 on: December 04, 2003, 01:30:39 pm »
Quote
Originally posted by Kramy
Lots of sites on the internet have bad javascript coding. I can tell because they work fine in IE, but not in any other browsers. :D


As pointed out by lynx_lupo, Microsoft made his own version of Javascript, called Jscript, adding non-standard features of their own (please note that I don\'t judge their usefulness). Besides, there are different versions of Javascript that were released.

Judging the quality of anything (html/css/javascript/whatever) with IE is totally pointless, IE doesn\'t respect the standards of the web, and it\'s not because 95% of people use it that it\'s a good tool.

Quote
Originally posted by Keldorn
just a small note really, you don\'t have to declare every variable by starting a new int, you can just as easily use a comma (ex, int v1, v2, v3, sum; )

That can be confusing when declaring pointers, many people will tell you to declare pointers like that:

int* myPointer;

But if you declare two pointers on the same line, you have to specify * for everyone of them:

int* myPointer1, *myPointer2;

Of course the position of the space (leading or trailing) is pure convention, the compiler doesn\'t care at all. But somehow it clarifies the code, espcially if you have to initialize your variables at the same time:

int *myPointer1 = new int(3), *myPointer2 = new int(-7);

It\'s easier to read like that:

int* myPointer1 = new int(3);
int* myPointer2 = new int(-7);

Anyway, the compiled code will be exactly the same. Sifright don\'t be scared by all this talking, you\'ll see that programming also has a small aspect which is about writing conventions (how to indent, where to put or not put spaces, etc...), it\'s harmless :)

Vengeance

  • Veteran
  • *
  • Posts: 1452
    • View Profile
(No subject)
« Reply #25 on: December 04, 2003, 02:21:16 pm »
use void main() if you want.  it is an alternate standard.  The C lib will return 0 to the OS automatically if you make it void, so just returning 0 yourself is pointless.

Sifright

  • Hydlaa Resident
  • *
  • Posts: 156
    • View Profile
(No subject)
« Reply #26 on: December 04, 2003, 06:20:01 pm »
i was wondering what the voidmain actuly does if some could explain for me plz :P

lynx_lupo

  • Veteran
  • *
  • Posts: 1431
  • Sorbus aria!
    • View Profile
    • Linux pri nas
(No subject)
« Reply #27 on: December 04, 2003, 06:23:58 pm »
it\'s part of the return thing.
if u wanted the sub to return nothing(like in main)it\'s void
if u wanted the sub to return integers it\'s int
if u wanted the sub to return boolean it\'s boolean
...

See?
"Amor sceleratus habendi"- Ovid
"First they ignore you, then they laugh at you, then they fight you, then you eat them." -Godzilla

Xandria

  • Hydlaa Citizen
  • *
  • Posts: 453
    • View Profile
(No subject)
« Reply #28 on: December 04, 2003, 07:18:50 pm »
\"The main() function returns int.... If you void main() and you\'re writing code for a nuclear reactor or a military aircraft, you\'re probably feeling a little unsettled right now, and I don\'t blame you.... To be portable, you must return int from main and you must take either no arguments or the two specified by the standard\"
~ Richard Heathfield, C Unleashed  

Those of you who programmers who haven\'t read through these, I\'d highly recommend it:

stl.caltech.edu - The Quotation Collection

Real Programmers Don\'t Use Pascal

The story of Mel

How I set my timezone:

ln -sf /usr/share/zoneinfo/Antarctica/Davis /etc/localtime