DaemonForums  

Go Back   DaemonForums > Miscellaneous > Programming

Programming C, bash, Python, Perl, PHP, Java, you name it.

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 18th August 2008
Crypt Crypt is offline
Port Guard
 
Join Date: Aug 2008
Location: Whitby, Ontario
Posts: 36
Default Learning Programming

I have been looking into learning a programming language for sometime and finally decided it's time to get off my ass and learn one. I have read that python, perl, ruby are all easy to learn. What would be a good start for an absolute beginner?
Reply With Quote
  #2   (View Single Post)  
Old 18th August 2008
anomie's Avatar
anomie anomie is offline
Local
 
Join Date: Apr 2008
Location: Texas
Posts: 445
Default

I'm going to suggest python: http://hetland.org/writing/instant-python.html
__________________
Kill your t.v.
Reply With Quote
  #3   (View Single Post)  
Old 18th August 2008
ocicat ocicat is offline
Administrator
 
Join Date: Apr 2008
Posts: 3,318
Default

Quote:
Originally Posted by Crypt View Post
What would be a good start for an absolute beginner?
Find a good tutorial, & start wading through it. Searching for the language's name & the word "tutorial" in your search engine of choice is a start.

Yet in my opinion, online tutorials are still generally spotty, however there are some exceptions:You have not mentioned why you are wanting to learn, as the level of motivation is important in getting past the thorny issues which occur in all languages. Nevertheless, for a general purpose language, I would suggest learning Python first because its syntax is less esoteric, & it may be a gentler introduction to programming than the other languages mentioned.

If you are serious in your quest, getting a book at some point will be inevitable. My suggestions would be:I have each of these titles & can recommend each of them.

Last edited by ocicat; 18th August 2008 at 03:05 PM.
Reply With Quote
  #4   (View Single Post)  
Old 18th August 2008
Crypt Crypt is offline
Port Guard
 
Join Date: Aug 2008
Location: Whitby, Ontario
Posts: 36
Default

Outside of furthering my knowledge, I really have no reason to learn a programming language.
Reply With Quote
  #5   (View Single Post)  
Old 18th August 2008
drhowarddrfine drhowarddrfine is offline
VPN Cryptographer
 
Join Date: May 2008
Posts: 377
Default

Some assembly language should be everyone's first language, followed by C. You learn how computers and languages really work and pointers are not fuzzy abstracts.
Reply With Quote
  #6   (View Single Post)  
Old 18th August 2008
Crypt Crypt is offline
Port Guard
 
Join Date: Aug 2008
Location: Whitby, Ontario
Posts: 36
Default

isn't assembly a really hard language to learn?
Reply With Quote
  #7   (View Single Post)  
Old 18th August 2008
graudeejs's Avatar
graudeejs graudeejs is offline
Real Name: Aldis Berjoza
ISO Quartermaster
 
Join Date: Jul 2008
Location: Riga, Latvia
Posts: 589
Default

I love asm, as long as there's enough documentation
Not a big asm coder....
but it's fun to mess with when you got nothing to do....
Also interesting thing is trying to understand how other code works (revers engineering, no i'm not hacker.... and i ain't got much time).... but i have nice book about it.... with sample programs with some simple protection mechanisms

Reply With Quote
  #8   (View Single Post)  
Old 18th August 2008
BSDfan666 BSDfan666 is offline
Real Name: N/A, this is the interweb.
Banned
 
Join Date: Apr 2008
Location: Ontario, Canada
Posts: 2,223
Default

That's a common misunderstanding Crypt... assembly is quite easy, it just takes a dedicated individual to write something moderately useful in it. (It gets quite repetitive..).
Reply With Quote
  #9   (View Single Post)  
Old 18th August 2008
Crypt Crypt is offline
Port Guard
 
Join Date: Aug 2008
Location: Whitby, Ontario
Posts: 36
Default

Hmm, maybe i'll give it a try saying I can find some good tutorials for it
Reply With Quote
Old 18th August 2008
ocicat ocicat is offline
Administrator
 
Join Date: Apr 2008
Posts: 3,318
Default

Quote:
Originally Posted by Crypt View Post
isn't assembly a really hard language to learn?
There are more details to master when writing good code in assembly language than any other programming language.
  • Consider that any one statement in most higher level languages translates into 2-10+ machine instructions; sometimes, more.
  • Also consider that writing code in assembly language locks your application to that hardware platform. In general, code written in assembly language is not portable at all, however most concept are.
  • From a business standpoint, finding competent people who can write good assembly language is hard. Finding competent people who can write assembly code for an average salary is even harder.
Few good textbooks on writing in assembly language exist, & what few that do (& are still in print...) mostly target Intel & MIPS. Writing assembly language usually requires researching processor specifications.

I'm not trying to turn you away from delving into assembly language, but if this is your first venture into programming, you will find less frustration in focusing on a higher level language first.
Reply With Quote
Old 18th August 2008
BSDfan666 BSDfan666 is offline
Real Name: N/A, this is the interweb.
Banned
 
Join Date: Apr 2008
Location: Ontario, Canada
Posts: 2,223
Default

I agree with ocicat in that a portable solution should be explored first, writing something in assembly.. perhaps for hand optimization, is fine, but generally it shouldn't be used for large complex jobs.

Now for my recommendation, learn C... and whatever you do, just say no to Java/C#
Reply With Quote
Old 18th August 2008
TerryP's Avatar
TerryP TerryP is offline
Arp Constable
 
Join Date: May 2008
Location: USofA
Posts: 1,547
Default

As some one who started with C++, and probably started learning programming for the sole reason of it being "interesting"....


I would personally suggest you either start with something very easy or something very low level.



Ruby and Python are great choices, Pythons tutorial/documentation I think makes it a better first language then Ruby. Although if you're not a programmer, you might probably find the official tutorial a bit boring or confusing (terminology wise). The dive into python book that ocicat posted is a great place to start if you go the Python route.


Ruby, you would probably do best to buy a book if you want to go past the original tutorial, imho. Any thing you find though will definitely be OOP oriented.



If you do choose to learn C as a first language, you might like the C Book, it is no longer current but is 'new enough', found section 8.2 off a Google one day, and noticed it was a decent book. You can also find many (more current) books on C including the the big kahuna (according to some). This crzy tutorial and the c-faq if you are pressed from time.



Personally, if I could send a note to myself through time, I would write: "learn /bin/sh first"
__________________
My Journal

Thou shalt check the array bounds of all strings (indeed, all arrays), for surely where thou typest ``foo'' someone someday shall type ``supercalifragilisticexpialidocious''.
Reply With Quote
Old 18th August 2008
bsdforlife bsdforlife is offline
Real Name: Ridge Allen
Port Guard
 
Join Date: Aug 2008
Location: /dev/null
Posts: 10
Default Learning Programming

I agree that Assembly should be a first programming language, it is somewhat difficult to learn.but if you had some good documentation and the nasm(/usr/ports/devel/nasm) compiler. after that I would go in for C programming. Here is a link to a good book to learn to start learning C programming.
http://www.amazon.com/Programming-La...9096976&sr=1-1
Reply With Quote
Old 19th August 2008
Carpetsmoker's Avatar
Carpetsmoker Carpetsmoker is offline
Real Name: Martin
Tcpdump Spy
 
Join Date: Apr 2008
Location: Netherlands
Posts: 2,243
Default

I think Crypt should just forget about assembly and C and use whatever works, and I suspect this is not assembly or C, although this depends on waht exactly he wants to do.

Maybe after he made some programs/scripts/patches/whatever and is considering a career or long-term hobby in programming he might delve deeper and look at C, assembly, etc. but starting with those languages make little sense, it's like writing a physics book and putting quantum mechanics in chapter one, Einstein's theory of relativity in chapter two and Newton's laws in chapter three ...

Personally, I think python is pretty nice.
__________________
UNIX was not designed to stop you from doing stupid things, because that would also stop you from doing clever things.
Reply With Quote
Old 19th August 2008
qmemo's Avatar
qmemo qmemo is offline
Real Name: He
Package Pilot
 
Join Date: Jul 2008
Location: The big B
Posts: 141
Default

an on line friend advised me to start learning any programming language and stick to it for a while, by that you can pick any other language in a matter of few days

he described it as carpentering , you learn how to use carpentering tools and then start to make any chairs, doors, etc .....

I started with Ruby

Last edited by qmemo; 5th August 2011 at 12:19 AM.
Reply With Quote
Old 19th August 2008
drhowarddrfine drhowarddrfine is offline
VPN Cryptographer
 
Join Date: May 2008
Posts: 377
Default

Quote:
Originally Posted by Carpetsmoker View Post
starting with those languages make little sense, it's like writing a physics book and putting quantum mechanics in chapter one, Einstein's theory of relativity in chapter two and Newton's laws in chapter three ...
No. It's more like teaching a man to fish rather than just giving him fish.
Reply With Quote
Old 19th August 2008
Carpetsmoker's Avatar
Carpetsmoker Carpetsmoker is offline
Real Name: Martin
Tcpdump Spy
 
Join Date: Apr 2008
Location: Netherlands
Posts: 2,243
Default

So everyone who wants to use a programming language just to save time and automate some tasks should learn everything there is to know about computers?

That has nothing to do with teaching anyone to fish, and everything about making a unnecessary steep learning curve and making things overly complicated ...

Maybe one of the better accomplishments of the last 10 years in computing, is that is has been made accessible for almost everyone, things like programming, graphic design, 3D animating, making music, etc. has been made so easy that almost everyone can learn it if they invest the time, without having to invest a six year university study.

It would seem that some people think that ``their way'' is the only way, and that everything else is something of a lesser art, not worth pursuing at all ... This doesn't make any sense, there is nothing wrong with learning just Python (Or Java, Perl, Ruby, PHP etc.), the whole point of a high-level language is that you don't have to worry about the low-level stuff ... Knowledge of the low-level stuff would probably benefit, but it's not needed, and certainly not for beginning programmers.
__________________
UNIX was not designed to stop you from doing stupid things, because that would also stop you from doing clever things.
Reply With Quote
Old 19th August 2008
Crypt Crypt is offline
Port Guard
 
Join Date: Aug 2008
Location: Whitby, Ontario
Posts: 36
Default

Well thanks for all the input guys. I have been looking at Assembly and Python from what you guys have suggested and they both look interesting. I think what i might do is follow in the footsteps of one of my buddies. He started to learn one language and then just kept learning as many as he could. Again, I really have no reason to learn one. I haven't needed it for work as of yet, though who knows what will happen after I learn one...

For the record, I do like the ideas of assembly after looking at what they did with it with MenuetOS...
Reply With Quote
Old 19th August 2008
drhowarddrfine drhowarddrfine is offline
VPN Cryptographer
 
Join Date: May 2008
Posts: 377
Default

Quote:
Originally Posted by Carpetsmoker View Post
Knowledge of the low-level stuff would probably benefit
Ah, so you agree with me.
Quote:
but it's not needed, and certainly not for beginning programmers.
That is subject to debate and is so on many blogs. My belief is, knowing how the machine works is immensely beneficial. How often do you hear one not understand why he can't do things in his language or can't figure out how pointers work? In my case, originally being a hardware guy, I struggle with high level languages; frustrated when I know how to accomplish something in asm but can't recall what heirogrlyphic nonsense I'm missing for a datatype, if the language can do it at all.

I believe learning asm is crucial for knowing how the machine really works, just beyond knowing how the chips themselves work. It's sad many think it's a black or lost art. And I agree with someone above who said asm is not difficult. Yes, I'm used to it since it's all I knew for many years but don't find it difficult to code in at all.
Reply With Quote
Old 19th August 2008
DrJ DrJ is offline
ISO Quartermaster
 
Join Date: Apr 2008
Location: Gold Country, CA
Posts: 507
Default

Quote:
And I agree with someone above who said asm is not difficult.
Must not use NetBSD.

Reply With Quote
Reply

Thread Tools
Display Modes

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 On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Undertaking computer science degree, which BSD for learning professional assembly? lionsong Programming 15 18th October 2009 11:26 PM
Learning how to program Solaris_Delta Programming 9 24th December 2008 07:58 PM
Learning Content Management System Oko General software and network 0 31st October 2008 04:02 AM
Learning Perl mtx Book reviews 7 22nd October 2008 05:55 PM
GUI Programming bsdnewbie999 Programming 6 17th August 2008 12:19 AM


All times are GMT. The time now is 07:20 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick