LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 01-04-2014, 09:01 AM   #1
clayton1
LQ Newbie
 
Registered: Jan 2014
Posts: 1

Rep: Reputation: Disabled
code blocks header files


Hello
I'm using code blocks 12.11

As a newbe to programming I have a couple of Questions.

Is C++ a good choice to learn to program for linux apps?
(this is where i'm spending most of my time)

Or is python a better choice to learn to program for linux apps?

They both appear to me to have alot of similarities.

In either one .... how do you know which standard header file to include in your
program which defines the keywords you use? eg. getchar() or setw() or clrscr().
When I copy code off the net, I have alot of problems because the header files are not right.
For a inexperienced newbe going through each one trying to figure it out
can get fustrating really fast. Is there a chart somewhere that matches

the keywords and commands to a standard header file for reference?

all replies will be greatly appreciated. Thank You!
 
Old 01-23-2014, 08:57 PM   #2
neonsignal
Senior Member
 
Registered: Jan 2005
Location: Melbourne, Australia
Distribution: Debian Stretch (Fluxbox WM)
Posts: 1,389
Blog Entries: 52

Rep: Reputation: 355Reputation: 355Reputation: 355Reputation: 355
Quote:
Originally Posted by clayton1 View Post
Is C++ a good choice to learn to program for linux apps?
Or is python a better choice to learn to program for linux apps?
This depends on your application.

Python is easier to learn, and makes a great introductory language. It has a good sized community (which translates to lots of reusable code and libraries), and is nicely general purpose.

C++ has found its place in the development of large applications, and has been designed to enable a number of different programming paradigms. Because of the way it evolved from C, some of the syntax can sometimes be confusing. It is a very stable language. To learn it well takes quite a while, but of course you don't need to know the whole language in order to use it.

I should mention that many Linux applications are developed in C rather than C++; however, as a learner, it is good to be exposed to the object oriented paradigm early, even if you don't end up using it. There are a small set of applications where efficiency or direct hardware access is important. C and C++ are good in these cases, being 'closer to the metal'.

The other important alternative to be aware of is the functional programming paradigm, in languages such as Haskell. These are less commonly used, but they could have a bright future in world that is moving towards increased parallelism (ie, massive numbers of CPU/GPU cores).

Learning a second computer language is usually easier than the first one, so the first choice is not as important as who you learn from.

Quote:
how do you know which standard header file to include in your
program which defines the keywords you use? eg. getchar() or setw() or clrscr().
One can of course simply grep for them in the header files, but it is best to find a good source of reference documentation. For C++, this site is useful, since you can look up any function to figure out its header file, and there is usually a complete and compilable example of the usage. Likewise for python documentation. If you intend to do a serious amount of programming, there are reference books (eg Stroustrup's "The C++ Programming Language") that give good overviews of the language.
 
Old 01-23-2014, 11:00 PM   #3
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,714

Rep: Reputation: 1280Reputation: 1280Reputation: 1280Reputation: 1280Reputation: 1280Reputation: 1280Reputation: 1280Reputation: 1280Reputation: 1280
And things like getchar() or setw() or clrscr() are not keywords. They are functions (or macros).

Keywords would be things like "if", "while" "include" "extern"... usually referred to as "reserved words" or "reserved tokens".
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to add a static avr library and just include header files in code? saavedra29 Linux - Software 2 04-29-2013 12:17 PM
[SOLVED] Multiple source files and headers in a Code::Blocks project. How? searching_for_answers Programming 2 09-11-2011 01:53 PM
Help in header files needed to run a C code using gcc/g++. BlueSkull Programming 3 12-10-2009 03:49 AM
are header files the souce code? shanenin Linux - Software 3 02-16-2005 11:24 AM
c header files in linux in place of header files in windows? harun_acs Programming 1 03-17-2004 03:24 AM

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

All times are GMT -5. The time now is 09:43 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration