could someone suggest good place to learn C ? or maybe i should go with C++ ? i know some other languages ( Ruby, PHP, OCaml, Smalltalk, Delphi, C#, VB... ) so no need for tutorials that explain what is variable and how to use 'if' and such...
Might be good to learn C first. C++ is admittedly a bit of a mess, and it might be easier to find your way around if you know C first.
Out of the languages you mentioned, PHP and C# are probably closest, syntax-wise. It's been a long time since I learned it and I just picked up a book at random and read it, so I don't have much good advice for where to learn it. I can point out the things you might want to look at, though:
Well, those are some random unorganized thoughts. Have fun!
thanks man... just finished reading Introductory Class Notes ( http://www.eskimo.com/~scs/cclass/notes/ ) which did explain most of that stuff you mentioned now to Intermediate Class Notes ( http://www.eskimo.com/~scs/cclass/int/ ) anything else i should keep eyes open for ? and i was wondering about what magic you need to set up things so that you could ./configure && make && make install ?
Makefiles are deep magic, and autoconf I've never dared go near. Make is mostly independent from C, though, so you can just ignore it if you want, and build things by hand. When your source grows beyond a couple of files, though, you may want to learn how to use it.
autoconf and automake are at least easier to write than handmade Makefiles.
Quick Guide off the top of my head:
bin_PROGRAMS = <program name>
<program name>_SOURCES = <source .c .h and other files>
That assumes you already have everything installed, though.
I don't like autoconf, though, because if you use it, you instantly limit yourself to POSIX systems. If you're writing just ANSI C without any deeper hooks into the system, you're better off staying away from autoconf.
The usual approach to that is to also include a CodeWarrior or MPW or Visual C++ or Xcode or whatever crazy project file along with it, as well as a handmade config.h or whatever else the autoconf scripts would usually generate to go with it.
Except nobody does. Autoconf is fine (ok, it's a kludge for a kludge for a kludge, but it sort of works) for projects that are heavily Unix-dependent, but when simple command-line programs, or even worse, libraries use it, I feel ANGER.
Unless you're writing something which has serious POSIX portability problems, or which uses metric assloads of different libraries, Autoconf is overcomplex, the proverbial artillery instead of a flyswatter. Simple programs that don't need wads of different libraries or don't depend on nonstandard C library extensions should just have a simple makefile which has targets for "all", "test", "clean", and maybe "depend" if it has funny header dependencies.
Learning to use make is actually pretty simple. Check out the O'Reilly book on make, which gives excellent tutorials. Also check out the makefile for simple programs that don't use Autoconf. The makefiles generated by Autoconf are insanely complex, and hard for mere mortals to understand.
I'd prefer autotools to having to rewrite the build script to use OS X shared library flags with cc instead of Linux's.
That was for libraries, I mean. I don't care much about simple programs, and I'm certainly not going to add autoconf to tripper2ch. Even though part of it doesn't compile on glibc anymore.
I'd prefer that Apple hadn't felt the need to swap a perfectly good, widely accepted two-letter extension with a five-letter one and break a considerable amount of POSIX source packages, including some that do in fact use use autotools.
Though, you usually need to hack the build script anyway due to their fucked up libtool.
.dylib was inherited from NeXT.
More on the pain of OS X:
http://loneronin.typepad.com/the_lone_ronin/2005/05/openbsd_day_fiv.html
>>16
That's just a BSD fanboy having a cry because things are different and because Apple target towards normal desktop users first, rather than developers wanting everything free, opensource with code provided.
My favorite part is how he complains about how OS X is annoying and then goes back to OpenBSD, of all things.
local wString
set wString to "("
repeat 128 times
set wString to (wString & "w")
end repeat
display dialog wString
WakabaMark screwed up my beautifully indented AppleScript :(
WakabaMark is evil :/
Indent code by four spaces or one tab. It's not like you could make indented code in plain HTML text anyway without somehow adding a <pre> block.
For those complaining about OSX and OpenBSD.... would you rather have M$ WinBlow$?
By the way... I'm a user.... of what??
I'd rather have Windows if the only choice was between that and OpenBSD, at least for a machine that isn't a server. If I need a unix environment, I can always SSH into it.
>>22
Pointers can be a nuisance, but structs are one of the things I particularly liked about C.
"M$ WinBlow$"? What are you, fourteen years old?
Just sticking it to "the man" or something. Whatever.
#include <stdio.h>
void main() {
printf("Hello world");
}
I think this is the best start :P
compile it with GNU
If you want to learn PHP
Try download the manual of PHP from
http://www.php.net/ I learned of all my skill from those manuals
http://www.apache.org/ for the server
and http://www.mysql.com/ for the database :P
>>29
No! "The database" as you call it, must be www.postgresql.org
For great justice! :)
> If you want to learn PHP
Why on earth would you want anything like that? Especially in a thread about learning a real programming language? <-- troll
Ah, i missread that He already can use php , hehee, pardon me
MOE-C
ttp://moe-c.chu.jp/main.html
oh, it burns it burns
ttp phaggotry fixed: http://moe-c.chu.jp/main.html
What exactly am I looking at?
>>28
Bonehead.
never gets old
C is so old.
Isn't the rest of the world using D, E or even F now?
I know about D (and love it) but is there a viable E or F?
>>38
I don't know about E, but he probably means F# with F;
F# is a terrible language.
As for D, the language itself is not that bad, but the implementation is horrible.
C++ is not that bad, I prefer it than D.
> F# is a terrible language.
Because it's made by Microsoft?
> the implementation is horrible.
Elaborate a bit on that?
> F# is a terrible language.
Hopefully it's not too close a copy of Ocaml. I'm still pissed off over the single namespace for record field names.
E was on Amiga.
Lol whoops, I suck.
F# is simply an ML variant. ML is fairly well-regarded among functional programmers as far as I know. I have not heard anybody who actually knows anything about the matter say F# is a particularly bad language.
The people who do say it is, however, are the kind of people who go on long, badly spelled, incoherent rants about how Microsoft is EVIL AND MUST BE STOPPED, which are full of errors and outright lies.
You were wrong.
>>49
Look buddy, you are out of your league. Step back.
You really don't want to get me angry on this issue.
Perhaps you should get some therapy for those anger issues.
>>50
Or what?
We wouldn't like him when he's angry.