Server Help

Trash Talk - Programming languages..

Assassin2684 - Mon Oct 25, 2004 6:22 pm
Post subject: Programming languages..
Ok so i really want to learn how to start programming and stuff like that. I was looking around and asked some people what the best to start out with and they said "python" was a good starter one and for somthing more helpful they said "HTML". But i wanted to check with the experenced ones first. So what do you guys think is a good starter if you kno a different or better one please tell me, im open to any ideas. Also if you have any sites to go with it, that would help alot to. Thanks.
50% Packetloss - Mon Oct 25, 2004 7:12 pm
Post subject:
Mervbot is made with C++
Powerbot is made with C
TW-Core is made with Java (not java-script)

Those are the 3 main bots that are in use, so if you plan on programming for subspace then you might want to learn one of those languages. Personally I recommend starting off with C++. Then you wont have much trouble learning C, they are very similar. Java might be nice if you want to program crap, so if you are thinking about getting into programming you might need to learn it sooner or later. But your goal should be lower-level languages. These are languages that are the closest to speaking like a computer does. Ultimatly a programmer's goal should be ASM but it depends on what you want to be doing. You dont program PC programs in ASM usually, I personally use it for microcontrollers. Im told python is nice to start off with, you can use it to program ASSS modules too.

HTML is not a programming language, it is a scripting language. Programs read HTML for websites and such, you can not write a program with it.

There are endless amounts of C++ websites but I recommend that you purchase a book, the C++ for Dummies book is nice (as are most of the Dummies books). Many people do not like programming, so hopefully you can figure out if this is your cup of tea. Of my class of 30 or so people, only 2 people understood and enjoyed programming. If you want to start programming because you think you can design video games or something along those lines, you probably have 10 years of programming before you reach that point. There is a lot to know, books will teach you the basics but beyond that takes practice and lots of examples. Hopefully that helps you out.
Mr Ekted - Mon Oct 25, 2004 7:56 pm
Post subject:
I recommend that you do not learn a new language from any source that begins chapter 1 with dogma. Find something that teaches from the ground up, so you have a basis to understand the building blocks you are learning. For example, any C++ book (or class) that has anything to do with cin/cout on day 1 is total garbage. Alas, I have no specific recommendations.
SuSE - Mon Oct 25, 2004 8:11 pm
Post subject:
50% Packetloss wrote:
you probably have 10 years of programming before you reach that point

no offense to the fiddy, but imo if it takes you 10 years to do _anything_ like that, you should get out of the doing business
Assassin2684 - Mon Oct 25, 2004 8:16 pm
Post subject:
Well i will look foat stuff you guys said, i will also look for the C++ for dummies book. I think i could make this a hobby for me, i really want to do somthing interesting and fun and mabey i can make somthing out of it icon_biggrin.gif So i will look for that stuff, if you guys have any websites for like tutorials on C++ that would help me out. Thanks.
Dr Brain - Mon Oct 25, 2004 8:54 pm
Post subject:
Learn Java, then Learn C++, then learn C.

Anyone who disagrees with this can go suck an egg.
CypherJF - Mon Oct 25, 2004 9:10 pm
Post subject:
I agree with Brain there, if you don't understand Java, then you ain't going to understand C/C++...
50% Packetloss - Tue Oct 26, 2004 3:21 am
Post subject:
Java might be more useful to you, especially if you want to do graphics stuff. I learned C++ first but personally I like C better. I havent tried java, going to see if I can get in the class next semester. Might as well get some credits if Im going to learn it. You should find a book that doesnt dick around, the Dummies books are a little more entertaining than the rest, so you might run into some crappy coding in the book. Read sections then look up more info on the subject on the internet, most importantly is to write a program with the knowledge you obtain from a section in the book. Something small for each section and it will help you out a lot. Youll need a compiler, Visual C++ is my favorite IDE but any of the free ones will work.
Mr Ekted - Tue Oct 26, 2004 5:05 am
Post subject:
It also helps to pick a project that is challenging and fun for you as a goal. Nothing helps learning more than a real world example. What's your interest? Graphics? User interface? Networking? Databases? You should try to pick something that could be reasonably completed in, say, a month. If you've never programmed before, it probably needs to be something fairly simple. Once you decide what language and what interest(s) you have, we can probably direct you further.
SuSE - Tue Oct 26, 2004 10:07 am
Post subject:
You should always make an entire operating system for your first project. Even if you're starting with Java or Perl. It should be better than GNU/Linux, at least.

Get to it.
Onlyone - Tue Oct 26, 2004 11:21 am
Post subject: Easy
My C class gave me this piece of shit book that i spent like 80 dollars on. This C programming in Easy Steps that i bought at Barnes and Noble for like 10 dollars is actually better than the crap they gave me for this class ... and its in color tongue.gif If you walk over to the computer section at Barnes & Noble they got a shit load of these programming books all for 10 dollars. Just a good place to start.
Solo Ace - Tue Oct 26, 2004 2:19 pm
Post subject:
SuSE wrote:
You should always make an entire operating system for your first project. Even if you're starting with Java or Perl. It should be better than GNU/Linux, at least.

Get to it.

Mine was in VB, it's called Windows.
Dr Brain - Tue Oct 26, 2004 4:26 pm
Post subject:
You made windows? And in VB?

Explains a great deal, my friend, a great deal.
Solo Ace - Tue Oct 26, 2004 4:31 pm
Post subject:
icon_smile.gif
Assassin2684 - Tue Oct 26, 2004 4:34 pm
Post subject:
Ok i will look into barns and noble. Also i will prolly be looking into like graphics and maby databases and networking, or somthing on the lines of that. I will see if i can go get a book this weekend or mabey this week some time. So thanks guys for your help and i will tell you when i have the book or somthing liek that and see where to go form there biggrin.gif Thanks.
CypherJF - Tue Oct 26, 2004 4:51 pm
Post subject:
You can make OS shells w/ VB; but can't make an OS in VB.. LOL
Cyan~Fire - Tue Oct 26, 2004 4:55 pm
Post subject:
C++ Tutorial

That's what I started with. That's what I'm happy with. Now I know Ekted's going to get mad at me for my preaching "dogma", but printf() and all that is just as dogmatic. And it's harder for a newbie.

Buying a programming book is a waste of time, in my opinion, since you'll only use it once.
Mr Ekted - Tue Oct 26, 2004 5:29 pm
Post subject:
You are right. I wouldn't teach printf either.
CypherJF - Tue Oct 26, 2004 5:45 pm
Post subject:
Never learned about printf or sprintf in my classes; looked it up on my own. So they must have been doing something right. haha.
Mine GO BOOM - Tue Oct 26, 2004 8:31 pm
Post subject:
Format Specification Fields: printf and wprintf Functions
Contains everything you need to know about printf and %'s. But be warned, as I believe Ekted is hinting at, loose printf usage can easily cause problems. If a string isn't null terminated, a sprintf with a %s on that varible will easily cause overflows.
Mr Ekted - Tue Oct 26, 2004 8:37 pm
Post subject:
That's not really my point. It's just overwhelming for a new programmer to deal with serious I/O in "chapter 1".
Mine GO BOOM - Tue Oct 26, 2004 9:55 pm
Post subject:
I got along fine. Just remember that gets() is input, and printf("%s", string) is for characters, while printf("%d", digits) is for numbers, and adding a \n in any output is a new line.

Trying to get them to do scanf or other things is what boggles people's mind. Hell, for simple programs, I still do gets() -> atoi().
Dr Brain - Tue Oct 26, 2004 10:14 pm
Post subject:
Cout isn't that bad to deal with for a newbie. They won't understand how the stream operators work, of course, but they always get the idea. Printf is probably slightly more mystifying to the inexperinced.
Mr Ekted - Tue Oct 26, 2004 10:25 pm
Post subject:
I never use scanf() in any program. And if you are going to use iostream, you might as well prgram in VB.
Onlyone - Wed Oct 27, 2004 4:07 pm
Post subject:
Out of curiosity ... whats wrong with iostream?
Cyan~Fire - Wed Oct 27, 2004 5:39 pm
Post subject:
Well duh! It doesn't work in C, so it must be bad!
CypherJF - Wed Oct 27, 2004 5:42 pm
Post subject:
so cry me a river...

tongue.gif
Mr Ekted - Thu Oct 28, 2004 2:24 am
Post subject:
iostream is about 27 levels of function calls away from the operating system. And do you know what it uses? printf!
Dr Brain - Thu Oct 28, 2004 7:09 am
Post subject:
And the OS is probably another 50 function calls away from the assembly.

Iostream makes it easier for programmers to develop programs. That's why it's there. Not so that it can print to the console with blindingly fast speed, because, after all, no one really cares how long it takes.
lp_street_soldier - Thu Oct 28, 2004 7:53 am
Post subject:
Bleh <_<
Mr Ekted - Thu Oct 28, 2004 8:07 am
Post subject:
Dr Brain wrote:
And the OS is probably another 50 function calls away from the assembly.

Iostream makes it easier for programmers to develop programs. That's why it's there. Not so that it can print to the console with blindingly fast speed, because, after all, no one really cares how long it takes.


You must work for Microsoft! new_scatter.gif
SuSE - Thu Oct 28, 2004 8:47 am
Post subject:
Anybody read "The C Programming Language" or "The C++ Programming Language"? Comments?
k0zy - Thu Oct 28, 2004 10:17 am
Post subject:
Mr Ekted wrote:
I never use scanf() in any program. And if you are going to use iostream, you might as well prgram in VB.


What do you use?
You do the same as MGB?

Mine GO BOOM wrote:
I still do gets() -> atoi()


EDIT: Here's a program I had to code for my programming class.
I began studying Computer Scince a few month ago. (I knew how to code C before)
The program solves the equation a1*x + a0 = 0
Code: Show/Hide
/*
Author: Bob Dole.. Bob Dole... Bob Dole...... bob dole.... bob... dole....
Martikelnummer: xxxxxx
Aufgabe 10
----
Programm liest aj der Gleichung a1*x + a0 = 0 ein, und berechnet x
*/

#include <stdio.h>

int main(void) {

   double a0=0;   // erster Faktor der Gleichung
   double a1=0;   // zweiter Faktor der Gleichung
   double x=0;      // x das berechnet werden soll

   puts("a1*x + a0 = 0");
   puts("a1 und a0 eingeben:");
   scanf("%lf %lf",&a1,&a0);      // Zahlen vom Typ double einlesen
 
   /*
    Lösung der Gleichung:
      a1 * x + a0 = 0
      a1 * x = -a0
      x = -a0/a1
   */

   // Keine Lösung für a1=0, weil man nicht du 0 teilen darf, also Fehler abfangen.
   if (a1 != 0) {
      x = -a0/a1;
      printf("x= %.2lf\n",x);
   } else {
      puts("Keine Lösung der Gleichung für a1 = 0");
   }

   return 0;
}


Any comments on the coding style and the way I solved the problem, Ekted?
I'd like to know if an axperienced coder like you tells me the same things as my lecturer, because I doubt what he says sometimes.

Bob Dole.. Bob Dole... Bob Dole...... bob dole.... bob... dole....
Anonymous - Thu Oct 28, 2004 2:52 pm
Post subject:
I prefer to put opening curly brackets on their own line as you can then find code blocks easier. Although when I first started I only had 160x160 screen and 4k file size limit so I was trying to cram as much as posible onto each line.

Also when passing parameters and such I put a space after the comma so it reads well.
Mr Ekted - Thu Oct 28, 2004 5:50 pm
Post subject:
Reformatted to my tastes. Also, scanf may fail if the input isn't very specific. You should use gets(), parse, and display appropriate errors.

Code: Show/Hide

#include <stdio.h>

int main (void)
{
double a0 = 0;   // erster Faktor der Gleichung
double a1 = 0;   // zweiter Faktor der Gleichung
double x = 0;    // x das berechnet werden soll

puts("a1*x + a0 = 0");
puts("a1 und a0 eingeben:");
scanf("%lf %lf", &a1, &a0);      // Zahlen vom Typ double einlesen

/*
Lösung der Gleichung:
   a1 * x + a0 = 0
   a1 * x = -a0
   x = -a0/a1
*/

// Keine Lösung für a1=0, weil man nicht du 0 teilen darf, also Fehler abfangen.

if (a1 != 0)
   {
   x = -a0 / a1;
   printf("x= %.2lf\n", x);
   }
else
   puts("Keine Lösung der Gleichung für a1 = 0");

return (0);
}

Mr Ekted - Thu Oct 28, 2004 5:53 pm
Post subject:
Here's a picture I made showing most of my style issues...


CypherJF - Thu Oct 28, 2004 6:38 pm
Post subject:
style natzi icon_wink.gif jk... I think it's good advice to have a consistent clean programming style.
Mine GO BOOM - Fri Oct 29, 2004 1:07 am
Post subject:
I like the function's to be indented. Other than that, its pretty much the same. I have the {}'s indented or not depending on whatever editor I use at the time sets up as the default.

I prefer /* */ for large comment blocks over //'s. And when I do, I always have each new line started with a *, and all the *'s line up vertically.
Onlyone - Fri Oct 29, 2004 3:14 am
Post subject:
Dang Ekted... i thought i was a neat freak icon_smile.gif
Solo Ace - Fri Oct 29, 2004 5:35 am
Post subject: Astyle
I dislike a few things in Ekted's style, although most of it is the same as mine. icon_smile.gif

Sourceforge has some project called "astyle", I hate how it was written but it works, anyway, it can restyle source code into a bunch of styles.
Could be interesting for "style nazis". sa_tongue.gif
Cyan~Fire - Fri Oct 29, 2004 6:25 am
Post subject:
I basically have the same style as MGB: Ekted's style but with indented functions. Actually, why do you not indent your functions, Ekted?
Mr Ekted - Fri Oct 29, 2004 2:13 pm
Post subject:
I don't indent functions because it's just extra work, wasted space, at the lowest level. Since function are always delimited by green comments, it's easy to see where they begin and end. It's not important to me that everyone use my style. They just need to be consistent within their own style, and be relatively clean. When people code using their own style, it's easier for them to code with fewer mistakes. I also believe in 1-file 1-coder methodology. I do not share code on projects. If someone takes over file(s) of yours, they own it and can format it how they wish.
Dr Brain - Fri Oct 29, 2004 3:04 pm
Post subject:
That's bacicly how I feel about peoeple's styles, with a few exceptions. When I code for ASSS, I try to follow the ASSS coding style. As it's not all that different from the way I code, this wasn't a big strech. Though I've recently given up this habit, I do feel that people should make a small effort to keep files in a public project similar to each other.
Mr Ekted - Fri Oct 29, 2004 4:16 pm
Post subject:
I found the ASSS source files that I saw to be unreadable. grel and I are on opposite ends of the spectrum for code design, coding style, and open source issues, so it's best that we don't work together anyways.
All times are -5 GMT
View topic
Powered by phpBB 2.0 .0.11 © 2001 phpBB Group