LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 05-26-2015, 01:26 PM   #16
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,659
Blog Entries: 4

Rep: Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941

Don't blame the tools ... and ... don't focus on them. Instead, learn how to go about telling a digital computer how to do things. All programming tools (and for that matter, also "spreadsheets and what-not") are designed for that purpose. Especially in your early learning efforts, simply focus upon that.
 
Old 05-26-2015, 01:34 PM   #17
killertux
Member
 
Registered: May 2015
Location: India
Distribution: Ubuntu 14.04 LTS
Posts: 49

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by rtmistler View Post
I concur that you ought to learn how to write, compile, and debug programs via the command line first.

Reason being is that you'll learn the language properly.

Learn how to use gcc, and gdb (the debugger).

I highly recommend trying emacs as an editor, you can compile from within it and also invoke GDB from within it.
Thanks friend !
I think I am gonna learn the real way.I thought emacs is just an editor.So can it do all these tricks ? I have heard people saying it is much more than just an editor .So What tricks one can really do with emacs. Isn't it same as vi.
Reply soon and thanks!
 
Old 05-26-2015, 01:44 PM   #18
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,841

Rep: Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308
vi and emacs are two different worlds, or two different religions. Both are really powerful and helpful, but both requires some learning. If I can suggest something try a simple editor first like gedit or geany and keep focus on command line tools and learn vi and/or emacs later (yes, someone will say they are also IDEs)
 
Old 05-26-2015, 01:45 PM   #19
killertux
Member
 
Registered: May 2015
Location: India
Distribution: Ubuntu 14.04 LTS
Posts: 49

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by sundialsvcs View Post
Don't blame the tools ... and ... don't focus on them. Instead, learn how to go about telling a digital computer how to do things. All programming tools (and for that matter, also "spreadsheets and what-not") are designed for that purpose. Especially in your early learning efforts, simply focus upon that.
Thanks for reply !
Well friend you too have a point.I think I would learn the terminal way for better understanding.In fact I will go for both and choose which suites me best.So which IDE would you recommend ?
 
Old 05-26-2015, 01:49 PM   #20
rtmistler
Moderator
 
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 9,882
Blog Entries: 13

Rep: Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930
For C and tutorials, look at this sticky in the Programming forum http://www.linuxquestions.org/questi...orials-825748/

For now I'd suggest just editing in emacs to become familiar with it. There's a command entry point where you enter commands like "compile" or "gdb". But then you need to also change the compile command to be "gcc ..." and so forth from whatever default emacs starts with. For the editing session it will remember your change, or you can configure your emacs profile to set it up a certain way. Best to just enter a session, if you choose to compile from within emacs, re-write the compile command when it prompts the first time. Odds are that you'd change that many times as you progress through editing different projects. The only real benefit here is that if you encounter syntax errors, you can type the sequence CTRL-` to "get next error" and the editor will automatically bring you to the bad line of code. I actually don't much compile out of emacs, and instead compile on the command line and then use the "goto-line" command to bring me to the bad line of code. The other thing is running GDB, you should learn that command line first, but when you invoke GDB from within emacs, same thing is that the default command will usually give you the correct form to debug your code. Remember to add the -ggdb switch when you compile. And the benefit here is once in GDB through emacs, you can view your source and see the points where breakpoints are, use the mouse to step in, or step over. Similar to things like Turbo debugger. All the same features are there as in command line GDB, just you don't have to know the syntax for them. Once again, I don't always do this, I usually enter the debugger quickly to examine a core file or to debug one nasty thing where I should've known better. Many times it's just easier to printf() out logs.

As far as core files go, in the command, or terminal, prompt where you run the program, issue "ulimit -c unlimited" to enable core file dumps. And if you have a critical fault in your program which will cause a core file, then you'll get one. You can then analyze that core file using GDB. The defaults are that core files will not be created, hence why it's necessary to issue the ulimit command.
 
1 members found this post helpful.
Old 05-26-2015, 01:51 PM   #21
killertux
Member
 
Registered: May 2015
Location: India
Distribution: Ubuntu 14.04 LTS
Posts: 49

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by pan64 View Post
vi and emacs are two different worlds, or two different religions. Both are really powerful and helpful, but both requires some learning. If I can suggest something try a simple editor first like gedit or geany and keep focus on command line tools and learn vi and/or emacs later (yes, someone will say they are also IDEs)
Thanks !
gedit's cool .And I also Wish to learn vi or emacs like a pro.
 
Old 05-26-2015, 02:01 PM   #22
killertux
Member
 
Registered: May 2015
Location: India
Distribution: Ubuntu 14.04 LTS
Posts: 49

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by rtmistler View Post
For C and tutorials, look at this sticky in the Programming forum http://www.linuxquestions.org/questi...orials-825748/

For now I'd suggest just editing in emacs to become familiar with it. There's a command entry point where you enter commands like "compile" or "gdb". But then you need to also change the compile command to be "gcc ..." and so forth from whatever default emacs starts with. For the editing session it will remember your change, or you can configure your emacs profile to set it up a certain way. Best to just enter a session, if you choose to compile from within emacs, re-write the compile command when it prompts the first time. Odds are that you'd change that many times as you progress through editing different projects. The only real benefit here is that if you encounter syntax errors, you can type the sequence CTRL-` to "get next error" and the editor will automatically bring you to the bad line of code. I actually don't much compile out of emacs, and instead compile on the command line and then use the "goto-line" command to bring me to the bad line of code. The other thing is running GDB, you should learn that command line first, but when you invoke GDB from within emacs, same thing is that the default command will usually give you the correct form to debug your code. Remember to add the -ggdb switch when you compile. And the benefit here is once in GDB through emacs, you can view your source and see the points where breakpoints are, use the mouse to step in, or step over. Similar to things like Turbo debugger. All the same features are there as in command line GDB, just you don't have to know the syntax for them. Once again, I don't always do this, I usually enter the debugger quickly to examine a core file or to debug one nasty thing where I should've known better. Many times it's just easier to printf() out logs.

As far as core files go, in the command, or terminal, prompt where you run the program, issue "ulimit -c unlimited" to enable core file dumps. And if you have a critical fault in your program which will cause a core file, then you'll get one. You can then analyze that core file using GDB. The defaults are that core files will not be created, hence why it's necessary to issue the ulimit command.
Thanks !
The link's cool. Truly I will need some time to get all that stuff you just said cause I have just started learning C.But many thanks for your kind help.
 
Old 05-26-2015, 02:05 PM   #23
killertux
Member
 
Registered: May 2015
Location: India
Distribution: Ubuntu 14.04 LTS
Posts: 49

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by suicidaleggroll View Post
Code:
sudo apt-get install build-essential
will install everything you need to compile C/C++.
Thanks !
How much space and time would the download take and any documentation on using the command line tools would be great.
Again thanks for your help....
 
Old 05-26-2015, 02:08 PM   #24
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,573

Rep: Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142
Depends on your internet connection. Space should be on the order of a couple hundred megs, I believe apt-get will tell you? Not sure, I'm not too familiar with apt-get.

If you want documentation on the command line build tools, you can use Google or the man pages, eg:
Code:
man gcc
will tell you nearly everything you need to know about using gcc.
 
1 members found this post helpful.
Old 05-26-2015, 02:14 PM   #25
killertux
Member
 
Registered: May 2015
Location: India
Distribution: Ubuntu 14.04 LTS
Posts: 49

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by suicidaleggroll View Post
Depends on your internet connection. Space should be on the order of a couple hundred megs, I believe apt-get will tell you? Not sure, I'm not too familiar with apt-get.

If you want documentation on the command line build tools, you can use Google or the man pages, eg:
Code:
man gcc
will tell you nearly everything you need to know about using gcc.
Thank you very much !
I am gonna try your tricks now.
 
Old 05-26-2015, 02:22 PM   #26
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 17,624

Rep: Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651
killertux

fallow your uncles advice
over the summer tinker with C
and learn some of the differences and similarities between C and C++

BASICALLY " !!! HAVE FUN and tinker !!!! "

now as to an IDE

for simple things IT WILL JUST GET IN THE WAY!!!!
for everyday hacking ( even if it is a HUGE project) a IDE will cause more problems

Gedit and Kate and Emacs are all GREAT editors and do code highlighting
that really is all you need
( or less i learned using MS's "notepad.exe" a long time ago )


now if you want to create a rather complex big project then a IDE like "Eclipse" or "QT Creator" will be helpful
 
1 members found this post helpful.
Old 05-26-2015, 02:29 PM   #27
killertux
Member
 
Registered: May 2015
Location: India
Distribution: Ubuntu 14.04 LTS
Posts: 49

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by John VV View Post
killertux

fallow your uncles advice
over the summer tinker with C
and learn some of the differences and similarities between C and C++

BASICALLY " !!! HAVE FUN and tinker !!!! "

now as to an IDE

for simple things IT WILL JUST GET IN THE WAY!!!!
for everyday hacking ( even if it is a HUGE project) a IDE will cause more problems

Gedit and Kate and Emacs are all GREAT editors and do code highlighting
that really is all you need
( or less i learned using MS's "notepad.exe" a long time ago )


now if you want to create a rather complex big project then a IDE like "Eclipse" or "QT Creator" will be helpful
Thanks John !
Great advice.I will dig with it.
 
Old 05-26-2015, 02:35 PM   #28
rtmistler
Moderator
 
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 9,882
Blog Entries: 13

Rep: Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930
I will say that IDEs have their place for UI or similar programming. To a degree.

For instance using the Android Development Kit, or being withing Microsoft Visual Studio, or XRecode for iOS development when you're doing an app or a user interface are helpful.

Meanwhile, as all are saying, it's best to understand the languages first. I started with C and have no problem with C++, C#, Objective-C, Swift, or Java, to name the few which I've ended up using on UI development. It's great to have the IDE for the storyboard part to make the pictures and screen layouts, but it's critical to know the language, or be able to comprehend the language so that you can make your application do something. All of those I've listed are mainly similar, just syntax and available library function calls really separates them from each other, in my opinion. The IDE is helpful to make the connections and establish the framework, then the remainder is writing code to accomplish your tasks.

In the end, I think it will really depend what types of programming you end up doing with C++.
 
1 members found this post helpful.
Old 05-27-2015, 12:13 AM   #29
killertux
Member
 
Registered: May 2015
Location: India
Distribution: Ubuntu 14.04 LTS
Posts: 49

Original Poster
Rep: Reputation: Disabled
Thumbs up Problem solved !

Hello and thanks to all of you !
I think I got the solution.I have decided to use both build essentials and Eclipse IDE.So that I can get maximum exposure to the language and have a better understanding.If I encounter any problem in this regard I will surely gonna ask you people.
Again thanks for being so much kind and supportive.
 
Old 05-27-2015, 07:33 AM   #30
rtmistler
Moderator
 
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 9,882
Blog Entries: 13

Rep: Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930
To add to your choice to use Eclipse. I have used it, and similar to Visual Studio, one thing it does pretty well is completion of functions as well as syntax and scope checking so that you can't "get away" with incorrect practices so readily.

What I'd recommend is that in using it, use it as a typist and stay away from the mouse. That's really my main objection to IDEs is that they have forms or templates where they try to organize things and make it wizard based where it should not always be, my one exception is UI storyboard work. But if you just type your code, it of course tolerates it and also does the syntax and scope checking to assist you.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 08:35 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration