PDA

View Full Version : Best way to start learning C




j03
Mar 17, 2008, 09:39 PM
Hey you all,

This is my first post on these forums. I need to start learning C , what do you think the best way to program in C on the macbook (not pro) is? I have xcode, ,but is there a better way to go about learning other than using a IDE or all in one program?

Thanks all!

j03



lee1210
Mar 17, 2008, 10:11 PM
Get a vim cheatsheet, use that to edit your source files.


#include <stdio.h>

int main(int argc, char *argv[]) {
printf("Hello World!\n");
return 0;
}

save it as helloworld.c, then compile:
gcc -o helloworld helloworld.c
./helloworld

XCode can handle C fine, but you will find vi(m) on most any unix-like system, and likely have cc or gcc available for compilation.

Good luck! Have fun!

-Lee

j03
Mar 18, 2008, 08:46 AM
Get a vim cheatsheet, use that to edit your source files.

save it as helloworld.c, then compile:
gcc -o helloworld helloworld.c
./helloworld

-Lee

What is a VIM cheatsheet and how do i do : gcc -o helloworld helloworld.c
./helloworld

yeroen
Mar 18, 2008, 09:04 AM
open Terminal.app and start typing

(Alongside C, you should also learn the OS X unix environment. The terminal provides a shell to the OS. Once you learn your way around the shell, you'll find it to be the most powerful tool at your disposal)

vim is a "modal" text editor found on all unix systems: http://en.wikipedia.org/wiki/Vim_%28text_editor%29

A vim cheatsheet is a list of all the commonly used keystrokes. It's a bit unintuitive at first, but the effort spent in learning vi (or emacs) pays off handsomely in the long term.

Alternatively you could just skip vim for now, and edit your C-source in any text editor of your choice (like TextEdit.app).

Muncher
Mar 18, 2008, 09:52 PM
Hey you all,

This is my first post on these forums. I need to start learning C , what do you think the best way to program in C on the macbook (not pro) is? I have xcode, ,but is there a better way to go about learning other than using a IDE or all in one program?

Thanks all!

j03

I strongly recommend Xcode. It takes care of just about everything for a standard command-line program for you.

Just go to File > New Project > Command Line Utility > Standard Tool

Then just do whatever you wanted to do.

lee1210
Mar 18, 2008, 10:16 PM
I'm going to have to disagree with starting with Xcode for your first program. It's like using a high-powered laser cannon to open a can. Someday when you need to open a 20-story can, you might start considering the laser, but for your first program I would stick to a can opener.

A vi(m) cheatsheet can be be found here:
http://www2.cs.uidaho.edu/~rinker/ed03.pdf

To run vim you'll need to open terminal in OS X. from there, you can start with:
vi helloworld.c

This will open vi with a new document called helloworld.c. Open a second terminal window with ctrl+n.

In the vim window, enter (i)nsert mode with the i key. Then type:
#include <stdio.h>
int main(int argc,char *argv[]) {
printf("Hello World!\n");
}

Once you've entered this text, press esc to exit insert mode. Then type :w<enter>. This will (w)rite the changes you've made.

In your second terminal window, enter:
gcc -o helloworld helloworld.c
./helloworld

The commands in vim will be confusing at first. However, knowing how to use this editor, if you will ever work on another unix-like system, will be invaluable. For starters what's in this post, plus :q to quit are all you'll need. You can then move on to deleting characters, words, etc. Eventually working up to replacement, undo and redo, etc.

Muncher
Mar 18, 2008, 11:11 PM
I'm going to have to disagree with starting with Xcode for your first program. It's like using a high-powered laser cannon to open a can. Someday when you need to open a 20-story can, you might start considering the laser, but for your first program I would stick to a can opener.

A vi(m) cheatsheet can be be found here:
http://www2.cs.uidaho.edu/~rinker/ed03.pdf

To run vim you'll need to open terminal in OS X. from there, you can start with:
vi helloworld.c

This will open vi with a new document called helloworld.c. Open a second terminal window with ctrl+n.

In the vim window, enter (i)nsert mode with the i key. Then type:
#include <stdio.h>
int main(int argc,char *argv[]) {
printf("Hello World!\n");
}

Once you've entered this text, press esc to exit insert mode. Then type :w<enter>. This will (w)rite the changes you've made.

In your second terminal window, enter:
gcc -o helloworld helloworld.c
./helloworld

The commands in vim will be confusing at first. However, knowing how to use this editor, if you will ever work on another unix-like system, will be invaluable. For starters what's in this post, plus :q to quit are all you'll need. You can then move on to deleting characters, words, etc. Eventually working up to replacement, undo and redo, etc.

I agree, sort of. I just remember how much frustration I got because of not using an IDE as a beginner programmer. Any shell/terminal can be hell to figure out on your own.

lee1210
Mar 18, 2008, 11:26 PM
I guess I feel this way about IDEs:
you should be able to use an IDE, you shouldn't need to use one.

I doubt the original poster cares much about any of this. either path should reach the same goal, I was trying to suggest what I believe leads to the most versatility.

-Lee

j03
Mar 19, 2008, 07:54 AM
Well, this is a good way of putting it. Is using xCODE the same as trying to make a website in dreamweaver:design view and terminal more like hand coding a website (the right way a website is created) ?

I just don't want to jump down the xcode path and then always have to use that in order to program c. I mean I'm sure if i start with just the xcode path to get down some basics then try to figure out terminal and then work then together ? Does that sound better? Thanks for all the replies too btw.

yeroen
Mar 19, 2008, 09:03 AM
I agree, sort of. I just remember how much frustration I got because of not using an IDE as a beginner programmer. Any shell/terminal can be hell to figure out on your own.

Perhaps it's a generational thing, but I find that to be much more the case with IDE's. Once you've learned how to use the shell, it's practically universal across all systems. IDE's have a lot in common, but you find yourself having to learn each one anew.

lee1210
Mar 19, 2008, 09:12 AM
Well, this is a good way of putting it. Is using xCODE the same as trying to make a website in dreamweaver:design view and terminal more like hand coding a website (the right way a website is created) ?

I just don't want to jump down the xcode path and then always have to use that in order to program c. I mean I'm sure if i start with just the xcode path to get down some basics then try to figure out terminal and then work then together ? Does that sound better? Thanks for all the replies too btw.

The dreamweaver comparison is somewhat accurate. You still have to write most of the code in XCode, but it hooks in to the compiler, so you don't have to worry about that yourself, it hooks in to the debugger so you don't have to worry about that yourself, etc. It's a great tool, but I think you end up more well-rounded if you know how to use a unix editor (i prefer vi, so i was pushing that, but emacs seems to be equally popular), you know how to use a compiler and figure out some switches (i.e. -g sets up your binary with debugging symbols), you know how to run things from the command line, you know how to use a debugger, and so on.

My real reasoning here is that someday you might want to write something somewhere other than your mac. If that's the case, XCode is likely unavailable. I think the same way about Visual Studio, etc. There are times when, in languages like Java or C#, I feel like working without an IDE is much trickier. Mostly because of the breadth of their class libraries and "code completion" features that IDEs have.

I think the important thing is you just start programming in either environment, and if you want to switch later, you should be fine. If you want to use XCode as your editor, but still compile and run your program in the command line so you don't have to use vi, that's great. The only pitfall I would try to avoid is taking the power of XCode for granted. You enter your source, and then you press the "build and go" button, and that's it. You don't know what it did, but your program ran. I think it's important to know the mechanics.

Good luck, if you have any issues getting started browse the forums and if you can't come up with anything post. People here are glad to help.

-Lee

j03
Mar 19, 2008, 09:49 AM
The dreamweaver comparison is somewhat accurate. You still have to write most of the code in XCode, but it hooks in to the compiler, so you don't have to worry about that yourself, it hooks in to the debugger so you don't have to worry about that yourself, etc. It's a great tool, but I think you end up more well-rounded if you know how to use a unix editor (i prefer vi, so i was pushing that, but emacs seems to be equally popular), you know how to use a compiler and figure out some switches (i.e. -g sets up your binary with debugging symbols), you know how to run things from the command line, you know how to use a debugger, and so on.

My real reasoning here is that someday you might want to write something somewhere other than your mac. If that's the case, XCode is likely unavailable. I think the same way about Visual Studio, etc. There are times when, in languages like Java or C#, I feel like working without an IDE is much trickier. Mostly because of the breadth of their class libraries and "code completion" features that IDEs have.

I think the important thing is you just start programming in either environment, and if you want to switch later, you should be fine. If you want to use XCode as your editor, but still compile and run your program in the command line so you don't have to use vi, that's great. The only pitfall I would try to avoid is taking the power of XCode for granted. You enter your source, and then you press the "build and go" button, and that's it. You don't know what it did, but your program ran. I think it's important to know the mechanics.

Good luck, if you have any issues getting started browse the forums and if you can't come up with anything post. People here are glad to help.

-Lee

Lee, along with others : Thanks so much. I will just begin writing C in xCODE just to get down some basics, then I will look into the command line because I think as many of you said - it's something you definately should know if your not on a mac with xcode or on a pc with VS. Thanks all! I will bookmark this forum for future use for C programming thanks!!

jamesapp
Mar 19, 2008, 11:26 AM
trying to do exercise from chapter 13 of a book on programming with objective-c
1. write a function that calculates the average of an array of 10 floating-point values and returns the result.

i have the function to get the average i think?
i tried to put 10 elements into an array, and then tried to print the average at the end of the program. here is the function for my program.


float average (float data[])
{
int i;
float sum, average;

for (i = 0; i < 10; ++i)
sum += data[i];

average = sum / 10;

return average;
}

here are the error messages i am getting when i try to run my test program which i called exc1chap13.m

exc1chap13.m:5: error: syntax error before ‘}’ token
exc1chap13.m: In function ‘average’:
exc1chap13.m:19: error: nested functions are disabled, use -fnested-functions to re-enable
exc1chap13.m:23: error: syntax error at end of input

and here is my test program

#import <stdio.h>


float data [10] = { 10, 5, -3, 17, 82, 9, 0, 0, 8, -7 };
}
float average (float data[])
{
int i;
float sum, average;

for (i = 0; i < 10; ++i)
sum += data[i];

average = sum / 10;

return average;

int main (int argc, char *argv[])
{

printf ("the average of the array is %i\n", average);

}

if i don't get an answer:

error messages

exc1chap13.a.m: In function ‘main’:
exc1chap13.a.m:7: error: syntax error before ‘{’ token
exc1chap13.a.m:10: error: conflicting types for ‘average’
exc1chap13.a.m:7: error: previous definition of ‘average’ was here
exc1chap13.a.m:12: error: syntax error before ‘for’

test program:

#import <stdio.h>

int main (int argc, char *argv[])


float average (float data[])
{
int x[10] = {3, 7, -9, 3, 6, -1, 7, 9, 1, -5);
int i;
float sum, average;

for (i = 0; i < 10; ++i)
sum += data[i];

average = sum / 10;

printf ("the average of the array is %i\n", average);

return average;
}

brn2ski00
Mar 19, 2008, 11:29 AM
Depends on the type of C programming you are going to do. If you are going to just write command line apps, then XCode is overkill. But if you plan to use C as the Controller piece of a large app, then XCode would be your best bet.

It boils down to needs.

fatpwnage
Mar 19, 2008, 03:11 PM
May I ask why you want to learn C instead of C++? C++ is better than C in every way, so learning C is backwards seeming.

szark
Mar 19, 2008, 03:29 PM
and here is my test program

#import <stdio.h>


float data [10] = { 10, 5, -3, 17, 82, 9, 0, 0, 8, -7 };
}
float average (float data[])
{
int i;
float sum, average;

for (i = 0; i < 10; ++i)
sum += data[i];

average = sum / 10;

return average;

int main (int argc, char *argv[])
{

printf ("the average of the array is %i\n", average);

}



The bracket in red should be after the line in blue. You also need to call the function "average" from your main() function.

You might also ask yourself: What is the value of "sum" before you start adding data values to it? ;)

admanimal
Mar 19, 2008, 03:30 PM
May I ask why you want to learn C instead of C++? C++ is better than C in every way, so learning C is backwards seeming.

That is a highly subjective opinion you have there. Besides, learning C first is not backwards, since C++ is a superset of C. You have to know C to know C++, whether you realize it or not. If the OP wants to learn Objective-C eventually, learning C++ first would be overkill.

ChrisA
Mar 19, 2008, 03:32 PM
May I ask why you want to learn C instead of C++? C++ is better than C in every way, so learning C is backwards seeming.

In every way?

Perhaps he wants to program a microcontroller or write real-time software or become a "kernel hacker". There was a thread here yesterday about learning asembly language. I've been working in software development for a few years (going back to the 70s) and I can count the number of desktop GUI apps I've written at maybe four total.

yeroen
Mar 19, 2008, 04:15 PM
May I ask why you want to learn C instead of C++? C++ is better than C in every way, so learning C is backwards seeming.

The beginning developer intending to learn C++ will be well served by the astringent of pure C.

C++ can be a very elegant and powerful tool in the right hands. When wielded by the inexperienced programmer, it often leads to buggier, more brittle, less maintainable, and less comprehensible code. C++ increases the number of subtleties, traps, pitfalls, and gotchas by an order of magnitude over pure C. IMHO, best to make all the beginner mistakes in C before moving on to making varsity mistakes in C++.

Besides, for operating systems, compilers, real-time and embedded software, even the bulk of open-source application software, a facility with C and the C APIs remain a pre-requisite.

Cromulent
Mar 19, 2008, 04:41 PM
May I ask why you want to learn C instead of C++? C++ is better than C in every way, so learning C is backwards seeming.

Hardly. C++ is just a hacked version of C.

lee1210
Mar 19, 2008, 07:25 PM
May I ask why you want to learn C instead of C++? C++ is better than C in every way, so learning C is backwards seeming.

C++ can be great, or awful. It was mentioned that C++ is a superset, but it is not a proper superset and there are some operator precedence issues, etc.. There are valid reasons to want to know C, and C++ is not the path to get there.

It's not an issue to ask, but is presumptuous to state that C++ is better in every way. It also seems to me that learning C++ first is backwards, being that C++ is nearly a superset of C. Learning addition before algebra is not backwards.

psingh01
Mar 20, 2008, 05:32 PM
Use XCode. Don't waste time with VIM or any other editors some "hardcore programmer" will guide you to. You'll know when you need to learn such a thing, but not when you are starting.

trogdor!
Mar 20, 2008, 06:54 PM
Heres my take on learning C.

Start out with just text editor or just a syntax highlighting text app and learn the basics. In formal school training, we were not allowed to use high functionality IDE's for the first 2 quarters because they wanted us to get the basics with our first assignments. It really does help you actually understand things better and once you starting using IDE's. Once you feel good programing some simple stuff in text editors and remembering code syntax and form, then you can start trying some IDE's and watch how they really help large projects come together by helping you find built in functions quickly and help you code quicker. Many say only true hardcore programmers know how to code in straight text. That is true to some degree, but it is a waste of time once you have an idea what your doing. IDE's can save lots of time by helping you debug quicker and identify errors. Your end goal should also to not just be able to program, but to be able to program with efficient use of memory and performance (algorithm timing and complexity).

As for starting out though, it really does help to learn the basics through just text editing.

As for languages, C is one the best ways to start out programming. Once you learn it this way, you appreciate any newer languages. Also, once you learn one high level language, the others come really easy after that.

zippyfly
Mar 22, 2008, 12:58 PM
I humbly disagree with most of the comments here.

I don't recommend VIM and don't recommend Xcode either.

I do recommend using TERMINAL and learning at least the basic Bash Shell commands to list directory contents (ls) and change directories (cd).

Now, install the free and wonderful TextWrangler (google it) including the command line tools. You can then type "edit hello.m" at the command line.

In exchange for this little tidbit of information, I need help from the pros. I am STILL stick on pointers. I know what they are in C but I am confused by how they are used when creating and referencing objects in ObjC.

When do I use the * and when do I not in ObjC (not C)??

Why does the * sometimes exist on its own??

It is terribly confusing. PLEASE HELP. ANYONE! None of the web pages or text books explain this well. It must be a conspiracy or something! Haha.

Thanks!

lee1210
Mar 22, 2008, 01:16 PM
I humbly disagree with most of the comments here.

I don't recommend VIM and don't recommend Xcode either.

I do recommend using TERMINAL and learning at least the basic Bash Shell commands to list directory contents (ls) and change directories (cd).

Now, install the free and wonderful TextWrangler (google it) including the command line tools. You can then type "edit hello.m" at the command line.

In exchange for this little tidbit of information, I need help from the pros. I am STILL stick on pointers. I know what they are in C but I am confused by how they are used when creating and referencing objects in ObjC.

When do I use the * and when do I not in ObjC (not C)??

Why does the * sometimes exist on its own??

It is terribly confusing. PLEASE HELP. ANYONE! None of the web pages or text books explain this well. It must be a conspiracy or something! Haha.

Thanks!

Some code (in a new thread) would probably help people assist you. If you are working with classes (if you aren't, it's pretty much just C), you'll probably be using a lot of pointers. I have done very little Obj-C programming, but essentially anything with an init method is going to give you a pointer. The possible exception would be when using what is essentially a struct. An example is NSRange. You don't have to call anything on it, you just set its fields. There are some methods, but you don't need to initialize it.

As for TextWrangler, if you will only program on the Mac, I'm sure it would fit the bill. TextWrangler is not cross platform, though. That's the only reason I will, stubbornly and annoyingly, continue to insist on vim.

-Lee

mduser63
Mar 22, 2008, 09:10 PM
Use XCode. Don't waste time with VIM or any other editors some "hardcore programmer" will guide you to. You'll know when you need to learn such a thing, but not when you are starting.

I agree completely. VI/VIM, and to a lesser extent emacs, are some of the best examples of awful computer/human interaction design out there. I realize that those who are used to them are fast with them and find them powerful, but I can honestly say that if someone had forced me to use either one when I was just starting programming, I likely would haven given up after less than a day because they're so frustratingly obtuse to a beginner. Not only that, but they're hardly necessary. There are very good GUI based editors on all the platforms, and they have enough in common that switching between them is no big deal. I recommend TextMate on the Mac. It's not free, but it's very good and while it's incredibly powerful, it is also dead simple to use just for basic editing. If you want/need free, TextWrangler is also a good choice.

If no one taught you how to use VI and just sat you down in front of it, you'd probably guess that your keyboard was broken because its behavior is so obscure and unexpected compared to every other application the average person is used to.

(This is coming from someone who writes code all day both for my day job as an EE and on my own as a shareware developer. I'm fully capable of using both VI and emacs and have used them fairly extensively on UNIX workstations. Frankly I think they're horrible.)

yeroen
Mar 22, 2008, 09:49 PM
I agree completely. VI/VIM, and to a lesser extent emacs, are some of the best examples of awful computer/human interaction design out there. I realize that those who are used to them are fast with them and find them powerful, but I can honestly say that if someone had forced me to use either one when I was just starting programming, I likely would haven given up after less than a day because they're so frustratingly obtuse to a beginner. Not only that, but they're hardly necessary. There are very good GUI based editors on all the platforms, and they have enough in common that switching between them is no big deal. I recommend TextMate on the Mac. It's not free, but it's very good and while it's incredibly powerful, it is also dead simple to use just for basic editing. If you want/need free, TextWrangler is also a good choice.

If no one taught you how to use VI and just sat you down in front of it, you'd probably guess that your keyboard was broken because its behavior is so obscure and unexpected compared to every other application the average person is used to.

(This is coming from someone who writes code all day both for my day job as an EE and on my own as a shareware developer. I'm fully capable of using both VI and emacs and have used them fairly extensively on UNIX workstations. Frankly I think they're horrible.)

I love that vi enables me to edit w/o ever leaving the terminal (less so emacs, which I never quite warmed up to). It also comes in handy when a GUI isn't an option, say the X server on your linux box is hosed due to a corrupted config file. When I first learned vi as part of a fortran programming course >15 years ago, I was repulsed. With some practice it became second nature and soon I was editing faster and more efficiently than I ever was, or have since, been able to with a GUI editor.

That being said, for a newbie starting out, learning vi/emacs should be something that they learn eventually as part of the culture, but it's no longer strictly necessary. TextMate is really nice, but being priced in euros makes it a very expensive (for a text editor) option at $60.

noelister
Mar 31, 2008, 01:11 PM
I'm going to have to disagree with starting with Xcode for your first program. It's like using a high-powered laser cannon to open a can. Someday when you need to open a 20-story can, you might start considering the laser, but for your first program I would stick to a can opener.

A vi(m) cheatsheet can be be found here:
http://www2.cs.uidaho.edu/~rinker/ed03.pdf

To run vim you'll need to open terminal in OS X. from there, you can start with:
vi helloworld.c

This will open vi with a new document called helloworld.c. Open a second terminal window with ctrl+n.

In the vim window, enter (i)nsert mode with the i key. Then type:
#include <stdio.h>
int main(int argc,char *argv[]) {
printf("Hello World!\n");
}

Once you've entered this text, press esc to exit insert mode. Then type :w<enter>. This will (w)rite the changes you've made.

In your second terminal window, enter:
gcc -o helloworld helloworld.c
./helloworld

The commands in vim will be confusing at first. However, knowing how to use this editor, if you will ever work on another unix-like system, will be invaluable. For starters what's in this post, plus :q to quit are all you'll need. You can then move on to deleting characters, words, etc. Eventually working up to replacement, undo and redo, etc.

Hello,

how do I run this little guy from the command line... I can navigate to the file with finder and run the file by double clicking on it but I cannot seem to run it from the command line.

Thanks

Cephus
Jun 22, 2008, 03:25 PM
May I ask why you want to learn C instead of C++? C++ is better than C in every way, so learning C is backwards seeming.

As someone else commented in this thread, I'm learning C to program PIC microcontrollers. I'm also dabbling in assembly language which is also used with the microcontrollers.

Cephus
Jun 22, 2008, 04:16 PM
I'm going to have to disagree with starting with Xcode for your first program. It's like using a high-powered laser cannon to open a can. Someday when you need to open a 20-story can, you might start considering the laser, but for your first program I would stick to a can opener.

A vi(m) cheatsheet can be be found here:
http://www2.cs.uidaho.edu/~rinker/ed03.pdf

To run vim you'll need to open terminal in OS X. from there, you can start with:
vi helloworld.c

This will open vi with a new document called helloworld.c. Open a second terminal window with ctrl+n.

In the vim window, enter (i)nsert mode with the i key. Then type:
#include <stdio.h>
int main(int argc,char *argv[]) {
printf("Hello World!\n");
}

Once you've entered this text, press esc to exit insert mode. Then type :w<enter>. This will (w)rite the changes you've made.

In your second terminal window, enter:
gcc -o helloworld helloworld.c
./helloworld

The commands in vim will be confusing at first. However, knowing how to use this editor, if you will ever work on another unix-like system, will be invaluable. For starters what's in this post, plus :q to quit are all you'll need. You can then move on to deleting characters, words, etc. Eventually working up to replacement, undo and redo, etc.

Wow! It works! My Macbook responded "Hello World" at the ./helloworld command!

There is so very little documention online that give tutorials that work on a Mac. I tend to forget that OS-X is Unix based and includes many of the tools so common on Unix/Linux.

I did load the XCODE off my Leopard CD since I didn't otherwise know how to get just the command line stuff. I do think I'll use a different editor other than VI - perhaps Smultron (Mac freeware). Never liked the quirkiness of VI.

neonblue2
Jun 22, 2008, 05:34 PM
I agree completely. VI/VIM, and to a lesser extent emacs, are some of the best examples of awful computer/human interaction design out there. I realize that those who are used to them are fast with them and find them powerful, but I can honestly say that if someone had forced me to use either one when I was just starting programming, I likely would haven given up after less than a day because they're so frustratingly obtuse to a beginner. Not only that, but they're hardly necessary. There are very good GUI based editors on all the platforms, and they have enough in common that switching between them is no big deal. I recommend TextMate on the Mac. It's not free, but it's very good and while it's incredibly powerful, it is also dead simple to use just for basic editing. If you want/need free, TextWrangler is also a good choice.

If no one taught you how to use VI and just sat you down in front of it, you'd probably guess that your keyboard was broken because its behavior is so obscure and unexpected compared to every other application the average person is used to.

(This is coming from someone who writes code all day both for my day job as an EE and on my own as a shareware developer. I'm fully capable of using both VI and emacs and have used them fairly extensively on UNIX workstations. Frankly I think they're horrible.)

Totally agree. Terminal-based text editors are as user friendly as some as the people here. The best way to learn something is to find a good way to learn. Chucking a new programmer into VI when they don't even know how it works is just plain wrong, like putting a learner driver onto a highway without any experience.

lee1210
Jun 22, 2008, 06:10 PM
Totally agree. Terminal-based text editors are as user friendly as some as the people here. The best way to learn something is to find a good way to learn. Chucking a new programmer into VI when they don't even know how it works is just plain wrong, like putting a learner driver onto a highway without any experience.

It's exactly like that, except in one case you're likely to be killed or total the car, and in the other you'll have to spend a few days with a cheat sheet and then you'll be able to use a great text editor available on practically any *nix machine. They are practically identitcal! =)

As for the friendliness of people here, I've only seen rudeness in pretty rare circumstances. Generally people get comprehensive help with a bevy of subjects very quickly.

-Lee

Denarius
Jun 22, 2008, 07:45 PM
Some code (in a new thread) would probably help people assist you. If you are working with classes (if you aren't, it's pretty much just C), you'll probably be using a lot of pointers. I have done very little Obj-C programming, but essentially anything with an init method is going to give you a pointer. The possible exception would be when using what is essentially a struct. An example is NSRange. You don't have to call anything on it, you just set its fields. There are some methods, but you don't need to initialize it.

As for TextWrangler, if you will only program on the Mac, I'm sure it would fit the bill. TextWrangler is not cross platform, though. That's the only reason I will, stubbornly and annoyingly, continue to insist on vim.

-Lee

Way I look at it, if you've got the brains to write good programs, you've easily got the brains to get the hang of vi pretty quickly. TextWrangler is a nice bit of software though.

Damn, what was that command for search backwards again? Oh and now I've gone and broken my script again. D'oh! ;)

Sander
Jun 23, 2008, 03:02 AM
Hardly. C++ is just a hacked version of C.

Are you trying to pick a fight..?