Programming languages for total newbs.

Page 3 - Seeking answers? Join the AnandTech community: where nearly half-a-million members share solutions and discuss the latest tech.

Tsaar

Guest
Apr 15, 2010
228
0
76
As a fairly recent electrical engineering graduate with some decent exposure to programming, I have only really used C/C++, Java, and Matlab.

When talking about these non-compiled scripting languages, such as Python, how do you actually get a binary, executable file without compiling?

Basically, can I code something in Python, create an executable file, and put it on my friend's computer to show him what an awesome programmer I am?

With C++ it was easy (well, *AFTER* debugging 9999999999 memory errors ;)) to just hit the compile button and have a nice file ready to be executed.
 
Oct 27, 2007
17,010
1
0
To execute Python code you need to have the Python runtime installed (just like you need JRE to run Java programs). Although I'm sure there's a way of compiling Python to a .exe, I just don't know it (not a Python guy myself).
 

esun

Platinum Member
Nov 12, 2001
2,214
0
0
Scheme's not a bad choice, and there is a wonderful free book that's meant for complete beginners to learn programming from scratch that is used by MIT and UC Berkeley for their introductory undergraduate CS courses:

http://mitpress.mit.edu/sicp/

However, nobody actually uses Scheme outside of people in those classes and some other academics (and a tiny sliver of real-world people). Hence, after learning Scheme you will almost inevitably want to learn another language anyway, so you might as well go with the other language from the get-go.
 
Last edited:

ObscureCaucasian

Diamond Member
Jul 23, 2006
3,934
0
0
To execute Python code you need to have the Python runtime installed (just like you need JRE to run Java programs). Although I'm sure there's a way of compiling Python to a .exe, I just don't know it (not a Python guy myself).

There are several programs out there that will take a python script and package it with the python interpreter to make a standalone executable. Sure it's a lot of overhead but could work for certain applications.
 
Oct 27, 2007
17,010
1
0
The most important thing in learning to program is to just do it. Stop getting so caught up in the details of which language, which book, which tutorial, which video, etc. Just start making things.

Take Crusty's advice and visit that link. Lots of great resources. Stop thinking about it and start doing it.
 

TridenT

Lifer
Sep 4, 2006
16,810
45
91
I've been watching the MIT lectures... Pretty good lectures actually. I think I could learn how to program a bit of it this way if I have more hands-on.. So far I have just been learning what for, if, while, etc is. He starts to do a major, "omfg wtf" moment at the part where he does this program that is just a bit too complex for my brain that has been out of the math loop too long. O_O (Pigs + spiders + chickens, heads/legs problem)

I guess I'll need some hands on practice. See if I can download some scripts from the website and dissect them a bit. :)
 
Oct 27, 2007
17,010
1
0
Start with the hands-on stuff absolutely as soon as possible. Like, right now. Just get yourself a compiler for your language of choice and start writing something. Think of some little tool you can make that will solve a simple problem and implement it.

The canonical first example is a Fahrenheit -> Celsius converter. The formula is simple. One of the first things I wrote was a program to solve quadratic equations. You can start with one that will solve quadratics with real roots and extend it later to solve quadratics with imaginary roots (this will help you learn about conditional statements (ie if statements)). The program will take as user inputs three numbers, A, B and C. It will output two numbers, the two roots.
 

TridenT

Lifer
Sep 4, 2006
16,810
45
91
Start with the hands-on stuff absolutely as soon as possible. Like, right now. Just get yourself a compiler for your language of choice and start writing something. Think of some little tool you can make that will solve a simple problem and implement it.

The canonical first example is a Fahrenheit -> Celsius converter. The formula is simple. One of the first things I wrote was a program to solve quadratic equations. You can start with one that will solve quadratics with real roots and extend it later to solve quadratics with imaginary roots (this will help you learn about conditional statements (ie if statements)). The program will take as user inputs three numbers, A, B and C. It will output two numbers, the two roots.

Yeah, I went to the website and downloaded all the handouts(code that he shows in class... it's so much easier to read now when it's actually ... on the screen for more than a few seconds. :) ). I'm going to try to make some simple stuff like that.