Where to start on beginner programming?

For discussions about programming, programming questions/advice, and projects that don't really have anything to do with Puppy.
Message
Author
Invisible_Hobo737
Posts: 13
Joined: Thu 10 Jun 2010, 03:39

Where to start on beginner programming?

#1 Post by Invisible_Hobo737 »

I've recently taken a shine to programming and languages. I can code HTML pretty much in my sleep but I'm a little behind as far as programming and most computer technical jargon goes. I'm pretty much a blank slate so if someone could tell me what to start out on as basics I'd be very grateful

:)

Joey

User avatar
technosaurus
Posts: 4853
Joined: Mon 19 May 2008, 01:24
Location: Blue Springs, MO
Contact:

#2 Post by technosaurus »

Take a look at gtkdialog. It is very similar to html and used throughout Puppy and in other small distros.

http://www.murga-linux.com/puppy/viewtopic.php?t=38608

after that - genie is pretty easy to learn followed by vala

http://www.murga-linux.com/puppy/viewtopic.php?t=39560
Check out my [url=https://github.com/technosaurus]github repositories[/url]. I may eventually get around to updating my [url=http://bashismal.blogspot.com]blogspot[/url].

User avatar
Lobster
Official Crustacean
Posts: 15522
Joined: Wed 04 May 2005, 06:06
Location: Paradox Realm
Contact:

#3 Post by Lobster »

Using Bash code inside of this sort of template
is no harder than HTML :)
http://www.murga-linux.com/puppy/viewto ... 514#363514

copy the code into an editor
make it runnable *right click in rox' or start a script from there
use 'chat' icon to get instant programming help
(often available)

You can also start a script from rox by right clicking 'New'
and copy the text

./myscript to run from terminal

use javascript from within HTML
and use the Python like Puppy language
Genie
http://puppylinux.org/wikka/ValaGenieintro

Two scripting languages
One for Linux
one for the Cloud
and one compiling for Puppy
that should get you started

Technosaurus is saying much the same
and got there first . . . :)

:)
Puppy Raspup 8.2Final 8)
Puppy Links Page http://www.smokey01.com/bruceb/puppy.html :D

User avatar
ttuuxxx
Posts: 11171
Joined: Sat 05 May 2007, 10:00
Location: Ontario Canada,Sydney Australia
Contact:

#4 Post by ttuuxxx »

I would say learn "C" language, vala takes extra libs, gtkdialog takes extra memory/resources, plus puppy has way too many gtkdialog developers,a "C" developer would be so handy to have plus its way better on the resources.
ttuuxxx
http://audio.online-convert.com/ <-- excellent site
http://samples.mplayerhq.hu/A-codecs/ <-- Codec Test Files
http://html5games.com/ <-- excellent HTML5 games :)

User avatar
jemimah
Posts: 4307
Joined: Wed 26 Aug 2009, 19:56
Location: Tampa, FL
Contact:

#5 Post by jemimah »

I'd really hesitate to recommend gtkdialog to a new programmer. The documentation sucks (except zigert's thread), and half the features are too buggy to use or not implemented. The theory is perfect, but development on Gtkdialog stopped well before it was a finished product.

Doing anything with a GUI in C is brain damaging.

I've been meaning to check out BaCon:http://www.murga-linux.com/puppy/viewtopic.php?t=48901

I think Vala would be a good choice if their documentation has improved. Probably not...

Personally the way I learn, is find a project that has almost, but not quite, the features I want, then fix the code. This gives you exposure to a broad amount of languages and it is less daunting that starting from scratch.

User avatar
zigbert
Posts: 6621
Joined: Wed 29 Mar 2006, 18:13
Location: Valåmoen, Norway
Contact:

#6 Post by zigbert »

It always depends on what the goal is. If you want to make some quick guis that not involve complex rendering (like image/video editing), gtkdialog could be super. But for making larger/faster programs with complexity, gtkdialog is definitive NOT the way. You will find some examples of gtkdialog scripts via my signature. Pmusic is my personal project to investigate how far it is possible to push gtkdialog. - For now. it has obvious weaknesses, but we learn ....... and what we learn, I try to collect in my 'Tips and Tricks' thread.

Because of its limitations, I would not recommend gtkdialog. But on the other hand, programming might get boring before you actually got something running. In this matter, gtkdialog is invincible..... It is really fast building a gui with gtkdialog.


Good luck
Sigmund

gerry
Posts: 986
Joined: Thu 26 Jul 2007, 21:49
Location: England

#7 Post by gerry »

Have a look at

http://99-bottles-of-beer.net/

gerry

2lss
Posts: 225
Joined: Sun 20 Sep 2009, 23:54

#8 Post by 2lss »

I started programming tibasic on my ti-83 graphing then moved to programming pbasic on stamp2 micro controller for a robotic competition. Basic is a simple language and easy to understand but I learned some bad habits along the way that made learning other languages harder.

I also did some programming on some allen bradley plc's (mainly the slick 500) using ladder logic. Its not applicable to anything you would use on a computer but it's a easier to understand and is kind of fun.

My advice, just find a program written in bash (puppy is full of them), open it up in a text editor and learn how it works. Take little snippets out, google what you don't understand, and regurgitate it into something else. Basically reverse engineer the program. I found that digging though scripts helped me learn way more than reading guides or how-to's.

User avatar
vovchik
Posts: 1507
Joined: Tue 24 Oct 2006, 00:02
Location: Ukraine

#9 Post by vovchik »

Dear Jemimah and Co.,

Please have a look at http://www.basic-converter.org/. Much has happened on the Bacon front in the past few months. It is a nice, structured language, and Peter, the author, keeps improving it almost daily. Some of my forays in Bacon are also posted there. The nice things is that if you have gcc and the gtk libs, you can compile rather small gui apps quickly. The only thing missing is a gui RAD environment but I have been thinking of co-opting a glade2fb converter (Bacon also knows glade) or writing my own glade2bac parser/conversion utility. That would make designing complicated guis a cinch. And if that works, once could use most of that code to write a glade2gtkdialog utility as well.

With kind regards,
vovchik

seaside
Posts: 934
Joined: Thu 12 Apr 2007, 00:19

#10 Post by seaside »

vovchik wrote:Dear Jemimah and Co.,

Please have a look at http://www.basic-converter.org/. Much has happened on the Bacon front in the past few months. It is a nice, structured language, and Peter, the author, keeps improving it almost daily. Some of my forays in Bacon are also posted there.
vovchik,

You should be sure to take Invisible_Hobo737 under your wing and teach your elegant coding disciplines :D

I took a look at the BaCon site and apparently it needs Bash 4, and all Puppies currently use Bash 3. Do I understand this correctly?

It seems like it could be interesting.

Regards,
s

User avatar
Pizzasgood
Posts: 6183
Joined: Wed 04 May 2005, 20:28
Location: Knoxville, TN, USA

#11 Post by Pizzasgood »

Doing anything with a GUI in C is brain damaging.
Truth.

Last fall, after working on a C/GTK project for a good while, I took a break and worked on a Python/GTK project I had in mind. I didn't get very far because things got busy and I had to switch gears. But from what I saw of doing GTK in Python, it was like going from eating crackers in the desert while being eaten alive by flies to having grapes and watermelon in the shade next to a nice cool fountain and being attended by <insert-favorite-type-of-attendants-here>.

Not that I have anything against C in general. I prefer C to Python, actually. Probably because I have much more experience with C.



If you're already pretty good with HTML, you might want to consider JavaScript before getting into normal programming. If you have access to a server with PHP, you might want to look at that too. Both languages are pretty nice, and if you're good with HTML you probably have a use for being able to generate dynamic webpages. And this way you could have GUI capability (via HTML) right from the get-go - most of the time when learning to program you start by making mostly commandline programs, and move up to GUI stuff when you have the basics of the language down.

If you'd rather dive into making programs that run normally and can be useful, as others have said Bash/shell scripts are probably the way to go. Tons of examples built right into Puppy, so there are a lot of things you can modify to suit your needs or to use as references. Lots of room for trial and error hands on learning. Do make an off-disk backup of your important stuff though, because experimenting with Bash can do funny (and not so funny) things sometimes. :) For kicks and giggles, type the following into a terminal and press enter (it won't hurt anything):

Code: Select all

\(-
Don't sweat the language decision too much. It doesn't matter a whole lot. The hard part is just getting started, getting a feel for the basic techniques. Once you learn one language, the second is a good bit easier. And after that learning subsequent languages is just something you do matter of fact.

More important than which language to start with is motivation. Without motivation you won't get very far. That's why it's a really good idea to start with something that already exists and just expand it to add a feature you want/need. And then create simple utilities that could make your life easier/more-fun. If you're doing things that are useful to you, not meaningless exercises, it's a lot more interesting and easier to stay motivated.
[size=75]Between depriving a man of one hour from his life and depriving him of his life there exists only a difference of degree. --Muad'Dib[/size]
[img]http://www.browserloadofcoolness.com/sig.png[/img]

User avatar
vovchik
Posts: 1507
Joined: Tue 24 Oct 2006, 00:02
Location: Ukraine

#12 Post by vovchik »

Dear seaside,

Barry K. has included Bacon in Quirky (devx), which is great, and a pet exists here: http://distro.ibiblio.org/pub/linux/dis ... es-quirky/. As for the Bash version, Bacon works perfectly with with:

Code: Select all

root$ [~]-> bash --version
bash --version
GNU bash, version 3.2.29(2)-release (i486-slackware-linux-gnu)
Copyright (C) 2007 Free Software Foundation, Inc.
which is available from the Slackware site as a binary. I think I actually compiled it from source, but can't remember. Old Bacon compiled just fine with old Puppy bash, and the latest version and unreleased betas compile fine with the version mentioned above. In any case, it's worth the change, and there are no deleterious side-effects resulting from the upgrade.

And if Invisible_Hobo737 needs any advice, we're all here to help one another out. Pizzasgood's comments are to the point - motivation is key - and there are many roads that lead to Rome (or Ougadougou, for that matter).

With kind regards,
vovchik

gerry
Posts: 986
Joined: Thu 26 Jul 2007, 21:49
Location: England

#13 Post by gerry »

Vovchik- I can't see 99 bottles in Bacon. How about a demo?

gerry

User avatar
vovchik
Posts: 1507
Joined: Tue 24 Oct 2006, 00:02
Location: Ukraine

#14 Post by vovchik »

Dear Gerry,

I posted last November to the link quoted by Jemimah above, but, since it's not long, here it is again:

Code: Select all

' *****************************************************
' PROGRAM:   beer.bac
' PURPOSE:   http://99-bottles-of-beer.net   
' AUTHOR:      vovchik (Puppy Linux forum)   
' DEPENDS:   gcc, bacon, bash
' PLATFORM:   Puppy Linux (actually, any *nix)
' DATE:      15-11-2009
' COMMENTS:   Not elegant - but works
' *****************************************************

' *********************
' INIT VARS
' *********************
beer_bottles = 100
stock$ = "bottles"
what$ = "of beer"
where$ = "on the wall"
action$ = "Take one down and pass it around, "
' *********************
' END INIT VARS
' *********************

' *********************
' MAIN
' *********************
REPEAT
   beer_bottles = beer_bottles - 1
   SELECT beer_bottles
      CASE 0
         stock$ = "No more bottles"
         action$ = "Go to the store and buy some more, "
         stock_depleted$ = CONCAT$(STR$(beer_bottles + 99)," ","bottles")
      CASE 1
         stock$ = CONCAT$(STR$(beer_bottles)," ","bottle")
         stock_depleted$ = "no more bottles"
      CASE 2
         stock$ = CONCAT$(STR$(beer_bottles)," ","bottle")
         stock_depleted$ = CONCAT$(STR$(beer_bottles-1)," ","bottle")
         ' stock_depleted$ = "no more bottles"
      DEFAULT
         stock$ = CONCAT$(STR$(beer_bottles)," ","bottles")
         stock_depleted$ = CONCAT$(STR$(beer_bottles-1)," ","bottles")
   END SELECT
   PRINT
   PRINT stock$," ", what$," ", where$, ", ", LCASE$(stock$), " ", what$, "."
   PRINT action$, stock_depleted$, " ", what$," ", where$,"."
   PRINT
UNTIL beer_bottles EQ 0
END
' *********************
' END MAIN
' *********************

With kind regards,
vovchik

PS. I also tried posting it to the 99-bottles site back then but never got confirmation from them, and it isn't there in their listings. Weird. I assume they must not like associating with pork :lol:

stu90

#15 Post by stu90 »

I have been experimenting with gtkdialog i don't have any experience with any programming or code untill a few days ago but managed to make this after reading a link on Lobsters website and looking through zigbert gtkdialog thread and installed puppy applications. 8)

Image

User avatar
abushcrafter
Posts: 1418
Joined: Fri 30 Oct 2009, 16:57
Location: England
Contact:

#16 Post by abushcrafter »

Pizzasgood wrote: For kicks and giggles, type the following into a terminal and press enter (it won't hurt anything):

Code: Select all

\(-
:lol:

big_bass
Posts: 1740
Joined: Mon 13 Aug 2007, 12:21

#17 Post by big_bass »

vovchik

for me the fist language I leaned was basic
I used to think in basic if you know what I mean

then I had to learn Assembly language for electronics
even though I can code in it its not fun to say the least
that will scare away anyone from writing code

basic on the other hand was the simple way to get something working very fast

in linux bash is the base language knowing how to use it saves you
time and time again

I like Xdialog it is unforgiving for errors but it will follow the gtk theme
you can even push it hard and have it do dynamic menus
with some will to make it work I find it very easy
I have many things I used it for
even a rewrite of slackwares package tools with it ....that was insane
but works beautifully

if you want to check the code
http://www.murga-linux.com/puppy/viewto ... 2&start=26

I have been wanting to do something in bacon since you posted
so let me upgrade bash a bit (I'll have to test this a lot before adding it to the next iso )

the compile was clean

Code: Select all

# bash --version
GNU bash, version 4.1.0(1)-release (i686-pc-linux-gnu)
Copyright (C) 2009 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
just remember bash on puppy is in /bin
when its compiled and packaged its in /usr/bin
so dont forget to put it in just /bin so there isnt two versions installed


Joe

seaside
Posts: 934
Joined: Thu 12 Apr 2007, 00:19

#18 Post by seaside »

vovchik wrote:Dear seaside,

Barry K. has included Bacon in Quirky (devx), which is great, and a pet exists here: http://distro.ibiblio.org/pub/linux/dis ... es-quirky/. As for the Bash version, Bacon works perfectly with with:
Thanks vovchik,

Downloaded and tried the Quirky Bacon pet on Puppy431. Bacon complained about missing libs and wouldn't work. Barry mentioned that he compiled Quirky Bacon (ooh, that sounds like it might be spoiled :D ) by temporarily installing Bash4.

Since Bash4 was also at that site, I downloaded and installed it. Then compiled the Bacon.bac program using Bash4 under Puppy431 and the resulting Bacon exec seems to work.

I packaged the latest Bacon build 14 with the latest documentation, examples, and HUG files into a pet below, in case any other Puppy users running standard puppy bash3 would like to try it out.

Cheers,
s

gerry
Posts: 986
Joined: Thu 26 Jul 2007, 21:49
Location: England

#19 Post by gerry »

One thing that you do need in order to start programming is a problem to solve- ie a function that you need, and for which nobody else's solution will be adequate. My first BASH script was a version of Pnethood that ran automaticly at boot, and connected my printer which is attached to a windows computer, without any manual intervention from me. Find a problem to solve, then choose the best tool.


I started programming over forty years ago, with original Dartmouth Basic, and Fortran IV. Got into a position where all I needed was a spreadsheet and PertMaster (or similar) so no more after that.

I think interpreted languages are better for beginners- write it, run it, correct it, run it...... seems more direct and intuitive than compiling.

gerry

Invisible_Hobo737
Posts: 13
Joined: Thu 10 Jun 2010, 03:39

#20 Post by Invisible_Hobo737 »

I've been to so many ghost ship forums that its nice to see 17 posts on a simple noobie question...thanks so much guys for all your help...

Much appreciated, all of ya!

:)

wish me luck

Post Reply