Programming


StopPlayingKidz

Still Fresh
Joined
May 19, 2015
Messages
7
Im a Newbie High School student that will graduate high school soon, I want to learn programming but I need help on were to start. Which is the best language to start learning on? Any suggestions also. Besides this, Id also love to hear more information about the pyra or the Open Pandora, I got interested just recently though I never even new the existence of this portable linux PC. Ive been influenced by the PlayStation and Nintendo so the pyra and open pandora s new to me. Would love to know more about it. From what Ive read in rhe forums it sees like a very cool device, this should be the alternative for chromebooks at school since its cheap and portable for students.
 
If you want to get something on the screen quick to learn the basics of programming, learn Python. It gets you where you want quick, but not necessarily in the best way. Many concepts from it carry to other languages though and it's a useful thing to learn.

If you want to see how things work and don't mind a bit more stuff to learn, go with C. When you're comfortable with C up to dynamic memory allocation (malloc/free), move on to C++ if you want. C is a simpler language so it's easier to grasp, but C++ is (in my opinion) a nicer language to code in and knowing the basics of C help in understanding how it works. These have great performance and flexibility, but are somewhat more laborous to get started with.

If you don't really care how things work at low levels but want good performance, start with C++. C is a good learning experience and good for many things, but I consider C++ a better language to know and use. That's my opinion, of course.

If you want to get a good theoretical grasp on programming that's good to have in the long term but less useful in the short term, read SICP and do the exercises. It gets you thinking in the right way. The programming language used in it (scheme) is rarely used anymore, but it has some close relatives like common lisp and clojure that are used to some extent. Even if you won't actually use any language like scheme later, the stuff you learn will be very useful in structuring and reasoning about your programs in other languages.
 
Last edited by a moderator:
Would learning Python make learning C later more difficult or easier?


Edit: sorry, posted too soon.


I am really really keen to learn as simply and easy to pick language as possible... than I could make some simple games or programmes for the Pyra one day.


I don't have much time, so can't spend hours a day learning and practicing.


If that's as far as I go, then better than nothing.


But it would be nice if circumstances change one day, and I find Python to restrictive... that I could move over to something more powerful like C or C++


I fear that going straight to C would require too much from me to get anywhere and I would give up.
 
Last edited by a moderator:
Would learning Python make learning C later more difficult or easier?
Easier because they share the basic concepts of how imperative programs are structured and how algorithms are used to process data. Harder because it teaches you to not think about memory and data types.
 
Last edited by a moderator:
Go for Python. Best for beginners. Many tutorials on the interweb.

If it gets too slow (e.g. for games) go for C afterwards.
 
I'd still recommend BASIC as a starter language... Especially with something like GLBasic that seems pretty straightforward, and can compile for a variety of platforms

Python has that bizarre notion of indentation actually "meaning" something; and despite my best efforts, I still find some of my source code tabbed, and others where they've been replaced with spaces - which absolutely kills Python
 
I wouldn't recommend Python for a beginner - its a language that stretches from one end of the complexity scale to another and you can easily get overwhelmed with some of its peculiarities .. 

The fact is though, as a beginner you have a wide range of languages and programming environments to choose from.  Remember though that programming is not just about typing code and hoping it runs - you also have to have some skills with regards to administering your computer and understanding how it works at a systems level as well as at the front-end stage of things.  Pick an environment that is: a) easy to use, in terms of tooling, and B) approachable for you, yourself, personally.

Python may well be what you choose - but there are other great tools too.  For me, I'd pick Lua to teach a newbie programmer - it has all the power you need and is very easy to use, and it will interface with a lot of things, as it is based on a C-language framework that can interact with any other system library out there.  If you learn Lua well you can then use the skills to learn C and C++ - there are tons of Lua-based environments out there with a foot in both the Lua and C++ worlds, and you can gain a lot of valuable wisdom from following this path:  Lua -> C -> C++ -> Everything else.
 
Last edited by a moderator:
Python has that bizarre notion of indentation actually "meaning" something; and despite my best efforts, I still find some of my source code tabbed, and others where they've been replaced with spaces - which absolutely kills Python
Python has a PEP that says you use spaces unless you change code that already has tabs. Learning to indent your code cleanly by forcing it via language is not a bad thing to learn.
 
Last edited by a moderator:
Learning to indent your code cleanly by forcing it via language is not a bad thing to learn.
YMMV.  It can also be very frustrating to deal with when you're learning.  I wouldn't recommend Python for a newbie - there's also the whole pip/easy_install mess to deal with ..
 
Learning to indent your code cleanly by forcing it via language is not a bad thing to learn
Whilst I don't disagree that clean indentation is good. I indent at 2 spaces, nearly every text editor (and template code) seems to default to 4 (or sometimes 8).
This causes all sorts of formatting issues when I pick other peoples code up.
 
Learning to indent your code cleanly by forcing it via language is not a bad thing to learn.
YMMV.  It can also be very frustrating to deal with when you're learning.  I wouldn't recommend Python for a newbie - there's also the whole pip/easy_install mess to deal with ..
It can be frustrating, but it should be learned. The pip/easy_install mess is a later stage headache IMO. Not saying it's not a mess though :D

Learning to indent your code cleanly by forcing it via language is not a bad thing to learn
Whilst I don't disagree that clean indentation is good. I indent at 2 spaces, nearly every text editor (and template code) seems to default to 4 (or sometimes 8).

This causes all sorts of formatting issues when I pick other peoples code up.
Well, you get those issues whether the language has meaningful whitespace or not. It just shows up as badly styled code instead of errors. Always set your editor to suit the code you edit. Some editors like vim have a nice solution to this.
 
No matter what language you use set a clear (and relatively easy) goal something you really want to make. Nothing helps learning to code than having a nice project to work on that will actually do something in the end. 
 
Last edited by a moderator:
Always set your editor to suit the code you edit
That would get complicated - especially if you work on several forked projects, each with a different style.
It's not generally a big deal for me, as I'm generally the solo developer on my projects, and as I also generally work in Visual Studio, I can click the "Format Document" button to fix all the indentations.
 
Always set your editor to suit the code you edit
That would get complicated - especially if you work on several forked projects, each with a different style.

It's not generally a big deal for me, as I'm generally the solo developer on my projects, and as I also generally work in Visual Studio, I can click the "Format Document" button to fix all the indentations.
That forces the existing code to your style. For python, you might as well just "format document" before editing the file and use your own style :)
 
For python, you might as well just "format document" before editing the file and use your own style :)
But if you've got some tabs, and some spaces, how will it know how many idents to make each line?
For example


function test:
^^for i = 1 to 10
^^^^print i
#print i
Assume ^ is a whitespace, and # is a tab. If your tab width is 2, the second print i is outside the for loop, whereas if tab width is 4, it would be inside.
Maybe the point is moot, as I guess if you're a serious Python dev, you'll have tabs autoconvert to spaces permanently?
 
Python is great, I love how easy it is to program and debug. But I'm getting more adept in C++ (or I know enough to be dangerous).  There's definitely things that will make you want to hurt yourself if you are just poking your way around in the dark in C++.

Questions about tabs vs. spaces in Python: it's recommended to use spaces to indent, not actual tabs.  You can make your tab create spaces in good text editors.

:set expandtab

This is my default setting, and it only bothers me when I'm trying to make Makefiles.  (There you need to use actual tabs.)  I just keep a Makefile handy, however, to copy over tabs.

Python offers a much cleaner style IMO than C++, so it is easier to read.
 
Last edited by a moderator:
For python, you might as well just "format document" before editing the file and use your own style :)
But if you've got some tabs, and some spaces, how will it know how many idents to make each line?

For example


function test:
^^for i = 1 to 10
^^^^print i
#print i

Assume ^ is a whitespace, and # is a tab. If your tab width is 2, the second print i is outside the for loop, whereas if tab width is 4, it would be inside.

Maybe the point is moot, as I guess if you're a serious Python dev, you'll have tabs autoconvert to spaces permanently?
If you get a file that has both tabs and spaces in python, someone has already made a mistake and it should be fixed. I understand and acknowledge the kind of mistakes you describe can happen. I have tabs show up different than tabwidth amount of spaces in pretty much all editors I use, so it's quite obvious for me to notice. No autoconvert, as I try to maintain the style used by the original code. I just swap between tabs and spaces as needed.
 
Back
Top