And as for C/C++ speed differences... the people who "think" they know what they're talking about always say C++ is slower... the thing is that you can use as much C in C++ code as you'd like. The difference is that you are allowed to create classes in C++ instead of just POD structs. Writing bad classes causes things to be very slow... the speed difference is only encountered when comparing highly hand-optimized C code to poor C++ code... it's more a potential than anything else.
Just to take a look at standard libraries.... string handling.... in C, strings must be managed by your own memory managing code. In C++, the std::string class has it's own internal memory management. In C I can write some real complex malloc/free loops and things like that to optimize my string handling... in C++ I don't need that, and the C++ strings are handled as optimal as they come (they have a block size and allocate memory in chunks of that size when it needs more... )
Anyway, that was my tyrade... if you want to talk sorting and searching... C's qsort vastly underperforms C++'s std::sort for iterator types... C++ has tons of sorting and searching algorithms built in.
I can guarentee you without a doubt that if you were to show me any C snippet, I can write C++ that outperforms it (with a slightly bigger binary size)
Also, what is more elegant:
const char *f = "for";
const char *m = "mat";
char *p = NULL;
p = malloc(strlen(f)+strlen(m),sizeof(char));
if(p == NULL) exit(1);
else strcat(p,f,m);
int x = 5;
float y = 4.3;
printf("this is a %s string, some numbers: %d %f",p,x,y);
or
const char *f = "for";
const char *m = "mat";
std::string p(f);
p += m;
int x = 5;
float y = 4.3;
std::cout << "this is a " << p << "string, some numbers: " << x << " " << y;
[/b]
]]>it took me 3-4 month's to understand python and now when I started with c it's much easier but now I alos have to learn how compiler works and that is the hard part with c,
after I learn C(3 months hopefully) I'll take a look at C++ or D,
but Python still is much faster to code in,
thanks for thre tip phrakture but I think I stay with python and c for a long time now, I'm trying to learn the python c api also but it's very difficult syntax for that,
if you have some nice links for c you're welcome to post them, I've found a few uni courses on the net but they were more for beginners only and I'm looking for something more complete,
when I get home I'll see what I can find. I'm a big fan of C++, just because I like the way you get really elegant code when doing template stuff...
]]>if you have some nice links for c you're welcome to post them, I've found a few uni courses on the net but they were more for beginners only and I'm looking for something more complete,
]]>I love you too, fellow swede
that tutorial is for getting started with the logic and syntax of Python, once you know how the structure works you can find all you need in the official documentation at python.org and pygtk.org ,I'm learning C now so I add one tutorial for that languge soon,
try here if you're delving into c++ later on : http://www.parashift.com/c++-faq-lite/index.html
]]>I love you too, fellow swede
that tutorial is for getting started with the logic and syntax of Python, once you know how the structure works you can find all you need in the official documentation at python.org and pygtk.org ,I'm learning C now so I add one tutorial for that languge soon,
*kramar*
]]>I'm learning C now so I add one tutorial for that languge soon,
]]>ok, I quit the whining and wrote my own editor instead,
man, are you serious?! :shock: :shock: :shock:
Edit:
wtf?
A beginners course in python programming, in swedish?
Man, I love you!
whats wrong with gedit.. or leafpad?
GEdit == Bloated piece of crap with tons of gnome dependencies.
Leafpad == Not enough features.
pkgname=lazy-edit
pkgver=0.2
pkgrel=1
pkgdesc="Basic GTK text editor."
url=""
depends=('pygtk')
source=(http://xerxes2.1go.dk/lazy-edit-0.2.tar.gz)
md5sums=('32e29636d26105cb2df1c17d3a667999')
build() {
cd $startdir/src/$pkgname-$pkgver
mkdir -p $startdir/pkg/usr/bin
mkdir -p $startdir/pkg/usr/share/lazy-edit
mkdir -p $startdir/pkg/usr/lib/python2.4/site-packages/lazy_edit
install -m 755 lazy-edit $startdir/pkg/usr/bin
install -m 644 rc $startdir/pkg/usr/share/lazy-edit
install -m 755 *.py $startdir/pkg/usr/lib/python2.4/site-packages/lazy_edit
}
it's of course written in the best language on the planet, 8)
]]>