FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


which Programing launguage to learn





looseballs
Hi, im a noob, learning a bit of a bunch of launguages, so i decided it was time to settle on one for now, but which one? I will not make this a poll as there are 2 many launguages to list and that i just need this for personal information. Please tell me, which programming launguage should i start with??? I have HTML and a little bit of other launguages, but thats it. I also know that HTML isnt worth a .... when learning other launguages. PLEASE HELP!
qebab
If you are completely new to programming, I would personally suggest Ruby, or Python. I have done a bit of coding with these two, and also PHP, and tried out C++.

What I can say about them is so far:
Ruby seems very logical from the point of view of someone who is not a programmer, as does Python. Both of these require little coding to make functional programs, as opposed to C++ where you have to write a lot more code to do something. C++ however, benchmarks better when it comes to speed, so if you need to run a demanding program many times, I suppose that's a better alternative. But it isn't really a beginners language.

PHP is easier to get on the web than Python/Ruby, as you basically just write a php file, upload it and can read it with your browser. There's more work to it with both Python and Ruby, but if you have support for frameworks (for instance Ruby on Rails) you don't have to do that much work, and you get a very nice end result.

This is a very nice tutorial to start out with for Ruby: Learning to Program, by Chris Pine
One for Python: Here.




Ok, just joking, the python tutorial is here. This is really a book, not a tutorial, but from the little I've read of it, it seems decent.

I haven't done much with, or read much about PHP, as the things I've used it for have been very simple, so I can only lead you to this google search.

I'm sure others have a lot more to add. Hope it helps!

Edit: Another thing, writing in Python will force you to indent your code properly, which is a very good habit to have, regardless of which language you use.
Liu
Enroll in a class that teaches Java or C/C++. After learning one language well, it's really easy to pick up other "C" like languages.
makli
In my opinion, learning Python would be a good advice.

HTH

Makli
dayveday
What do you want to program for?

If you want to make applications, then what sort? Java's a very clean language, and will help you learn lots of others. VC# is good for standard windows apps, and C++ is great for everything, but is harder to learn. There's also D, which is gaining a lot of support.

If you want to program for the web, then I'd suggest either PERL or PHP. Personally, I love PERL, but PHP is good too. Also, make sure you've covered CSS well in designing your webpages.
looseballs
kool, thanks everyone, ill look at the python tutorials, but in the future i guess ill have 2 move on 2 C++ or another higher launguage as i wish to learn game design. THanks again, anymore ideas, opinions, tutorials, just post here please!
qebab
Indeed, if you want to learn game programming, C++ is the way to go. However, to get a grasp of the objective oriented part of it, it might be a good idea to learn a higher level language (a higher level language does more of the work for you) that is object oriented (like Ruby or Python) before you go to C++, which is a very low-level language. If you embark on C++ right away, it might put you off. It's... difficult, and you have to write a lot more code to do things with it. On the other hand, you can probably make your computer do anything with it.

Someone mentioned the D programming language, but I suggest to steer clear of it for now. It is new as of January this year, so I doubt that there are books/documentation/tutorials available. An experience programmer might be able to pick it up, but I doubt normal people would.

For web, as dayveday mentioned, Php and Perl are both good. I'd add Python to that list as well, but I don't have much experience using Python for web. I have made an IRC bot written entirely in Python though, and it was good fun.

I hope everything turns out well for you, good luck. Smile
makli
For game programming, C# might be a good idea. The C#-DirectX-binding is much easier to program then the older COM-interface for DirectX.

The Microsoft XNA game architecture is also based on .NET, so also therefore C# is a good starting point.

HTH

Makli
looseballs
yea, i started looking at Python and even some java, except iv hardly touched java, but the book i have spent a hundred + pages explaining object orientation, so yea! Smile
Tex_Arcana
makli wrote:
For game programming, C# might be a good idea. The C#-DirectX-binding is much easier to program then the older COM-interface for DirectX.

The Microsoft XNA game architecture is also based on .NET, so also therefore C# is a good starting point.

HTH

Makli


Not Direct X! Need more games in OpenGL. It's more cross platform.
roboguyspacedude
I know java, php and html, but I would recommend c++ since it is best for gaming.
darth_revan
Both DirectX and OpenGL will fit greatly on C++. If you're serious about gaming, try C++. You are free to do whatever you want.

As i know, low level languages are faster, since you can optimize what the code does, more than you can on high level languages.

Some people start C before C++, which is not a bad idea. But if you want it enough, difficulties of C++ will be no problem Wink
Indi
darth_revan wrote:
Both DirectX and OpenGL will fit greatly on C++. If you're serious about gaming, try C++. You are free to do whatever you want.

As i know, low level languages are faster, since you can optimize what the code does, more than you can on high level languages.

Some people start C before C++, which is not a bad idea. But if you want it enough, difficulties of C++ will be no problem Wink

i always recommend starting with C++ if C++ is your ultimate goal. Don't bother learning C if you don't intend to be a C programmer. You'll just end up picking up C habits which are fine in C but bad in C++.

Besides, C++ can be a whole hell of a lot easier for a beginner, if approached properly. Consider how much easier a simple program to do something like read a name and parrot it back is.

C version:
Code:
#include <stdio.h>

#define MAX_NAME_LENGTH 50

int main(void)
{
   char name[MAX_NAME_LENGTH] = "Nobody";
   char* p_newline = 0;
   
   puts("What is your name?");
   
   fgets(name, MAX_NAME_LENGTH, stdin);
   
   if ((p_newline = strrchr(name, '\n')) != NULL)
      *p_newline = '\0';
   
   printf("\nHello, %s!", name);
   
   return 0;
}

Now is that really clear?

C++ version:
Code:
#include <iostream>
#include <string>

int main()
{
   using namespace std;
   
   string name("Nobody");
   
   cout << "What is your name?\n";
   getline(cin, name);
   
   cout << "\nHello" << name << '!';
   
   return 0;
}

Isn't that much easier for a beginner?
qebab
Code:
name = raw_input("What is your name?\n")
print "Hi there %s!"%name


Python version of the same thing. As already mentioned, there are more possibilities with C++, but if you don't have the resolve to go straight to a language like that, or don't have the patience for it... I still think python is the best alternative for a beginner. It's much easier to give up on C++...
X3 Talk
If your on the net you can't go past PHP. It's really the way of the future and it is getting rid of these dinosaur languages such as ColdFusion (sorry ColdFusion users) which is a little too simple for it's own good. MAKE SURE you know HTML FIRST. Then start making basic PHP scripts and work your way up. The system for debugging can be a little cryptic at first, but you will get there when you start to think like the program does.
darth_revan
Indi wrote:

Isn't that much easier for a beginner?

C++ is easier for a beginner, especially the STL (Standart Template Libary) offers a lot. But suppose that there are two people, A and B.

A begins programming with C, from beginning to the end, he knows all the algorithms he wants, from the simplest, to the most complex. Then he learns C++, which offers a lot with its libaries.

B begins programming with C++, from beginning to the end, he knows all the algorithms he wants, from the simplest, to the most complex.

An easy duty is given to both A and B. And it requires linked lists. A would code structs and pointers, since B simply uses lists that STL offer. A's code would be harder-to-write, but faster, since B's offer simplicity at a cost of speed.

(if you are using linked lists for a simple task, it's better to just type your own since using list class would offer more functions which you'll never use)

What i meant was, C++ may make coders lazy. They have chance to use list (vector, deque etc.) class, why would they code their own classes? I don't mean that a coder can code a list class (same functions as std::list) which is faster than std::list. But you may not use all of it's functions.

But a C coder would code what he wants himself.

But coding everything on your own is not a good idea at all. Take the qsort function. Can it be faster? Not with your pure-C (or pure-c++) code. It's written with assembly when needed, and it makes qsort faster than your code. And i suppose vector class sorts its members slower than qsort..
Indi
darth_revan wrote:
Indi wrote:

Isn't that much easier for a beginner?

C++ is easier for a beginner, especially the STL (Standart Template Libary) offers a lot. But suppose that there are two people, A and B.

A begins programming with C, from beginning to the end, he knows all the algorithms he wants, from the simplest, to the most complex. Then he learns C++, which offers a lot with its libaries.

B begins programming with C++, from beginning to the end, he knows all the algorithms he wants, from the simplest, to the most complex.

An easy duty is given to both A and B. And it requires linked lists. A would code structs and pointers, since B simply uses lists that STL offer. A's code would be harder-to-write, but faster, since B's offer simplicity at a cost of speed.

If B is really an equivalent C++ programmer to A, then he or she knows everything A knows, too. C++ more or less includes all of C, after all. C++ programmers do have to know how linked lists work - they're just spared the trouble of writing one in 99.999% of situations.

If A is a competent C++ programmer, regardless of whether he started with C or not, then when it came time to use a linked list, they would use std::list<T>, because anything else would be a waste of their time.

If A were to write their own linked list class from scratch, A would be a moron.

To put it in perspective, what if you knew a C programmer who wrote their own version of printf() in assembly? Their home-made printf() doesn't have all the features of the <stdio.h> printf(), and cannot be mixed with other <stdio.h> functions. They claim they did it because they wanted something faster and they didn't need the extra printf() capabilities. Their function is marginally faster, but not perceptibly so in a real situation. Would you consider their efforts worth it?

darth_revan wrote:
(if you are using linked lists for a simple task, it's better to just type your own since using list class would offer more functions which you'll never use)

i'm sorry, that makes absolutely no sense at all. You don't seem to be aware of how templates work. Templates are compile on demand. If std::list<T> has functions you will never use, so what? You won't pay for them. A home-made linked list class will probably not be faster, and it will definitely be a waste of effort to write, and a monumental waste of effort to test properly.

Aside from a very, very small number of special purpose situations - which i can say you will most certainly never see in your entire programming life - there is literally no justification for writing your own linked list class in C++, except as programming practice. None. If you don't believe that, and you're in the Greater Toronto Area, i give classes on C++ programming. i will prove it to you.

darth_revan wrote:
What i meant was, C++ may make coders lazy. They have chance to use list (vector, deque etc.) class, why would they code their own classes? I don't mean that a coder can code a list class (same functions as std::list) which is faster than std::list. But you may not use all of it's functions.

But a C coder would code what he wants himself.

C may make coders lazy. They can use all the built in <stdio.h> functions or <string.h> functions, why would they code their own? Maybe a coder can't code strncpy() faster than the C RTL. But you may not use all of its features, like the return value.

Sounds silly, huh? That's how what you wrote sounds to an experienced C++ programmer.

darth_revan wrote:
But coding everything on your own is not a good idea at all. Take the qsort function. Can it be faster? Not with your pure-C (or pure-c++) code. It's written with assembly when needed, and it makes qsort faster than your code. And i suppose vector class sorts its members slower than qsort..

You're assuming that std::sort() doesn't use std::qsort() for std::vector<T> when T is a POD. There's no reason to make that assumption. If i were writing the STL for a compiler, that's how i would do it.

You are making exactly the mistakes i was warning against. You are approaching C++ from the mindset of a C programmer. You are advocating poor practice, using rules and logic that make no sense in C++. They are C rules, not C++ rules. C rules don't apply in C++.
darth_revan
Indi wrote:

i'm sorry, that makes absolutely no sense at all. You don't seem to be aware of how templates work. Templates are compile on demand. If std::list<T> has functions you will never use, so what? You won't pay for them. A home-made linked list class will probably not be faster, and it will definitely be a waste of effort to write, and a monumental waste of effort to test properly.

But wouldn't overloaded functions slow your program down?
For example, suppose you have two codes, one has only one function named func, and other code has 3 functions, one takes double, one takes float and the other one int. What if you call func? Wouldn't the first code call it faster, since on the other code, compiler will have to check if inputs are int, float or double?
Indi
darth_revan wrote:
Indi wrote:

i'm sorry, that makes absolutely no sense at all. You don't seem to be aware of how templates work. Templates are compile on demand. If std::list<T> has functions you will never use, so what? You won't pay for them. A home-made linked list class will probably not be faster, and it will definitely be a waste of effort to write, and a monumental waste of effort to test properly.

But wouldn't overloaded functions slow your program down?
For example, suppose you have two codes, one has only one function named func, and other code has 3 functions, one takes double, one takes float and the other one int. What if you call func? Wouldn't the first code call it faster, since on the other code, compiler will have to check if inputs are int, float or double?

No. >_<

It seems that not only do you misunderstand how templates work, you do not understand function overloading. >_<

First, let's deal with the template problem. Look at the code below:
Code:
template <typename T, unsigned int N>
class array
{
public:
   void set_element(unsigned int n, T const& v)
   {
      elements_[n] = v;
   }
   
   T get_element(unsigned int n) const
   {
      return elements_[n];
   }
   
private:
   T elements_[N];
};

int main()
{
   array<double, 10> a;
   
   a.set_element(5, 123.45);
   
   return 0;
}

In the code above, the function array<double, 10>::get_element() is not used, although array<double, 10>::set_element() is.

An important feature of templates is nothing gets compiled if it is not used. array<float, 10>::set_element() is not used, so it is not compiled. array<double, 15>::set_element() is not used, so it is not compiled. And array<double, 10>::get_element() is not used, so it is not compiled.

This behaviour is required by the C++ standard, for good reasons. So if you were to use std::list<T> but only use two or three of the member functions, the functions that you do not use will not be compiled.

If you want proof that i'm not making this up, try this code:
Code:
#include <iostream>
#include <ostream>
#include <typeinfo>

template <typename T>
class foo
{
public:
   explict foo(T const& t) : t_(t) {}
   
   void print()
   {
      std::cout << "Basic printing: " << typeid(t_).name() << '\n';
   }
   
   void print_with_operator()
   {
      std::cout << "Operator printing: " << t_ << '\n';
   }
   
private:
   T t_;
};

struct A
{
   int n;
};

struct B
{
   int n;
};

std::ostream& operator<<(std::ostream& o, A const& a)
{
   o << a.n;
   return o;
}

int main()
{
   A a = { 1 };
   B b = { 2 };
   
   foo<A> f_a(a);
   foo<B> f_b(b);
   
   // No problems
   f_a.print();
   f_b.print();
   
   // Ah ha
   f_a.print_with_operator();
   //f_b.print_with_operator();
   
   // This program will work unless you uncomment the line above.
   // Because when you do so, the compiler tries to compile
   // foo<B>::print_with_operator(), which requires B to support
   // output to an ostream with operator <<. A has that support, B
   // does not. This is why C++ requires templates to be compile
   // on demand.
   
   return 0;
}


The second item of confusion seems to be that you think that overloaded functions are resolved at run time. They're not. The following two sources (usually) compile to identical programs - that run at identical speeds (the only time they don't compile to identical programs is when you do a debug compile that includes the function names):
Code:
// Program 1
#include <iostream>
#include <string>

void print(int n) { std:: cout << n; }
void print(float n) { std:: cout << n; }
void print(std::string const& n) { std:: cout << n; }

int main()
{
   print(1);
   print(3.14);
   print("text");
   
   return 0;
}

// Program 2
#include <iostream>
#include <string>

void print_int(int n) { std:: cout << n; }
void print_float(float n) { std:: cout << n; }
void print_string(std::string const& n) { std:: cout << n; }

int main()
{
   print_int(1);
   print_float(3.14);
   print_string("text");
   
   return 0;
}


Furthermore, the following two programs run at the same speeds, and will generate identical code (if unused functions are stripped):
Code:
// Program 1
#include <iostream>
#include <string>

void print(int n) { std:: cout << n; }
void print(float n) { std:: cout << n; }
void print(std::string const& n) { std:: cout << n; }

int main()
{
   print(1);
   
   return 0;
}

// Program 2
#include <iostream>

void print(int n) { std:: cout << n; }

int main()
{
   print(1);
   
   return 0;
}


Perhaps you should learn more about C++ before making any more recommendations on how and when it should be used.
looseballs
Indi wrote:
darth_revan wrote:
Both DirectX and OpenGL will fit greatly on C++. If you're serious about gaming, try C++. You are free to do whatever you want.

As i know, low level languages are faster, since you can optimize what the code does, more than you can on high level languages.

Some people start C before C++, which is not a bad idea. But if you want it enough, difficulties of C++ will be no problem Wink

i always recommend starting with C++ if C++ is your ultimate goal. Don't bother learning C if you don't intend to be a C programmer. You'll just end up picking up C habits which are fine in C but bad in C++.

Besides, C++ can be a whole hell of a lot easier for a beginner, if approached properly. Consider how much easier a simple program to do something like read a name and parrot it back is.

C version:
Code:
#include <stdio.h>

#define MAX_NAME_LENGTH 50

int main(void)
{
   char name[MAX_NAME_LENGTH] = "Nobody";
   char* p_newline = 0;
   
   puts("What is your name?");
   
   fgets(name, MAX_NAME_LENGTH, stdin);
   
   if ((p_newline = strrchr(name, '\n')) != NULL)
      *p_newline = '\0';
   
   printf("\nHello, %s!", name);
   
   return 0;
}

Now is that really clear?

C++ version:
Code:
#include <iostream>
#include <string>

int main()
{
   using namespace std;
   
   string name("Nobody");
   
   cout << "What is your name?\n";
   getline(cin, name);
   
   cout << "\nHello" << name << '!';
   
   return 0;
}

Isn't that much easier for a beginner?



....uh, not really, lol, i have no idea wat MOST of that says....but yea, im gonna start with python, then learn c++ with opengl and direct x, becuase c and C++ are similar, more so than some launguages, so yea, it might be hard 2 convert from c to c++ as if i just start with C++...ok, well, let me read on...and all of this code confuses my by the way, i have no idea wat 2 make of it besides maybe putting it some compilers Very Happy. Well, please link me 2 any good tutorials, THANKS!!!
Related topics
Languages
Create something like FSter
Learn Assembly: the LUCID way
Trying to Learn German
programing tutorials
how u get perfaction in php and myqsl programing
A tribute to 9/11 Victims..
I need all the tips, I can get
i love french.........
Learn how to play guitar ebook
Which script is good to learn?
how did you learn about html, php or other languages???
i want to learn php how should i start
i want to learn programing
Reply to topic    Frihost Forum Index -> Scripting -> Others

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.