Author Topic: Coding and Scripting  (Read 12570 times)

Offline Neal ManBear

  • Administrator
  • Super Villain
  • *****
  • Posts: 15847
  • LXDE! Coffee, Bacon and Cheesecake!
Coding and Scripting
« on: November 22, 2009, 08:15:57 AM »
This thread is in response to this site suggestion.

The basic difference between a coding language and a scripting language is that the coded languages are compiled and the scripted languages are interpreted. Naturally other differences exist, but I'm not trying to be comprehensive or complete here.

C++ is probably the most commonly used coding language in Linux. QT is the C++ toolkit for KDE, and GTK (Gimp Tool Kit-- edit: uses C) is used for Gnome, XFCE and LXDE. These tool kits are provided as a sort of "leg-up" for coding apps for these specific DEs.

There are IDEs (Integrated Development Environments) available for QT and GTK. QT Designer and QT Creator are available in the repos for creating KDE apps, and Glade Interface Designer and Anjuta are available for creating GTK apps. For other IDEs and tools, look in Synaptic > Sections > Development.

Scripting languages come with the interpreters they need. In addition, there may be development tools available, as in IDLE and Eric for Python.

The text editor is a very commonly used tool. It can be used in both coding and scripting. There are several available in the repos.

 
« Last Edit: November 22, 2009, 05:52:17 PM by Neal »

Offline Andy Axnot

  • Hero Member
  • *****
  • Posts: 694
Re: Coding and Scripting
« Reply #1 on: November 22, 2009, 11:19:09 AM »
OK, Neal, thanks for starting this thread.  I was a little unsure I wanted to continue the discussion here, though, and others may feel the same.

Venturing into the Advanced Users area?  Hmmm... I dunno.   :o

Andy
Greetings from beautiful downtown Brooklyn, NY   USA
  Still searching for a replacement for KDE3; E17 is looking good; LXDE, too

"all will be fine soon, once kde3 is back on the main repos" - Titus T6us    :o

Offline Neal ManBear

  • Administrator
  • Super Villain
  • *****
  • Posts: 15847
  • LXDE! Coffee, Bacon and Cheesecake!
Re: Coding and Scripting
« Reply #2 on: November 22, 2009, 12:28:03 PM »
OK, Neal, thanks for starting this thread.  I was a little unsure I wanted to continue the discussion here, though, and others may feel the same.

Venturing into the Advanced Users area?  Hmmm... I dunno.   :o

Andy


Coding and scripting could be considered advanced subjects. Although, IMO, you don't need to be an "advanced Linux user" to do either, perhaps you should be advanced enough to be considered a mid-level new user. In other words, if you're advanced enough to discuss the subject, you're advanced enough. :D


Offline gseaman

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 3799
Re: Coding and Scripting
« Reply #3 on: November 22, 2009, 02:23:40 PM »
I've always wanted to start to learn to program. So, who is going to be the teacher and assign our first project?

Galen

Offline Old-Polack

  • Administrator
  • Super Villain
  • *****
  • Posts: 11591
  • ----IOFLU----
Re: Coding and Scripting
« Reply #4 on: November 22, 2009, 02:34:18 PM »
I've always wanted to start to learn to program. So, who is going to be the teacher and assign our first project?

Galen

Some guy named Neal opened this thread, do he get's the first nomination. ;D ;D ;D
Old-Polack

Of what use be there for joy, if not for the sharing thereof?



Lest we forget...

Offline gseaman

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 3799
Re: Coding and Scripting
« Reply #5 on: November 22, 2009, 02:49:54 PM »
+1

Offline critter

  • Full Member
  • ***
  • Posts: 220
Re: Coding and Scripting
« Reply #6 on: November 22, 2009, 03:01:06 PM »
Neal,
I'm really glad that some topic like this has finally been raised, especially as the hackmy forum seems now to be all but dead in the water.

However, this is a big can of worms that has been opened here and before the script/code gangs re-start the 'battle of the four points' perhaps a rethink of the developers corner should be considered.
The Packagers section is fine as it is and the advanced users section provides a nice playground for those of us who like to play outside of the box and don't mind borking our systems.

I believe that there may be some members who would like to discuss coding and scripting topics in subsections of the advanced users section and surely this can only be beneficial in the long term to the user base and this forum as a whole.

I am comfortable with bash scripts, know nothing about perl, python, ruby etc and never, at the time, managed to shift from K&R C to C++ or other OOP languages, perhaps with some discussion I could now bridge that void (no pun intended) ;)
Motherboard   Gigabyte Z68X-UD3H-B3
Hard Drives      2 x Maxtor STM350032 500GB SATA
Memory      16GB RAM
Processor      Intel core i5 3.30GHz
Video         nVidia GeForce GT430
Sound      HDA Intel PCH
PCLinuxOS          KDE

Offline Neal ManBear

  • Administrator
  • Super Villain
  • *****
  • Posts: 15847
  • LXDE! Coffee, Bacon and Cheesecake!
Re: Coding and Scripting
« Reply #7 on: November 22, 2009, 04:48:16 PM »
"Teacher?" Me? Are you out of your ever-loving minds? I don't know enough to teach, though I do appreciate the honour. If I tried to teach the subject, we'd all be in trouble. :o

Critter,
No battle is necessary. We're just here to pool our knowledge and learn from each other. Every language can be discussed. "My choice is better" type arguments can be 'stomped on' and reasonable discussions carried out with the intelligence that all here are capable of.


Offline gseaman

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 3799
Re: Coding and Scripting
« Reply #8 on: November 22, 2009, 05:04:02 PM »
Neal, I am a teacher and I can help you get started. Picture in your mind what you want us to learn. Then create a task, so that by doing the task we will have to learn what you imagined. Don't tell us how to do it. This is constructivism, everyone will think you are a guru!! ;D ;D

Galen

Offline muungwana

  • Hero Member
  • *****
  • Posts: 6252
Re: Coding and Scripting
« Reply #9 on: November 22, 2009, 05:05:21 PM »
gtk uses straight C ..one of the problem with mixing gnome and kde code is the language barrier ..C++ can use C but the reverse is not always true
.. 3 things are certain in life : death, taxes and software bloat ..
.. tell me something i don't know, something i can use as i struggle to reason with the world around me ..

Offline Neal ManBear

  • Administrator
  • Super Villain
  • *****
  • Posts: 15847
  • LXDE! Coffee, Bacon and Cheesecake!
Re: Coding and Scripting
« Reply #10 on: November 22, 2009, 05:13:58 PM »
gtk uses straight C ..one of the problem with mixing gnome and kde code is the language barrier ..C++ can use C but the reverse is not always true

 ??? Who was talking of mixing them? ??? The very thought of trying to mix QT in with GTK makes me cringe.

 

Offline Neal ManBear

  • Administrator
  • Super Villain
  • *****
  • Posts: 15847
  • LXDE! Coffee, Bacon and Cheesecake!
Re: Coding and Scripting
« Reply #11 on: November 22, 2009, 05:19:05 PM »
Neal, I am a teacher and I can help you get started. Picture in your mind what you want us to learn. Then create a task, so that by doing the task we will have to learn what you imagined. Don't tell us how to do it. This is constructivism, everyone will think you are a guru!! ;D ;D

Galen

Okay. If I accept this task, you are nominated as associate teacher. Maybe we should wait to hear from the others. A better candidate than I am might step up.

Hmm...... create a task? I'll give it some thought. Lots of choices are possible.


Offline muungwana

  • Hero Member
  • *****
  • Posts: 6252
Re: Coding and Scripting
« Reply #12 on: November 22, 2009, 05:30:47 PM »
gtk uses straight C ..one of the problem with mixing gnome and kde code is the language barrier ..C++ can use C but the reverse is not always true

 ??? Who was talking of mixing them? ??? The very thought of trying to mix QT in with GTK makes me cringe.

 

below quote specifically mentions C++ as the most commonly used language and then mentions gtk without mentioning that it uses C, it will be understandable for somebody automatically assume gtk also uses C++ ..was just making this clear it isnt


C++ is probably the most commonly used coding language in Linux. QT is the C++ toolkit for KDE, and GTK (Gimp Tool Kit) is used for Gnome, XFCE and LXDE. These tool kits are provided as a sort of "leg-up" for coding apps for these specific DEs.

.. 3 things are certain in life : death, taxes and software bloat ..
.. tell me something i don't know, something i can use as i struggle to reason with the world around me ..

Offline Neal ManBear

  • Administrator
  • Super Villain
  • *****
  • Posts: 15847
  • LXDE! Coffee, Bacon and Cheesecake!
Re: Coding and Scripting
« Reply #13 on: November 22, 2009, 05:53:24 PM »
 :o You're right. I should have caught that before posting. ::) Thanks. :D


Offline Chomp

  • Full Member
  • ***
  • Posts: 173
Re: Coding and Scripting
« Reply #14 on: November 22, 2009, 06:37:27 PM »
Hello all.  I think this is a wonderful initiative as I have been investigating getting into programming for KDE and plan on starting to teach myself very soon.  I'd like to share what I've learned about starting to learn to code for KDE.

I've decided to start with C++.  I'm using this page as my starting point: http://techbase.kde.org/Contribute#Getting_Started_with_Coding

It seems to be a good jumping off point and the links lead to much knowledge to be learned.  As the article recommends I am going to be starting with Bruce Eckel's Thinking in C++ both because it seems like a good book to get introduced to C++ and because it is (legally) free.  You can find a copy here.

I've also learned that when you compile C++ you need to use the following command: g++ example.cpp

I pulled my hair over this at first because I was under the mistaken impression that you compiled C++ code with gcc example.cpp.  You use gcc to compile C code and g++ to compile C++ code.

Quote
Difference between C and C++

C was the C++ predecessor. As it's name implies, alot of C remains in C++. Although not actually being more powerful than C, C++ allows the programmer to more easily manage and operate with Objects, using an OOP (Object Oriented Programming) concept.

C++ allows the programmer to create classes, which are somewhat similar to C structures. However, to a class can be assigned methods, functions associated to it, of various prototypes, which can access and operate within the class, somewhat like C functions often operate on a supplied handler pointer.

Although it is possible to implement anything  which C++ could implement in C, C++ aids to standarize a way in which objects are created and managed, whereas the C programmer who implements the same system has alot of liberty on how to actually implement the internals, and style among programmers will vary alot on the design choices made.

In C, some will prefer the handler-type, where a main function initializes a handler, and that handler can be supplied to other functions of the library as an object to operate on/through. Others will even want to have that handler link all the related function pointers within it which then must be called using a convention closer to C++.

To finish this discussion, C++ applications are generally slower at runtime, and are much slower to compile than C programs. The low-level infrastructure for C++ binary execution is also larger. For these reasons C is always commonly used even if C++ has alot of popularity, and will probably continue to be used in projects where size and speed are primary concerns, and portable code still required (assembly would be unsuitable then).


Interesting but irrelevant factoid: Linus Torvalds hates C++.