PDA

View Full Version : I want to learn!!!



Bodsda
February 1st, 2008, 11:09 AM
Hey guys. I'm a reasonably new linux user but i've always had an interest in programming. I've tried various tutorials and how-to's for Basic, Visual Basic, C, C++, Python, Perl, Bash. But none of these tutorials really interest me. They all start with "Hello World" which is a classic and i have no problem with, but then they quickly move on to useless little programs like Exchange rates programs. This is fine if i want to learn every aspect of programming in a linear fashion, but i dont. I'd like a tutorial that makes little programs that i could use on a daily bases. Does anyone know of a tutorial or a link where i can find a *rewarding* tutorial. preferably in Bash or Python. Thanks guys.

Hugo Galv„o
February 1st, 2008, 11:17 AM
If you want to learn the shell, maybe you should consider taking a look at Linux Command (http://www.linuxcommand.org/), it teaches you basic shell functions and how to write scripts, yes, it is kind of linear, in the sense that it teaches you specific things for a script, but then again, it was taking examples and interpreting specific stuff from there that I could improve my scripts, it's not about learning everything in that linear fashion, it's about taking the bits that you need and adapt them to do what you want

lnostdal
February 1st, 2008, 11:37 AM
I'd like a tutorial that makes little programs that i could use on a daily bases.

like what?


I want to learn!!!

what do you want to learn?

Hugo Galv„o
February 1st, 2008, 11:48 AM
what do you want to learn?

It's there, in the post, Bodsda wants to learn more about programming in Linux, with a preference for Bash and Python

lnostdal
February 1st, 2008, 12:03 PM
It's there, in the post, Bodsda wants to learn more about programming in Linux, with a preference for Bash and Python

lol

edit: just ... please .. don't .. i wasn't asking you, ok - and i really want to know x)

what i mean is .. the obvious answer is to bombard him with links to tutorials .. but is this really what he wants?

pmasiar
February 1st, 2008, 02:10 PM
I guess something like pythonChallenge website will make learning more fun? 33 levels of puzzles, where you need to learn different parts of Python to solve them? With forums where you can talk about levels, and get hints?

See wiki in my sig for free totorials and other training tasks.

Wybiral
February 1st, 2008, 02:17 PM
Does anyone know of a tutorial or a link where i can find a *rewarding* tutorial. preferably in Bash or Python. Thanks guys.

Actually, yes... I know a great site that has tons of tutorials (on Bash AND Python). You can find it here (http://www.google.com). You might have to type a small search query to find them though.

Bodsda
February 1st, 2008, 02:55 PM
Hugo Galv„o: I've been to that site and the tuto's are all pretty good but fairly boring. Boring is something that i dont want my experience of programming to be

lnostdal: Maybe something like, a counter, which sits in the corner of my screen and shows my top 3 most used programs & how many times ive used them (I want to learn!!!) Means i want to learn Python and Bash programming

pmasiar: That sounds like fun, il have a look in a minute

Wybiral: Your link points to google ,.???

Thanks for your responses guys,. keep 'em coming

amingv
February 1st, 2008, 03:08 PM
If by "rewarding" you mean a tutorial that will teach you complex things before basic things; or one that will teach you how to fill your own specific needs, there is no such thing...
After all, an exchange rate program might be useful to someone...

Just learn all you can and then try and make something you can use, I presume you have been jumping through all the languages you mentioned: don't, learn one language decently well and then move over to the next one.

To undestand what Wybiral said, I can just say *hint* *hint*:)

Lster
February 1st, 2008, 03:12 PM
If you can program a bit already, maybe you should develop a small project that you want to develop. If there's no tutorials for that kind of thing then you could try to implement everything yourself.

I think maybe you're finding programming boring because you haven't learnt the basics and can't progress further. The first project I started coding was a calculator. It was boring but it was good to learn from.

pmasiar
February 1st, 2008, 03:16 PM
Actually, yes... I know a great site that has tons of tutorials

Problem with pointing to Google is, that google returns way too many links, and beginner has no clue which tutorial is good and which is for experts. Searching is like everything: garbage in, garbage out. To get good results you need to ask smart question and sort result, which is by definition something newbie cannot do.

This is why I collected **evaluated** links in my wiki.

Bodsda
February 1st, 2008, 03:25 PM
I'm well aware that jumping through different languages is a bad idea, which is why i specified Bash or Python. I recently read a very good ebook on python, but the lack of explanation and more importantly an eg of where it would be used.

amingv: by rewarding i meant a program i can look at and be pleased that i wrote it knowing exactly what i did, not just knowing that i no how to copy and paste from a tuto.

Lster: I had thought about this, but after reading one of the wiki's on this forum, it specifically encourages not to do that, i should join an existing project.

I plan to ask about being a tester for an existing project, but i dont know how to go about this.

oh, amingv: ta for the *hint* *hint* i was so confused,.,.

pmasiar
February 1st, 2008, 04:10 PM
You may want to learn very basics of bash and skip the rest. Most more complicated problems can be solved in Python more simply. Python was designed as a language to replace shell from very beginning - but bash design is about 20 years older, and it shows.

Bodsda
February 1st, 2008, 04:17 PM
ok ty,.Could you define "Very basics" of Bash.

LaRoza
February 1st, 2008, 05:04 PM
You could look in the stickies, they have a link to two wiki's that are good for those wanting to learn.

See my learn to program link.

ghostdog74
February 1st, 2008, 05:21 PM
YPython was designed as a language to replace shell from very beginning
says who?

pmasiar
February 1st, 2008, 06:04 PM
ok ty,.Could you define "Very basics" of Bash.

Depends on what you want to be. Mind you, I am not bash expert, and *** app developer don't need to be. If I was sysadmin, I would use bash more i guess.

Everything what you cannot learn in a day is not "basic". Learn file redirection and pipes, and only when you need it. For me, I have better ROI on my time doing everything (beyond using already-made commands) in Python. IMHO, YMMV.

pmasiar
February 1st, 2008, 06:07 PM
says who?

Says Guido, BDFL. :-) So you know it is true.

Look, he just went back in time and arranged for this interview back in January 13, 2003: The Making of Python (http://www.artima.com/intv/python3.html)
"I decided to try to design a simple scripting language that possessed some of ABC's better properties, but without its problems."

other parts of the interview (http://learnpython.pbwiki.com/AboutPython)

jingo811
February 1st, 2008, 06:44 PM
I'm no programmer. But the hardest part isn't what language to choose, where to find the best reading material, etc. The hardest part is choosing your destination. Without a destination you just end up wandering aimlessly for years like I did.

When you know where you want to go searching for information that's relevant to you will be much smoother. Instead of reading about every aspect there is to know about a language.
Like my teacher said knowing a programming language is like knowing all the chords for you guitar. Putting the chords together to form a melody is a whole different thing. Only trial and error can make you a better music player (programmer). :guitar:

If you don't have a destination to pick look here and help dethrone Microsoft by making more games for Linux.
http://ubuntuforums.org/showthread.php?t=623853
http://apricot.blender.org/

ghostdog74
February 2nd, 2008, 01:47 AM
Says Guido, BDFL. :-) So you know it is true.

He doesn't say its to replace the shell , does he?. It is mentioned that its a bridge between shell and c, and then he says its meant to be second language to those c/C++ programmers. or maybe i missed something?
Also, the interview was done in 2003. If its was done during the time when Python was just born, things he said might be different.

mssever
February 2nd, 2008, 01:53 AM
Before you can do anything, you need to learn variables and flow control, and the basics of your chosen language. Then, you need a *simple* project that interests you. Finally, you need a good reference. PHP is what got me started because the PHP manual is quite thourough. It has to be because PHP is so inconsistant. Yet, I learned a lot of fundamentals while working in a language with a low barrier to entry. Later, I learned superior languages--and superior programming techniques.

A couple of things to remember. Every program takes longer to write than anticipated--especially if you're inexperienced. Start small, or you'll end up overwhelmed and frustrated. My first real project was a Javascript time calculator (http://www.scottseverance.us/html/time_calculator1.htm). At the time, there were no other such calculators on the Internet, and it was a small enough project that I could complete it. Later on, after I learned more, I enhanced it (http://www.scottseverance.us/html/time_calculator.htm). But If I had tried to start out with something like my most recent projects, I'd have failed miserably.

pmasiar
February 2nd, 2008, 03:17 AM
He doesn't say its to replace the shell , does he?. It is mentioned that its a bridge between shell and c, and then he says its meant to be second language to those c/C++ programmers. or maybe i missed something?
Also, the interview was done in 2003. If its was done during the time when Python was just born, things he said might be different.

I am not sure if you read the link. Summary for people with no time:

Guido worked on OS, and it needed shell. So he wrote a shell-like language for it, (which, unlike traditional shell was easy to extend by external libraries) and called it Python.

Did he planned for a replacement Unix shell? No, what gave you idea for such a wrong conclusion? He created IMHO much better language. :-)

I am not sure where your "bridge" quote and "second language for C/C++ programmers" is coming from, so it is hard to comment on that.

ghostdog74
February 2nd, 2008, 05:04 AM
Did he planned for a replacement Unix shell? No, what gave you idea for such a wrong conclusion?

I know he did not plan to do that. It is this phrase I saw


Python was designed as a language to replace shell from very beginning

maybe it should be phrased differently.



I am not sure where your "bridge" quote and "second language for C/C++ programmers" is coming from, so it is hard to comment on that.
the quote is here (http://www.artima.com/intv/pyscale.html) at the very first page...

raul_
February 2nd, 2008, 05:16 AM
The useful stuff comes out of your brains. There are not tutorials that teach you how to do useful stuff. They just teach you how to use the tools, and then it's up to you to build the house.

1337455 10534
February 2nd, 2008, 05:26 AM
If you want a useful app in these days, it has to have a GUI. I hate that fact. Nevertheless, unless if it's only for you, you need some sort of interface. For python, start with wxPython. It's difficult to grasp immediately. It took me ages because being the complete idiot I am, I only looked at the documentation when I ran into a major problem (but I had made so many minor ones to that point my design was doomed, and I had to redisign :D)

wxGlade (in my humble opinion) is nicer to work with than pycard or boaconstructor. Both are respectable projects, its just that wxGlade is less, and less is more for me.

Why on earth start with a GUI? And why wxWidgets instead of hugging EasyGUI?
I dunno. You said you wanna learn.

What you'll learn;
1. Python class and function structure
2. Possibly file I/O if you store/write data
3. Advanced GUI design, handlers, and threads
4. useful modules (cant use python without os, sys, threading etc.)
5. the neccessity of good documentation
6. Control structures (well, that was a 'duhhh' thing)
7. Data types (if you do some string work)

Enjoy;
http://wxglade.sourceforge.net/

mssever
February 2nd, 2008, 05:38 AM
If you want a useful app in these days, it has to have a GUI.Not true.
Nevertheless, unless if it's only for you, you need some sort of interface.Yes, you need an interface. If there's no interface, no one can use the program for anything. You seem to forget that there are other kinds of interface besides GUI. There are a great many useful CLI (command line interface) programs out there. I use them every day. Sometimes, a CLI program can be more useful than a GUI. For example, suppose I want to install the package foo. I can open up Synaptic, wait for it to launch, search for foo, check it, hit install, then close Synaptic. Or, I can type
sudo aptitude install foo I'm not saying that GUIs aren't useful. But anyone who doesn't find CLI apps useful is missing a lot.

EDIT: Also, there are a great many useful web applications. Web programming isn't GUI work (at the backend, at least). It's really a special case of CLI programming.

Another point: It's foolish to worry about a GUI when you're first starting. It's too much unnecessary complexity. Either write a CLI or web-based program. Furthermore, the best GUI programs are usually designed to work properly before the GUI is written, because writing CLI apps allows you to focus your energy on making the program correct, rather that worrying about why a text box won't align. Design for CLI first. If you want a GUI, adding one later will be simple.

agim
February 2nd, 2008, 05:39 AM
Bodsda, if you are still keeping up on this post, I would suggest this book:

http://www.amazon.com/Python-Programming-Introduction-Computer-Science/dp/1887902996/ref=pd_bbs_sr_7?ie=UTF8&s=books&qid=1201926442&sr=8-7

Its called Python Programming: An Introduction to Computer Science.

When I started programming, I ran into many of the same problems you are now. Too many tutorials, which seem like clones of one another. None of them seemed to explain the fundamental questions of how do you go about building a program and why do you do it that way.

This book does all of those things, it has helped make me a comfortable novice/intermediate programmer, rather than someone who knows language syntax.

As far as python goes (you may have read all of this before), it is a great starter language. It was engineered to be simple and powerful, it will give you a good handle on how and why a program is written the way it is.

This is something that can be transferred to learning other languages as well, if you decide to learn other languages. It has great gui support as well as a large number of libraries, which will allow you to make powerful programs without needing to reinvent the wheel to get there.

If this sounds like where you want to go, I would strongly suggest that book.

Good luck with your programming!

Bodsda
February 2nd, 2008, 10:54 AM
Hey guys, thanks for all the posts.

So i've decided to begin with programming for myself, i'm gonna make little scripts to speed up things that i do on a regular basis. eg i make GDM login screens by copying the Human theme and changing 2 pictures inside it, which i suppose i know how to do from the shell, so it could be interesting. Also im just about to purchase the Python Programming: An Introduction to Computer Science. from amazon

just 1 last question,.,.How often do you guys purchase a book on programming, and would you buy a book if you were thinking of learning a new language?

LaRoza
February 2nd, 2008, 11:28 AM
just 1 last question,.,.How often do you guys purchase a book on programming, and would you buy a book if you were thinking of learning a new language?

Rarely. Use the free, up to date, and easier to obtain online resources. I know only buy reference books and the more abstract computer programming concepts.

I wouldn't buy a book if I were going to learn a new language, unless I find a good deal on amazon, and then, rarely.

My wiki should keep you busy for a while.

There is a thread on books that are good to buy, it is in the sticky.

Bodsda
February 2nd, 2008, 02:59 PM
thats the wiki ive been reading,.,. theres alot of stuff there ;~~) anyway thanks for your help you guys,.,. looks like im gonna be spending some time on #ubuntu-programming irc ,.,. cheers :popcorn::KS:popcorn:

days_of_ruin
February 2nd, 2008, 05:00 PM
greenteapress.com.Great books and they are free:guitar:

pmasiar
February 3rd, 2008, 05:36 AM
He doesn't say its to replace the shell , does he?. It is mentioned that its a bridge between shell and c, and then he says its meant to be second language to those c/C++ programmers. or maybe i missed something?


Another try:

1) Python was designed using experience from language ABC, which was language for expert scientists who had no patience or reason to learn C, and for whom BASIC (old one, from 80ies) was inadequate.

2) Python was designed as "a simple scripting language that possessed some of ABC's better properties, but without its problems" for OS Amoeba.

If from this implies that Python "bridges shell and C", so be it. Why this is a problem again?

When Python started, it was obviously destined to be second (or more) language for any user. In this sense, it was second language for C users - has C-like semantics. Now, it can be first language for beginners - no need to go through hell of C to reach Python's paradise :-) So if you imply that Guido intended people first to learn C and only after that Python, you have it wrong.

Python was not designed in 89 to replace bash. But as it's usability and spread grows, for many people (including me) it replaces bash in all except most trivial usage. I do not see sense learning more advanced bash features, if learning the same feature in Python is simpler, and can be used in other tasks, so I most likely already know it in Python.

I hate wasting time on hairsplitting like this, but from your comments was not obvious for me where you have the problem with Python or what I said about Python - hope that after this, you can point it out with better clarity.

ghostdog74
February 3rd, 2008, 06:13 AM
But as it's usability and spread grows, for many people (including me) it replaces bash in all except most trivial usage.
I think you have answered my queries. this is where i am coming from


Python was designed as a language to replace shell from very beginning

and this one


Python was not designed in 89 to replace bash.

amingv
February 3rd, 2008, 07:40 AM
Chill guys, you take these matters too seriously.

Can we just rephrase and rather say that Python was created as a substitute for shell scripting; not the shell itself?

Anyway this thread has got off-topic, and (I think) the OP has got an answer, so i think it's no use bashing over the misinformation/misinterpretation of a post...

Bodsda
February 4th, 2008, 01:51 PM
Ok guys, heres my first attempt at writing bash scripts. Let me no what you think,

There for making a GDM login screen

I also have a few questions,

Would it be possible to have a little box come up at the end that just says "Finished" and a button "Ok" for the user to click, then when its clicked the script ends and the terminal closes?

Anyway, feedback on the scripts would be very helpfull.

mssever
February 4th, 2008, 08:05 PM
Anyway, feedback on the scripts would be very helpfull.

Here's my feedback. Note that this is intended to be helpful, not critical. :)



username=$(whoami)

gksudo mkdir /home/$username/next_gdm

sudo chmod 777 /home/$username/next_gdm
The current username is available in $USER and the home directory is avialable in $HOME. It's better to use those variables--especialy since it's possible, though unlikely, that the user's homedir is NOT /home/username.
gksudo is for GUI programs; sudo is for CLI programs.
It's not generally a good idea to chmod 777. Better to choose the actual permissions you need, and set those.
The above comments apply to all files in your tarball.
Instead of using this script, you could pass a dir to GDM_maker on the CLI. The user can create their own dir. No need for a script which does only that. (I do realize, though, that there is educational value sometimes in writing code which is technically unnessary.)

cd /home/$username/next_gdm

sudo mv ./* background.png && sudo cp ./* screenshot.png

sudo cp ./background.png /usr/share/gdm/themes/Human/ && sudo cp ./screenshot.png /usr/share/gdm/themes/Human/

#Now we empty the (next_gdm) file to use at another time

sudo rm /home/$username/next_gdm/background.png && sudo rm /home/$username/next_gdm/screenshot.png
You could simplify this code to:
sudo mv "$HOME"/next_gdm/*.png /usr/share/gdm/themes/HumanBut there should probably be some error checking involved. Your code
sudo mv ./* background.png && sudo cp ./* screenshot.png will cause errors if there's ever more than one file in next_gdm, because you can't move multiple files to one file. Multiple files must go to a directory. My simplified code will cause errors if they source files aren't named properly. And you can drop the ./ since it's unnecessary. This should give you an opportunity to learn some flow control commands such as if.

Also, be sure to surround all your variable calls with double quotes. Otherwise, if they happen to contain spaces, you'll get an unpleasant surprise.

There's no need to end a script with exit 0 (or simply exit), since that's the default behavior. The exit command is useful if you want to pecify a different exit status to signal some error condition or if you need to terminate the script early for some reason.

For GDM_revert, see the concepts from my above comments.


Would it be possible to have a little box come up at the end that just says "Finished" and a button "Ok" for the user to click, then when its clicked the script ends and the terminal closes?It's possible (zenity would be the command to use), but it isn't a good idea. Part of the UNIX philosophy is that when a program doesn't have anything useful to say, it shouldn't say anything. The fact that you get your command prompt back tells you that the program finished. Now, if some error occurred, then you shoul obey the maxim, "If you can't recover gracefully, fail loudly."

If you ever need to communicate with the user from a CLI (command-line interface) program, the proper way to do it is by printing to stdout or stderr (e.g., using echo). Thing is, with a CLI program, it's possible that the user isn't even running X when they run your script. And even if they are, they'll likely be annoyed if they have to reach for the mouse in a text-based environment. GUI dialog boxes should be used with GUI programs.

Keep learning, and enjoying, programming!

Bodsda
February 4th, 2008, 08:29 PM
Wow, cheers for the brilliant informative response. il try and edit my scripts, after i re-read your post 4/5 times and understand it, but for a first try is it any good?

mssever
February 5th, 2008, 05:17 AM
for a first try is it any good?That depends on how much you learned. :) Honestly, I think that there are much better methods of accomplishing your task, but you have to start somewhere. I wrote that type of script when I first started out. Now that I have more experience, I do things differently. The most important thing for you is how much you learned. And I can't answer that for you. :)

I hinted in my earlier post about using if tests. I'd like to refine that advice by making a suggestion for your second project: a guess-the-number game. The game should work like this:
First, it should generate a random number between 0 and some upper bound (such as 10). Since bash doesn't include such a command by default, you can save this to rand.rb and call it as ruby rand.rb 10:
#!/usr/bin/env ruby
print rand(ARGV[0])Optional enhancement: read the upper bound from the command line.
Next, it should prompt the user to guess the number.
If the guess is correct, you win!
If it's incorrect, tell the user whether the guess is too high or too low, then prompt again.
Repeat steps 2-4 until the number is guessed.
Optional enhancement: keep track of how many tries it takes to guess the number.The purpose of this project is to teach you some basic flow control, which is the foundation of programming. You should be using both the if and while commands in this project (and probably the true and break commands, as well). You'll also need variables. man bash will be helpful, as will help <command>, in addition to regular man pages. In particular, man test will be helpful.

I'm making this project suggestion because you'll need to know how to use the techniques required by this game in order to advance. Of course, you can use another language besides bash, but for now, it's probably best to stick with one language. I hope I've given you enough information that you can get started. Of course, I'm deliberately not telling you everything. man, help and Google are your friends.

Bodsda
February 5th, 2008, 09:13 AM
I actually already wrote that game in BASIC, but that was about a year ago, and i dont use basic anymore,. il have a read of man pages and get started on that now,.,. cheers m8

jeffus_il
February 5th, 2008, 09:21 AM
Hey guys. I'm a reasonably new linux user but i've always had an interest in programming. I've tried various tutorials and how-to's for Basic, Visual Basic, C, C++, Python, Perl, Bash. But none of these tutorials really interest me. They all start with "Hello World" which is a classic and i have no problem with, but then they quickly move on to useless little programs like Exchange rates programs. This is fine if i want to learn every aspect of programming in a linear fashion, but i dont. I'd like a tutorial that makes little programs that i could use on a daily bases. Does anyone know of a tutorial or a link where i can find a *rewarding* tutorial. preferably in Bash or Python. Thanks guys.

All the technical information about tutorials and languages is not really important. The most important thing is to get rolling. Set yourself a goal first. Define a small program that you want to write. Then pick a language and find documentation relevant to what you want to do. Then Start writing. There is plenty available on the internet. After you start working you will find sources that suit you. You can also start by finding source code of a program similar to yours, and make changes. That way you get feedback more quickly, and can learn from others.

samb0057
February 5th, 2008, 10:48 PM
PHP is a very good first language.
Easy to learn and very easy to set up a usable application in very little time.

LaRoza
February 5th, 2008, 10:50 PM
PHP is a very good first language.
Easy to learn and very easy to set up a usable application in very little time.

This thread is just rehashing a subject that is done at least bi weekly.

jingo811
February 6th, 2008, 12:31 AM
Maybe you should make a Wiki-FAQ-Self-Tester-dynamic-webpage so that ppl can clicky on some some generic questions then see a list of suggested beginners languages to choose from. With common comments pros/cons for each suggested language and listing some recommended first-timers comparisons webpages.

Basing the results on Country, number of users, future, past, etc. etc.
That should save Ubuntuforums.org some 100 MB /month in bandwidth since nobody ever reads long FAQs these days :)

pmasiar
February 6th, 2008, 01:42 AM
This is interesting idea: something like "choose your own language" adventure game? :-)

LaRoza
February 6th, 2008, 01:43 AM
Sounds interesting, I may be able to whip something up. Does anyone have any suggestions?

Bodsda
February 6th, 2008, 10:19 AM
Yer, concentrate on it being more a game, have them battle evil pythons and have them swim across the C, and when there pHP gets below ten the screen should flash, as there climbing threw the mountains they need to be careful of the molten liquid Java. Then at the end you can tell them how good they did by telling them what language they are,. the better they did, the more advance language they are,.,. what do ya think?

pmasiar
February 6th, 2008, 02:36 PM
Yer, concentrate on it being more a game, have them battle evil pythons and have them swim across the C, and when there pHP gets below ten the screen should flash, as there climbing threw the mountains they need to be careful of the molten liquid Java. Then at the end you can tell them how good they did by telling them what language they are,. the better they did, the more advance language they are,.,. what do ya think?

BS. No need for a game.

On second thought, I realized that "pick your language" game makes no sense: for 95% of people asking what first language they should learn, answer is simple: Python. And because they are noobs and have no clue when we talking about syntax, flexible data structures like list comprehension, static vs dynamic typing and stuff, they have no way to make informed decision. they have to know a programming language to understand what are we talking about. You cannot explain to a blind man what elephant looks like. You cannot teach child to speak by talking about grammar: by trying to speak, and failing sometimes, child will learn what speech is.

Two months later, after learning Python, they can move to any other language - and they will have richer understanding of that other language because they will be able to compare, see what are syntax differences, and what is substantial. And they will have simple high-level mental model of what is happening inside computer.

jingo811
February 6th, 2008, 02:41 PM
Well I thought you might keep things simple stupid at phase 1. Just working on the info content and summarizing every comment pros and cons ever made is gonna take half a lifetime if done by only one guy.
Then when that structure is satisfied then you could talk about making it into a game it just to early to make a game without proper structure and content to build upon. Me thinks.

MONODA
February 6th, 2008, 02:48 PM
If you want to learn the shell, maybe you should consider taking a look at Linux Command, it teaches you basic shell functions and how to write scripts, yes, it is kind of linear, in the sense that it teaches you specific things for a script, but then again, it was taking examples and interpreting specific stuff from there that I could improve my scripts, it's not about learning everything in that linear fashion, it's about taking the bits that you need and adapt them to do what you want
+1 for linuxcommand.org I used it to learn bash and was able to write some scipts of my own.

ghostdog74
February 6th, 2008, 03:09 PM
for 95% of people asking what first language they should learn, answer is simple: Python.

I prefer not to call it an answer, a "suggestion" might be more appropriate.

ComputerHermit
February 6th, 2008, 03:14 PM
I started with html

pmasiar
February 6th, 2008, 03:46 PM
I started with html

... and you are part of the group who misleadingly believe that HTML is in any way related to programming languages

pmasiar
February 6th, 2008, 03:51 PM
I prefer not to call it an answer, a "suggestion" might be more appropriate.

OK, call it "suggestion".

But IMNSHO Python is the simplest and fastest way to get clued what is programming about - so they can pick different language more fitting their needs, if Python does not fit (it will fit in say 60% anyway)

Now more interesting will be to think about the exceptions: where we think Python is NOT the best first language? What will be the exceptional case NOT recommend Python as first?

jingo811
February 7th, 2008, 08:30 PM
People don't like to be told what to do. They like to believe they made a smart decision. Now if you lead them to where you want them to go without giving them a single hint of an direct order then everybody wins.

I still think a list of suggested Newbie languages should be listed and commented about with a FAQ.
And a different section of list saying which languages is considered Medium or Hard languages. That way the reader can make the sound decision themselves without having a religious programmers war every week.

Lster
February 7th, 2008, 09:10 PM
... and you are part of the group who misleadingly believe that HTML is in any way related to programming languages

Well I learned programming first through HTML and JavaScript. Forgive me if I'm wrong but that sounds a little blunt - why categorize people? ;)

aks44
February 7th, 2008, 09:17 PM
Well I learned programming first through HTML and JavaScript. ;)

HTML or CSS are definitely not programming (or perhaps writing an OpenOffice text document is programming too? Or LaTex? All are just page description "languages").

But I agree that JavaScript is a whole other matter, it is indeed a real programming language (although a bit limited IMHO compared to Python, Java, C++ etc). ;)

Lster
February 7th, 2008, 09:24 PM
HTML or CSS are definitely not programming (or perhaps writing an OpenOffice text document is programming too? Or LaTex? All are just page description "languages").

But I agree that JavaScript is a whole other matter, it is indeed a real programming language (although a bit limited IMHO compared to Python, Java, C++ etc).

Agreed. ComputerHermit could well of been generalizing, though and I just wanted to point out the post was a little too categorical.

pmasiar
February 7th, 2008, 10:02 PM
Agreed. ComputerHermit could well of been generalizing, though and I just wanted to point out the post was a little too categorical.

Little too? OK, here is summary as I see it:

We had consensus that Python is for 99% people best first language to learn. Mind you, it was result of long exhausting argumenation, was not easy - you may read it all over the forum.

Then, someone comes in, not bothering to read previous discussion (where we discussed exactly the point he is truing to make: that even if someone started with X, it might be not the best language **now** to start with) and chimes in:


I started with
html

well, I told poster exactly what I think about such "programmers" and how it is related to topic on hand.


... and you are part of the group who misleadingly believe that HTML is in any way related to programming languages

I did not used any profane language, mind you, just pointed facts as they are.

and I am not the only one who thinks so:


HTML or CSS are definitely not programming ... All are just page description "languages").



I am maybe little more opinionated and blunt, which sometimes gets me into troubles - but it comes with membership to the club :-)

But if someone asks me direct question, I prefer not to go on wishy-washy "did I hurt your feelings" BS. Give me the facts, life is too short.

How long we can beat the dead horse?

OK, next time I will answer like this:


"Sweetie, you may consider learning what programming language is first - no, you don't have to understand what "Turing complete" is, it might hurt your impresionable mind. Just try to learn syntax of 3-4 languages, solve couple simple problems with them, maybe you may reconsider your opinion, dear?"

We will see what response will I get on **that** :-)

mssever
February 8th, 2008, 03:20 AM
Well I learned programming first through HTML and JavaScript.


HTML or CSS are definitely not programming
HTML and CSS aren't programming, but they're what taught me the first concepts of programming: that you can write a plain text file that the computer will interpret, and that you can manipulate that file to achieve the desired result. For me, that was a real revelation when I first learned HTML.

I grew up around Macs, and the Macs of the day didn't come with anything like programming. There was no command line, no plain text config files, nothing. I remember one time seeing an ad for a WYSIWYG HTML editor (though I wouldn't have called it at that time), and I thought, "Too bad it costs so much, because I'd like to be able to make a website."

(Incedentally, I was in college the first time I encountered a command line other than seeing a DOS prompt on other people's computers. My dad gave me a crash course on UNIX commands, and I was amazed at how great the CLI was. I could never enjoy a Mac again. Of course, Apple eventually saw the light. :) )

aks44
February 8th, 2008, 08:12 PM
HTML and CSS aren't programming, but they're what taught me the first concepts of programming: that you can write a plain text file that the computer will interpret, and that you can manipulate that file to achieve the desired result. For me, that was a real revelation when I first learned HTML.

I have to admit I never saw it that way... I started with BASIC quite young then quickly switched to assembly, way before I ever heard of that "internet" thing...

So when I first had access to the net (and heard of HTML) I already had a solid programming background (I already was fiddling with C++ at that time). HTML then looked like a very simplified RTF or PostScript language to me (hence my previous parallel with OpenOffice ;)), my opinion was at that time that it had nothing to do with programming, even remotely.

Thanks for sharing that, because this is kind of an enlightenment for me. :D

pmasiar
February 8th, 2008, 08:21 PM
HTML and CSS aren't programming, but they're what taught me the first concepts of programming: that you can write a plain text file that the computer will interpret, and that you can manipulate that file to achieve the desired result. For me, that was a real revelation when I first learned HTML.


I thanked for the insight, it IS important, but:

I agree that HTML and CSS even more can teach that computers are stupid and cannot see and fix obvious typo, special characters in special places are there for a reason, and small changes may have big consequences.

But neither HTML or CSS cannot teach even most basic programming concepts, like variable, loop, function, parameter, which are at least by magnitude more complex concepts. That's why I do not consider HTML good enough training for becoming a programmer. :-)

popch
February 8th, 2008, 08:30 PM
(...) HTML then looked like a very simplified RTF or PostScript language to me

PostScript is a programming language. It is said to be a bit like Forth.

aks44
February 8th, 2008, 08:49 PM
PostScript is a programming language. It is said to be a bit like Forth.

LOL you got me on this one... I know that, but... :oops:
You just proved (again) that prejudices are a real PITA. ;)

mssever
February 9th, 2008, 01:02 AM
One other thing: Many formats call themselves "languages," such as HTML, XML, SGML, YAML, etc. I think that such a term is appropriate, because really, they're domain-specific languages. DSLs don't necessarily have to be turing-complete, and these languages require an interpreter of sorts to turn them into something useful. Of course, you don't teach programming by teaching a rather limited DSL.

pmasiar
February 9th, 2008, 04:42 AM
Many formats call themselves "languages," such as HTML, XML, SGML, YAML, etc. I think that such a term is appropriate, because really, they're domain-specific languages.

Yes. Please notice they all have M - for markup. They are all markup languages.

Domains-specific languages may not claim be turing-complete. Example: SQL is kinda programming language (I know, not exactly: it is a query/data access language).

This is the difference between DSP and general programming language. So if someone wants to learn (programming) language like OP, specialized DSP like HTML may be training ground for paying attention to exact syntax, but hardly any relation to programming at all.

But I think we mostly agree and understand each other.

1337455 10534
February 9th, 2008, 10:29 PM
Not true. You seem to forget that there are other kinds of interface besides GUI. There are a great many useful CLI (command line interface) programs out there. I use them every day. Sometimes, a CLI program can be more useful than a GUI.
Another point: It's foolish to worry about a GUI when you're first starting. It's too much unnecessary complexity. Either write a CLI or web-based program. Furthermore, the best GUI programs are usually designed to work properly before the GUI is written, because writing CLI apps allows you to focus your energy on making the program correct, rather that worrying about why a text box won't align. Design for CLI first. If you want a GUI, adding one later will be simple.

Good point. I was mistaken, I was thinking on a different plane. apt is a good example of an essential CLI, but I guess what I meant is that a healthy amount of other actions benefit from GUIs (everything under the System-->Preferences menu for example).

1337455 10534
February 9th, 2008, 10:44 PM
It has been insinuated several times in this thread that Python is a language solely for beginners (aka "noobs"). Not so!
I took a brief dive into C++ and reproduced a program I wrote in Python (http://ubuntuforums.org/showthread.php?t=673323) and I would say I am a complete noob. All it takes on the writer's side is some determination and spare time. Small CLI programs are easy to write in whatever language you pick out of the pile.

pmasiar
February 9th, 2008, 11:08 PM
It has been insinuated several times in this thread that Python is a language solely for beginners (aka "noobs").

Python is excellent language to start programming, but unlike other "beginner-friendly" languages (Logo, Squeak, etc) it scales up well to real-world tasks.

For many people Python is the only language they ever need: ie biologist who needs to compare results from different tests (using different gene IDs), or need to prepare results for processing by BLAST. Of course BLAST written in C will do the heavy lifting, but for biologist, BLAST is black box, and Python is all she needs to get her data ready.

1337455 10534
February 10th, 2008, 07:18 AM
C is the ultimate in low-level, but I challenge a professional C developer to create a working GUI with usable features in under 8 minutes :)! I won't bet on it, but I'm almost positive that most tasks users may code for are causal CLI scripts. C and Python serve (in my opinion) very different uses.
One isn't better than the other, and one isn't more feature-less-ish. Sure, Python makes more sense to newbies, but any other scripting language they may use would be the same in difficulty (save for Perl)...