Which language to pick...?
Hi. I want to know what programming language you think would be best to start off with for someone who's never programmed before.
I already know some HTML and Javascript, and don't really want to do anymore website stuff like PHP.
Which language would be the easiest for me to learn?
Any help is much appreciated :D
Python is a very easy language to get into. Very nice way of writing code.
C++ is a bit more complicated to get into but it's not too bad. I had only basic python experience and I am currently learning C++. Not really that hard to get into.
I can't comment on any other languages besides those. I can't say a bad thing about either python or c++ either. Just pick a language you like and get really good at it.
umm…if your a new programmer and your comparing C language to python….then just pick python cause C is definately gonna be more difficult for you…once you master C its great and alll but i recommend python or Perl for you as a begginner so you don't get bored midway through b/c of the difficulty and yet the fact you can't code anything too interesting in it without having a fair knowledge of it, Both Perl and Python are very simple you can learn them quite fast and will never be bored. C languages take a bit more dedication. Anyways…just my opinion..-peace
Ok thanks for all your suggestions.
In the end I went for Python, and I just coded my first thing lol. It's not very interesting, just a "Guess the number" game. And it's always the same number… o.O
guess=0
while guess!=number:
if guess==0:
guess=input("Guess a number ")
elif guess<number:
guess=input("Higher! ")
elif guess>number:
guess=input("Lower! ")
print"Well done!"```
:D
I couldn't see anyone talking about VB "Visual Basic" which was build over Basic , I believe it is the simplest to learn and the learning curve is much higher than any other language , it is very robust and not that bad when speed matters. nothing can compete with C++ when it comes to speed , but hey speed is not always number one priority. VB reverses the process of programming, you start by building the user interface first then start the coding . in any other language you deal with coding first then worry about the user interface. one bad thing I could say, since it is coming from MicroTheft , the security is some what a problem .
@Surgeonz:
Add as first line of your code markupimport random
.
Use then in the line which generates the number markupnumber = randrange(1, 100)
@MrDoom119: I have to agree with you there: Visual Basic is really easy to learn. Creating a nice GUI and being a RAD language (create a prank in 10 minutes with C++!) are the best things of it. But it runs only on windows properly (with properly I mean proper speed, so no WINE) , it teaches you bad programming habits and it's not optimal for everything. So I started Python and C++ and love them even more than VB.
Hmm ok. Maybe I'll try VB next…
And there's one problem: that code that you gave me; I think I might have entered it wrong. When I run it on the Python Shell, it just resets the shell and nothing happens. My code is:
number = randrange(1, 100)
guess=0
while guess!=number:
if guess==0:
guess=input("Guess a number ")
elif guess<number:
guess=input("Higher! ")
elif guess>number:
guess=input("Lower! ")
print"Well done!"```
Now I get > NameError: name 'seed' is not defined
My code is now:
seed()
number = randrange(1, 100)
guess=0
while guess!=number:
if guess==0:
guess=input("Guess a number ")
elif guess<number:
guess=input("Higher! ")
elif guess>number:
guess=input("Lower! ")
print"Well done!"
Use then random.seed(). Or leave it out. One of both must work.
PS: The module is explained fairly good there: http://docs.python.org/lib/module-random.html
Surgeonz wrote: Hi. I want to know what programming language you think would be best to start off with for someone who's never programmed before.
I already know some HTML and JavaScript, and don't really want to do anymore website stuff like PHP.
Which language would be the easiest for me to learn?
Any help is much appreciated :D
No one can really tell you what is actually best. If you want easy, you could always go for Visual Basic, but that isn't necessarily going to be what is best.
The first thing is to look at what you want to do. Where do you eventually want to end up?? Specifics. C and Python are very popular for a bunch of stuff, but what would your "dream" be?
Just read how the languages are different, or study generic high level language syntax/logic (apparently people have a hard time understanding the concept of loops and subroutines). Compare things like portability and size, and limitations (like security). If cost is an issue, post back and I'll find a free/legit version of what you want.
Surgeonz: Nice code. I've seen a few people do this game, with verying degrees of 'sucess'. Your's is a good design.
Just one helpful tip: You should always use raw_input() to get info from the user. Using input() actually treats what you enter as something to be evaluated. For example, I can hack your game by entering the word number at the prompt.
Guess a number number
Well done!
It might seem unimportant, but if you're writing a password prompt it matters. Here's how I interpreted your code. Use find and replace to switch [tb] with four spaces.
import random
random.seed()
while True:
[tb]number = random.randrange(1, 100)
[tb]guess=0
[tb]while guess!=number:
[tb][tb]if guess==0:
[tb][tb][tb]guess=input("Guess a number ")
[tb][tb]elif guess<number:
[tb][tb][tb]guess=input("Higher! ")
[tb][tb]elif guess>number:
[tb][tb][tb]guess=input("Lower! ")
[tb]print"Well done!"