Brand New Coder

A place to discuss the implementation and style of computer programs.

Moderators: phlip, Moderators General, Prelates

justjack314
Posts: 10
Joined: Fri Jul 24, 2009 4:45 pm UTC

Brand New Coder

Postby justjack314 » Mon Jul 27, 2009 2:18 am UTC

Hello. I want to try out programming for a bit just to see what it is like. Do you guys have any ideas on what I should try to make, and then what would be the best language for it?

Thanks so much

User avatar
InkL0sed
Posts: 205
Joined: Wed Sep 10, 2008 3:46 am UTC

Re: Brand New Coder

Postby InkL0sed » Mon Jul 27, 2009 2:22 am UTC

So... you have absolutely zero experience programming?

notallama
Posts: 236
Joined: Fri Jun 01, 2007 4:28 pm UTC

Re: Brand New Coder

Postby notallama » Mon Jul 27, 2009 3:09 am UTC

if you have any sort of math background, you might want to try out project euler.
it has a bunch of short little problems that you can write programs to solve in whatever language you want.

you could also try to do a simple graphics based thing.
just have your program do some sort of calculations and spit out a ppm file. http://en.wikipedia.org/wiki/Netpbm_format
it's jsut a dead simple image format, so all of your focus can go toward whatever image you'd be trying to produce, rather than fighting with the file format.
postscript is good for this too. it uses vector graphics, which are simpler for many things, but you'll need to do slightly more reading to understand how to generate one.

i just did one with ppm yesterday: http://hclarke.tumblr.com/post/14955963 ... t-renderer
c++ source code is there. i'd suggest a different langage to start with, though. c++ is great, but i didn't find it very intuitive until learning some other languages first (x86 assembly helped the most, but that's a whole can of worms on its own).

you might want to try this out to start:
http://tryruby.hobix.com/
ruby is a pretty good programming language. it's simple enough for a beginner, but it's not because it's dumbed down; it's just good that way.

User avatar
InkL0sed
Posts: 205
Joined: Wed Sep 10, 2008 3:46 am UTC

Re: Brand New Coder

Postby InkL0sed » Mon Jul 27, 2009 3:39 am UTC

Graphics for a beginner? That seems a little absurd...

notallama
Posts: 236
Joined: Fri Jun 01, 2007 4:28 pm UTC

Re: Brand New Coder

Postby notallama » Mon Jul 27, 2009 3:55 am UTC

just static images.
what's wrong with graphics?

like, you finish a tutorial or two, and then you're wondering what you can do. pick up a simple file format and generate it automatically!
ppm and postscript happen to be very good for that, since they're just plain ascii text, which you learn how to print in every language tutorial.

User avatar
Sc4Freak
Posts: 673
Joined: Thu Jul 12, 2007 4:50 am UTC
Location: Redmond, Washington

Re: Brand New Coder

Postby Sc4Freak » Mon Jul 27, 2009 4:09 am UTC

notallama wrote:just static images.
what's wrong with graphics?

Because trying to learn a new API without even knowing the basics of programming, and without knowing any programming languages at all, is a bad idea.

Start small. Make programs to print stuff to the console. Then move onto slightly more complex things, like writing a number guessing game. Performing image decoding and finding a way to display it to the screen is way too difficult for someone who's never written a program before.

notallama
Posts: 236
Joined: Fri Jun 01, 2007 4:28 pm UTC

Re: Brand New Coder

Postby notallama » Mon Jul 27, 2009 4:36 am UTC

image output. not input.
i mean writing a program that writes an image to a file, which you open with some image viewer.

and again, ppm is dead simple. http://en.wikipedia.org/wiki/Portable_pixmap
you can open them with GIMP, if you don't already have a viewer that knows what to do with them.
you have the technical skills after "hello world!" and a for loop.

easier than drawing an ascii image, imo.
this is small.

null1024
Posts: 38
Joined: Fri Jun 05, 2009 10:20 am UTC
Location: About 4.91E11 feet from the sun.
Contact:

Re: Brand New Coder

Postby null1024 » Mon Jul 27, 2009 4:37 am UTC

Python is your friend. Almost everything is dead simple to do, and it's also a rather powerful language.
http://python.org/download/

Just try to make a few simple things. Hello world, a miniature adventure game, a calculator, etc.
Image

User avatar
Area Man
Posts: 256
Joined: Thu Dec 25, 2008 8:08 pm UTC
Location: Local

Re: Brand New Coder

Postby Area Man » Mon Jul 27, 2009 5:37 am UTC

What are you interested in pursuing, do you have a goal in mind? do you have a job? or are you in school, and what is your major... how are you with math?

The typical beginner exercises are command line calculator, and small utilities like Unix "du" command (sum up file sizes in a folder and its subfolders). This should give you an idea of how to use various language facilities and interact with the OS.
Language of choice is C or C++ if you're interested in how the machine works.

Another option is SQL programming and working with databases; this is more high-level and may come in more handy if you don't get "into" programming, also very good to know if you do.
Bisquick boxes are a dead medium.

justjack314
Posts: 10
Joined: Fri Jul 24, 2009 4:45 pm UTC

Re: Brand New Coder

Postby justjack314 » Mon Jul 27, 2009 1:28 pm UTC

I'm a high school sophomore and I'm in interested in math so Project Euler seems like a lot of fun. I sort of want to try Python, just because these comics make it sound very good. Is it possible to do a sort of calculator in Python.

Thanks for all your help!

notallama
Posts: 236
Joined: Fri Jun 01, 2007 4:28 pm UTC

Re: Brand New Coder

Postby notallama » Mon Jul 27, 2009 2:25 pm UTC

any programming language with input and output can be used to make a calculator.
in general, any programming language can be used to make anything (assuming it's turing complete, which basically all of them are). some languages make it easier to do certain things, thoguh.
python and other interpreted languages (ruby, lisp, haskell, etc.) are very good for calculators. you enter all the commands in a prompt, so they're basically a calculator already. you just have to write new functions for them to use and you're good to go.

a compiled language like c or c++ is harder to use.
they have their advantages, but it's probably best to leave them alone until you have written a couple programs in another language.

justjack314
Posts: 10
Joined: Fri Jul 24, 2009 4:45 pm UTC

Re: Brand New Coder

Postby justjack314 » Mon Jul 27, 2009 4:02 pm UTC

I think I'll start with Python. Would you guys recommend me buying a book or do you think I could find instructions on the internet? And then, what program do I need to download to start coding in?

User avatar
InkL0sed
Posts: 205
Joined: Wed Sep 10, 2008 3:46 am UTC

Re: Brand New Coder

Postby InkL0sed » Mon Jul 27, 2009 4:07 pm UTC

If you think you can follow an online tutorial, then don't get a book. If you're not getting it though, a book might be better.

What OS are you using? If you have a Mac, you can start using Python right away (yay Macs). If you have Windows or something else, someone else will have to tell you what to do.

notallama
Posts: 236
Joined: Fri Jun 01, 2007 4:28 pm UTC

Re: Brand New Coder

Postby notallama » Mon Jul 27, 2009 4:10 pm UTC

and you need python. it comes with its own editor.
in general, you can use any text editor to write code. vim and emacs are pretty common ones to use. notepad will work too; it's just not very classy.
and then there are language-specific editors that can point out errors and such.

and you need the language's interpreter or compiler to run it or compile it into a runnable form.
on linux, you probably already have python. and if you don't get it from your packaga manager.
on windows, get it from the internets.

Vaporice
Posts: 11
Joined: Mon May 04, 2009 3:20 pm UTC

Re: Brand New Coder

Postby Vaporice » Mon Jul 27, 2009 4:11 pm UTC

You can download python at http://www.python.org

Just read through this page http://wiki.python.org/moin/BeginnersGuide to get started. There was a very good guide there but they must have deleted it, haven't tried what's on there now but i'm sure it's good. I'll post the link the other tutorial when i find it

justjack314
Posts: 10
Joined: Fri Jul 24, 2009 4:45 pm UTC

Re: Brand New Coder

Postby justjack314 » Mon Jul 27, 2009 7:37 pm UTC

Thanks so much for you help! I'll mess around with it for a while a tell you how it is later.

User avatar
Cleverbeans
Posts: 1378
Joined: Wed Mar 26, 2008 1:16 pm UTC

Re: Brand New Coder

Postby Cleverbeans » Mon Jul 27, 2009 10:46 pm UTC

MIT OpenCourseWare has a great course that's likely just your speed and it uses Python. All the textbook materials are free and online, however it currently lacks video lectures.

http://ocw.mit.edu/OcwWeb/Electrical-En ... /index.htm

I would also recommend checking out the Standford Introduction to Programming Methodology course. It does have video lectures, and the professor is excellent. It's not Python but Java is a good language to know as well and I particularly like that the chose Karel as a first introduction to the language. The downside of this course is a lack of online textbooks, and it's Java.

http://see.stanford.edu/see/courseinfo. ... 6adcae1111

If you use both in tandem I'm sure you'll gain an excellent entry into the word of programming.
"Labor is prior to, and independent of, capital. Capital is only the fruit of labor, and could never have existed if labor had not first existed. Labor is the superior of capital, and deserves much the higher consideration." - Abraham Lincoln

User avatar
PM 2Ring
Posts: 3707
Joined: Mon Jan 26, 2009 3:19 pm UTC
Location: Sydney, Australia

Re: Brand New Coder

Postby PM 2Ring » Fri Jul 31, 2009 5:12 pm UTC

I also recommend Python as a first language, although the standard tutorial assumes the reader is already familiar with at least one other programming language & programming concepts. There are some good (and free) online books / tutorials that are more basic, though. Eg A Beginner's Python Tutorial

notallama wrote:just static images.
what's wrong with graphics?

like, you finish a tutorial or two, and then you're wondering what you can do. pick up a simple file format and generate it automatically!
ppm and postscript happen to be very good for that, since they're just plain ascii text, which you learn how to print in every language tutorial.

As much as I enjoy writing programs that write NetPBM formats or PostScript, I don't think that's good advice for a raw beginner. Give him a few weeks to get up to speed first. :) Sure, it can be very rewarding to make pictures with programs, but you do need to get comfortable with the programming basics before you throw in the added complications of graphics.

The NetPBM formats are simple and easy to remember, but if you're doing graphics without an API, you can do a lot with simple pixel-based designs, but eventually you need to learn about line & circle plotting algorithms, etc. As for PostScript, it's a whole language in itself, and not one I'd inflict on a newbie, although I guess it's possible to do a lot in PostScript with just a small subset of the language, especially if you have a few nice functions in a well-written prolog. Still, it's not fun programming in PostScript without the manual. I started learning it from a couple of tutorials & example programs. It became a whole lot less mysterious once I got the manual. :)

FWIW, the last program I wrote that generated PostScript output (as distinct from programs written directly in PostScript), was written in Python. It's a CGI script that generates business cards, using data from a Web form, so the whole exercise involved writing in Python, PostScript, HTML and Javascript. Switching between languages like that can be fun, but there is the risk of accidently typing in the wrong language. Luckily, such errors are easy to see. :)

Unparallelogram
Posts: 336
Joined: Mon Jul 28, 2008 4:16 am UTC

Re: Brand New Coder

Postby Unparallelogram » Sat Aug 15, 2009 5:32 pm UTC

http://poignantguide.net/ruby/ is probably the most amusing programming book ever.

Parsifal
Posts: 113
Joined: Thu Feb 28, 2008 1:35 am UTC

Re: Brand New Coder

Postby Parsifal » Sun Aug 16, 2009 2:32 pm UTC

May I recommend "Java for Programmers"? It isn't as basic as the "Learn X in Y days" books, but I ran across it in the computer book store the other day and it looks like the book I would have LOVED when I was just starting to program. It has a lot of charts and graphics demonstrating basic coding concepts and goes into more detail about the fundamentals than most intro books, although in less rigor than a real textbook. Just my $0.02.

the.coding.eye
Posts: 52
Joined: Thu Apr 16, 2009 4:56 am UTC
Contact:

Re: Brand New Coder

Postby the.coding.eye » Sun Aug 30, 2009 3:12 am UTC

May I suggest the following two posts for information about starting programming:

viewtopic.php?f=11&t=43574
viewtopic.php?f=40&t=20660
"In theory, theory and practice are the same. In practice, they are not."


Return to “Coding”

Who is online

Users browsing this forum: No registered users and 7 guests