You are not logged in.

#26 2010-07-12 23:04:15

Anikom15
Banned
From: United States
Registered: 2009-04-30
Posts: 836
Website

Re: Learning C, but cant get started without..

Vim has syntax "colouring" and ""smart"" automatic indentation.


Personally, I'd rather be back in Hobbiton.

Offline

#27 2010-07-12 23:49:07

drcouzelis
Member
From: Connecticut, USA
Registered: 2009-11-09
Posts: 4,092
Website

Re: Learning C, but cant get started without..

Anikom15 wrote:

Vim has syntax "colouring" and ""smart"" automatic indentation.

It might be easier to say "Vim has everything". wink

Offline

#28 2010-07-12 23:59:16

Trent
Member
From: Baltimore, MD (US)
Registered: 2009-04-16
Posts: 990

Re: Learning C, but cant get started without..

drcouzelis wrote:

It might be easier to say "Vim has everything". wink

No.  Emacs has everything.  Vim has everything worth having. smile

Offline

#29 2010-07-13 00:03:32

Inxsible
Forum Fellow
From: Chicago
Registered: 2008-06-09
Posts: 9,183

Re: Learning C, but cant get started without..

Things could get ugly here and this thread could be locked. smile


Forum Rules

There's no such thing as a stupid question, but there sure are a lot of inquisitive idiots !

Offline

#30 2010-07-13 02:38:07

saline
Member
Registered: 2010-02-20
Posts: 86

Re: Learning C, but cant get started without..

stqn wrote:

Syntax colouring and "smart" automatic indentation are also not that useful IMO.

I would have to disagree.  Syntax highlighting can aid the readability of code if it's done well.  It does take a bit of getting used to what color is what.  It can also help you spot mistakes in comment blocks overrunning, string termination.  Smart indentation is great.  It saves me a lot of tabs and spaces.

Last edited by saline (2010-07-13 02:39:10)

Offline

#31 2010-07-13 06:28:01

PJ
Member
From: Sweden
Registered: 2005-10-11
Posts: 602

Re: Learning C, but cant get started without..

drcouzelis wrote:

I was going to try out kdbg because of your comment, but I noticed it uses Qt 3. Do you find that to be a problem?

No, not since I have Scribus installed too which also requires Qt 3, but it would be nicer if both Scribus and kdbg used Qt 4 instead.

drcouzelis wrote:

Do you know if there are plans to convert it to Qt 4?

No, I don't know.

drcouzelis wrote:

Have you tried other gdb frontends?

Yes, I am using Insight at my work and I have used ddd a long time ago. Well, ddd has probably evolved since that time but when I did used it I didn't like it at all.

<edit>
I did use xxdbg at some point to but I don't remember that much of it.
</edit>

drcouzelis wrote:

I didn't mean to imply that you need a debugger when you are just getting started with programming

While a debugger is nice it is certainly not a must.

Last edited by PJ (2010-07-13 07:20:32)

Offline

#32 2010-07-13 07:31:05

samuele.mattiuzzo
Member
From: Treviso, IT
Registered: 2009-10-12
Posts: 307
Website

Re: Learning C, but cant get started without..

i've been programming C for 7 years, and still doing it... i have just one advice for you:

gcc / cc as your only compiler
vim / emacs as your editor (try them both and check which one suits your needs better)

i never could write C code outside one of those two (tried gedit, eclipse, anjuta, kate, notepad++ and codeblocks) and nothing is better than a lightweight and minimal editor smile never needed autocompleting or real time error debugging nor warnings.

when you get used to C, you'll see that writing code is very fast, sometimes a bit long, but still fast and you won't need any bloatness around

so, stick with learning emacs or vim smile

Offline

#33 2010-07-13 07:33:07

samuele.mattiuzzo
Member
From: Treviso, IT
Registered: 2009-10-12
Posts: 307
Website

Re: Learning C, but cant get started without..

PJ wrote:

While a debugger is nice it is certainly not a must.

a debugger IS a must, and one should learn it from the very beginning, from the simpliest "Hello world" or he wont' be able to use it when (maybe) will be writing kernel modules or complex projects

and gdb should be your only god tongue

Offline

#34 2010-07-13 12:18:28

drcouzelis
Member
From: Connecticut, USA
Registered: 2009-11-09
Posts: 4,092
Website

Re: Learning C, but cant get started without..

I'm surprised by some of your responses. Can you please help me to understand them better?

samuele.mattiuzzo wrote:

i never could write C code outside one of those two and nothing is better than a lightweight and minimal editor

What makes Vim and Emacs lightweight but not Gedit? Are you talking about text editing abilities or installation dependencies or something else? What caused you to never be able to write C code outside of Vim and Emacs?

samuele.mattiuzzo wrote:

a debugger IS a must, and one should learn it from the very beginning

Without having any previous knowledge of how to program, how to write C code, how to use Vim or Emacs, how to use a debugger, and how to use gdb, do you think it's a good idea to learn them all at once? Did you learn to use them all at once? As alf is "learning C", is a debugger something they "can't get started without"?

Offline

#35 2010-07-13 15:12:59

samuele.mattiuzzo
Member
From: Treviso, IT
Registered: 2009-10-12
Posts: 307
Website

Re: Learning C, but cant get started without..

open a shell -> type vim <filename> -> write -> type :wq -> cc <filename> -> ./<executable>

that's what i love about vim smile 10 seconds and the pain is gone big_smile vim is ultrafast, no dependencies, highly customizable and scriptable
emacs is the same smile i just don't like much it's macros system, so i prefer vim usually smile

i think i got used to their minimalism that's all smile i don't think you need anything more to write C code smile
about gdb, i think if you're interested in learning how it works, you should start by learning it with your simplest programs, so that it's simple also to learn the debugger smile
(i started with C and afer 2 years with gdb, but to understand gdb i used the first programs i ever wrote...)


if you want a really good advice, try googling a bit about text editors / ides, read about their features and their C programming usability, and try some of them out smile that's the only way you can get in touch with an environement and decide what you like (if i just had to follow a friend's advice, i'll be using anjuta right now, without knowing anything about...)

Offline

#36 2010-07-13 16:49:19

saline
Member
Registered: 2010-02-20
Posts: 86

Re: Learning C, but cant get started without..

drcouzelis wrote:

Without having any previous knowledge of how to program, how to write C code, how to use Vim or Emacs, how to use a debugger, and how to use gdb, do you think it's a good idea to learn them all at once? Did you learn to use them all at once? As alf is "learning C", is a debugger something they "can't get started without"?

gdb is a debugger.  It is a good idea to learn them all at once.  Vim will take your entire life to learn, but vimtutor is a good start (I'm sure emacs is the same way and has its own tutor, but I don;t know it).  Learn one new feature a day and you will notice the awesome quickly enough.  GDB can be put off until you are writing programs that do something, ie are more complicated than "Hello, world."  Once there is some logic to follow you can use gdb to look around in your running programs.  It is better to be able to do that before you need to look inside your broken ones.

Offline

#37 2010-07-14 07:37:43

moljac024
Member
From: Serbia
Registered: 2008-01-29
Posts: 2,676

Re: Learning C, but cant get started without..

I would also recommend geany for the situation. You even get a nice compile and run buttons wink

Last edited by moljac024 (2010-07-14 07:39:35)


The day Microsoft makes a product that doesn't suck, is the day they make a vacuum cleaner.
--------------------------------------------------------------------------------------------------------------
But if they tell you that I've lost my mind, maybe it's not gone just a little hard to find...

Offline

#38 2010-07-14 13:49:26

alf
Member
From: Tromsø, Norway
Registered: 2010-07-05
Posts: 35

Re: Learning C, but cant get started without..

1) What is geany?
2) I think i'll just stick to gedit for now, and enjoy the highlighting smile
And can you guys tell me more about gdb? is it gnome debugger or something? do i just have to write it in terminal as "gcc -gdb" when i wanna compile my code? i guess it comes down to this: how does it work in general?

Offline

#39 2010-07-14 14:13:21

samuele.mattiuzzo
Member
From: Treviso, IT
Registered: 2009-10-12
Posts: 307
Website

Re: Learning C, but cant get started without..

http://www.gnu.org/software/gdb/

this is the best place to get started with gdb smile it tells you the "whats" and the "hows" you need smile

Offline

#40 2010-07-14 14:35:18

drcouzelis
Member
From: Connecticut, USA
Registered: 2009-11-09
Posts: 4,092
Website

Re: Learning C, but cant get started without..

alf wrote:

can you guys tell me more about gdb?

"gdb" is the GNU Debugger. You don't need to use gdb all the time as you write C programs. Mainly, you would use it when there is a bug in your code and you don't understand what's going on.

I only recently started using gdb. I didn't know anything about it. I used this introduction to gdb and learned how to use it in a few minutes. I think that website is quite easy to understand.

Offline

#41 2010-07-14 16:45:13

moljac024
Member
From: Serbia
Registered: 2008-01-29
Posts: 2,676

Re: Learning C, but cant get started without..

alf wrote:

1) What is geany?
2) I think i'll just stick to gedit for now, and enjoy the highlighting smile
And can you guys tell me more about gdb? is it gnome debugger or something? do i just have to write it in terminal as "gcc -gdb" when i wanna compile my code? i guess it comes down to this: how does it work in general?

Geany is a text editor like gedit, but with IDE features. I highly recommend you try it out if you want to stick with gedit.


The day Microsoft makes a product that doesn't suck, is the day they make a vacuum cleaner.
--------------------------------------------------------------------------------------------------------------
But if they tell you that I've lost my mind, maybe it's not gone just a little hard to find...

Offline

#42 2011-12-26 03:26:48

alf
Member
From: Tromsø, Norway
Registered: 2010-07-05
Posts: 35

Re: Learning C, but cant get started without..

I stopped programming after this because I started my studies at the university shortly after this..

And I also didn't really have enough linux experience to start messing around with arch, so I'm on ubuntu now.. learning steadily (Though, getting alot of answers from these forums). I'm planning on moving on to Arch when I'm a bit more experienced with linux.
Anyway, I picked up programming again a few days ago (The third book mentioned, and it's way better than the first one). Made my first programs, like simple arithmetic operations as calculating the area of a circle and the volume of a sphere, etc.

I found that just using gcc and gedit was the simplest way for me, right now..
Vim seems like a very interesting thing, indeed, but I dont really think it's necessary right now.
Anyway, if any of you think so, let me know! What is so special about vim and emacs? and also: do you know any good tutorials on vim?
Thanks for all the help! smile

Last edited by alf (2011-12-26 03:27:41)

Offline

#43 2011-12-26 04:24:37

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,534
Website

Re: Learning C, but cant get started without..

I was programming on and off for quite a while before I ever touched vim.  Well that's not quite right, I touched it, and instantly hated it ... because I never read the manual.

I'd keep hearing how useful it was and think "ok, I'm going to learn to use vim", I'd type "vim somefile.c" and not be able to do a darn thing, open another terminal and "killall vim", and go back to nano (editor) for another six months.

Just a couple months ago I actually READ about how to use vim.  I see why people make the religion jokes about it - I'm a born again vimmer.  I've been amazed by how useful and easy it is (once I read the manual).

Now there is the actual 'man' page, which you should check out of course.  But my favorite learning tool for vim which I still keep bookmarked is the Graphical Vim Tutorial.

Vim is not an editor you can just start up and start working with.  That's what nano was good for for me, and gedit for you.  But if you take just a couple minutes each day to learn something new about your editor, Vim will continue to reward you.

Last edited by Trilby (2011-12-26 04:25:34)


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#44 2011-12-26 04:27:51

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,534
Website

Re: Learning C, but cant get started without..

I suppose it's also relevant that in the intervening times from hating to loving vim I was getting used to using regular expressions on a - well - regular basis.  Having tinkered with awk, sed, or other similar tools made learning vim much easier as they do have a common ancestry.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#45 2011-12-26 05:27:42

/dev/zero
Member
From: Melbourne, Australia
Registered: 2011-10-20
Posts: 1,247

Re: Learning C, but cant get started without..

alf wrote:

What is so special about vim and emacs? and also: do you know any good tutorials on vim?
Thanks for all the help! smile

There is plenty of information already available on this, this is a necro thread, and now it's an off-topic necro thread. So, you know, we're pretty much just asking for some smack down here..

Before a mod decides to lock the thread, I'll get in my two cents on what is so special about vim and emacs.

  1. You can run them over an ssh connection without X11 forwarding.

  2. You can script them to do whatever you want.

  3. If you're working on the command line anyway, you can seamlessly duck in and out of vim/emacs without breaking your workflow. Dialing up gedit and the like requires switching between windows.

  4. GUIfied editors have unnecessary gimicks hogging screen real-estate. I have no need for cute little buttons or long menus. Most functions offered by buttons and menus I never use; the rest can be done more quickly by knowing the correct hot key.

In conclusion, a CLI text editor makes the most of screen real estate, operates stably, securely and transparently over a network, offers easy and unlimited hackability, and integrates well with other CLI software (which all happen to share the same benefits as well).


Edit: for vim tutorials, don't worry about it. There's only a few basic commands you need to be operational: how to get in and out of insert mode, and how to save and exit.

Anything else you want to do, you'll pick up from experience, stfw, etc.

Last edited by /dev/zero (2011-12-26 05:30:56)

Offline

#46 2011-12-26 10:27:35

bernarcher
Forum Fellow
From: Germany
Registered: 2009-02-17
Posts: 2,281

Re: Learning C, but cant get started without..

This thread is necro indeed. I'll close it now. If there are matters of interest left, open a new thread and link back here if needed.


To know or not to know ...
... the questions remain forever.

Offline

Board footer

Powered by FluxBB