• Some users have recently had their accounts hijacked. It seems that the now defunct EVGA forums might have compromised your password there and seems many are using the same PW here. We would suggest you UPDATE YOUR PASSWORD and TURN ON 2FA for your account here to further secure it. None of the compromised accounts had 2FA turned on.
    Once you have enabled 2FA, your account will be updated soon to show a badge, letting other members know that you use 2FA to protect your account. This should be beneficial for everyone that uses FSFT.

Which programming language should I learn?

NismoTuned

n00b
Joined
Apr 2, 2013
Messages
49
I'm sure you all have answered a plethora of questions similar to this but everybody's case is unique. I want to be able to write scripts, make GUI applications, and Make GUI and Non-GUI applications for the Raspberry Pi. The majority of the work I will be doing is for windows, and I want the windows applications to have a native look and feel to them. I really want to have programs where I can just put the executable on a flash drive and use it on any windows machine.

I have been Recommended Python, C#, and C++. I keep shying away from C# because of the .NET framework. I've used too many programs that won't work because of errors with the framework which has put a sour taste in my mouth. I'm not running an outdated version of the framework on my PC.
 
I have been Recommended Python, C#, and C++.

Any of those would be a decent choice. I'm a firm believer the most important skills to a programmer (lateral thinking, creativity, good problem solving abilities, strong writing and communication skills, strong math skills, etc.) are language agnostic, so your choice of language isn't something to make a huge deal out of.

That said, I personally believe that at some point you should get a firm grasp on programming in C++. There's loads of value in having a very low-level understanding of the machine, and C++ being close to the machine is good in that respect.

There are two approaches that I really like for starting out; Using C/C++, getting right down to the machine, and building a solid, bottom-up understanding of computers and how to program them, or jumping into a very high level language like Python so that you can go straight into problem solving and develop your critical thinking skills. I'd say languages in between that point such as C# or Java aren't ideal, because they're not low-level enough for you to get close to the machine, but they're not high level enough to allow you to think about your problems in a very abstract way.

I want to be able to write scripts,

Well, Python does that well...

The majority of the work I will be doing is for windows, and I want the windows applications to have a native look and feel to them. I really want to have programs where I can just put the executable on a flash drive and use it on any windows machine.

...But C++ does this well.
 
The Pi community seems to have mostly gravitated toward Python, if that's of any consequence.

I'm a major proponent of C++, but if you aren't doing predictability-sensitive work, its extra complexity is likely to be wasted as an increase in development time. Its capability is massive (it's four programming languages in one!), but it's large, deeply complex and full of subtle gotchas. For building Windows applications, C# is probably what I'd lean toward. Regarding runtime nightmares, Microsoft's really tightened up their shit when it comes to versioning: Windows Vista/7/8 will install exactly what an application needs if it's in need of an older version of the framework, and it does it automatically (and, in my experience, flawlessly). I really don't think you need to worry about your users getting a sour taste in their mouths due to issues of that nature anymore.
 
Indeed, there are lots of posts like this. Mostly, people make thoughtless recommendations about their language and then we never hear from the OP again, anyway. What is it that you think makes your specific situation unique?

The .NET Framework is reliable and works just fine. If you're having some specific error with it, you should work to find the root cause and remedy it as it is indicative with a deeper problem with your system and you'll inevitably come across applications you want to use which will require the framework in order to work properly. People in tihs forum can probably help you with that troubleshooting.

Between your prejudice against .NET and your interest in writing code for the Raspberry Pi platform, you can probably rule out C# and the other .NET languages. You can consider Python or Java, but they won't deliver your requirement of "native look and feel to them" -- assuming I understand what you mean by that. That leaves only C++, then.
 
The only odd-man out, in my opinion, is C++.
Python, C# and Java are all good things to learn and you'll find uses for their application in many development shops. C++ is also quite useful, it's just typically for a different breed of software.

If you want to work on embedded, then C++ and Java are both solid choices.
 
What is it that you think makes your specific situation unique?
I figured each individual has different needs and desires, which Is why I say it.

I tried getting as much info as possible into my original post, and by doing this I forgot to add some things. Everything I'll be doing is just for recreation. I have very little experience with programming. The only languages I know the basics of are HTML and CSS. I figure your recommendations will be based off of my experience so what has been said already may change due to this. It almost makes me curious if I should learn two languages.
 
There exists no single language/framework/runtime that is common to both the Raspberry Pi and Windows that will properly service your stated requirements.

Python is the de-facto standard for the Pi. It’s easy to learn, gives immediate results and more often than not there will be a module available to do the heavy lifting for you in most scenarios. It’s great for script-type work (and capable of far more), but it is not a good choice for building applications that exhibit native Windows UX. It can be done, but it’s a lot more work than other paths.

If you’ve having issues with framework versions for .NET then the easiest thing to do is install them all. Excepting 4.5 and 4.5.1, all earlier framework versions co-exist side-by-side, and not many applications require 4.0 but break with 4.5+.

Like Dogs … I’m a proponent of C/C++. Learning C will teach you more about what’s really going with the machine and in your code on than any other approachable path. C++ then augments this with a variety of features that, applied sanely, are ridiculously powerful (though when abused, can be the most convoluted cluster imaginable).

Based on what you say you want to do, I’d learn Python first – it’ll give you some early successes and, honestly, if you can’t make progress with it then C/C++ are non-starters.

For native Windows UX applications you’re going to be hard pressed to find a better option than C#/.NET. Sure, you can do the same things from C++ (or managed or otherwise), or VB.NET, but with few exceptions you really don’t need to.
 
If you want to work on embedded, then C++ and Java are both solid choices.

While I suppose it depends on your definition of what “embedded” systems are, I can’t say I’ve run across Java in this space very much at all. True, its progenitor, “Oak” was created originally for building code for set-top boxes, but most embedded systems work is on vastly simpler and less sophisticated hardware.

In many embedded scenarios you are shooting for the absolute minimum in terms of storage, RAM and processing capability you can get away with, so anything that needs a VM has a comparatively massive overhead before you even start thinking about your own code.

Even C++ rarely gets a look-in (and if it does, it's usually treated as "C with classes") unless you’re unfortunate enough to be doing embedded work on something Windows-based.

Microcontroller level work often requires heavily optimized pure C, and it’s extremely common to wind up replacing some code with hand-written assembler, using all manner of nasty tricks, to squeeze things down by a few bytes/cycles so that you can use the next-less-powerful controller and shave a couple of pennies off the cost of a key component.

But again, it depends on the type of embedded system you’re talking about. My work in that space, and that of one of my dev shops/studios (another is in the mobile space), focuses on things that aren’t innately “computer like” (i.e. there is a computer behind the scenes, but it’s not exposed as such in any direct way unlike, say, with a phone or tablet).
 
So my decision to start with python has been made, then to move onto the next language is the issue. It seems like C# might be the best bet, but what if I want to move on from there? I'd have to learn another language?
 
See how you do with Python before you start worrying about the next language.

There’s not much you can’t do in Python; mostly it’s down to some things being harder/easier with some languages, frameworks or runtimes than others.

And if you’re just starting out in programming it’s vanishingly unlikely that you’ll exceed C#’s capabilities in the next 5 years. But yes, if you do, you’ll need to learn something else (constant learning is something to expect when developing software). Learning to actually program is by far the hardest part. Languages are easy after that.
 
I've been trying to get the basics of python for two days now and am having a difficult time. It doesn't help that I was initially using Codecademy then switched over to the book "A Byte of Python" because they use different versions of Python. A Byte of Python doesn't really have many exercises for you to do while you read, which makes it incredibly hard for me to remember. Last school year I took a course on web design basics that was incredibly easy for me, but there is no Python class unfortunately.
 
Last edited:
The distinctions between 2.x and 3.x aren't going to make a whole lot of difference for you as a beginner. If you end up doing anything professionally with Python, you'll probably be expected to be familiar with both 2.x and 3.x. The MIT Course that targets 2.5.4 is applicable to the whole 2.x series, and excellent starting grounds for a transition to 3.x. If you learn using only 3.x materials be prepared to pick up 2.7 occasionally as a number of common/popular libraries still have yet to be ported to 3.x.
 
I you have a hard time retaining what you read, software development might not be your calling.
 
Try MIT 6.00x, a free class offered via edX. It teaches Python (2.7) very well.

After taking that and solving the first 30 or so ProjectEuler.net problems with Python, I feel like I've learner quite a bit. I still don't really know how to make anything of consequence, but I'll get there, maybe.
 
The majority of the work I will be doing is for windows, and I want the windows applications to have a native look and feel to them

Honestly, it seems like you should be more interested in .NET than Python. Python is fine, but you seem biased against .NET and I don't think your reasoning is valid. I've never seen any programs fail because of "errors in the .NET framework". Python won't run windows without installing it. A lot of windows machines already have .NET installed. As far as Raspberry Pi, I'm not sure, maybe C would be the way to go I would have to look into it myself.

Anyway, if you are learning programming concepts, which is really the important thing, and have a good online course to follow, then just stick with Python for now if you wish. But keep in mind it isn't really the language that matters, you are learning concepts, which you can apply to other languages and pick them up somewhat quickly. Loops will still be loops, logic will still be logic, objects in an object oriented language are still objects in a different OO language, etc.

If you really want to learn, you'll need to learn more than one language anyway. Different languages will have different purposes and strengths and weakness as well as teach you different concepts. Maybe learn Python, try some C/C++, then try .NET or Java.
 
I put aside my bigger is better mentality (thinking python 3 is better than 2) Because there are far more resources that work well for me that use python 2. You all say it will be easy to adapt as well which is nice. Yes, I found I would be more interested in .NET the hard way.
 
Last edited:
Yup, libraries are still a major issue for Python 3, so stick with Python 2.

Let me add one language for .NET to the mix: F# :)
 
I keep shying away from C# because of the .NET framework. I've used too many programs that won't work because of errors with the framework which has put a sour taste in my mouth.

Do you have an example of that?
I'd consider myself to be someone who frequently installs different software to test things out and I can honestly say that since the .Net framework was released in 2002 I have *never* come across a program that didn't work because of .Net.

The .Net framework is actively being developed and iterated upon and it's frankly one of the best things that Microsoft has ever put out there because it's efficient, clean, and it just works.

If you plan on either working in a major corporate environment, or contract for a major corporate entity then you have to go the .Net and C# route.
 
Explaining my suggestions...

Python - scripting language, websites, scripts, easier syntax perhaps

C/C++ - lower level language, you must control memory allocation and deallocation, fast, widely used in drivers, operating systems, games, servers, etc.

C# .NET / Java - higher level language, "managed" language meaning memory management is mostly done for you, C# has syntax that spans multiple paradigms, widely used in business applications, web sites, embedded systems, easy GUI designer tools etc.

were because with learning each of these you'd span a reasonably wide range of languages that have different purposes and you would have a good start at a more well rounded understanding of programming languages..
 
Hmm... I'm a bit stuck on the Codecademy python tutorials. I'm not sure if I'm missing something in plain sight or what...

Instructions
On line 4, fill in the if statement to check if answer is greater than 5.
On line 6, fill in the elif so that the function outputs -1 if answer is less than 5.

Their instructions don't even match the code they give initially! They tell you to change the elif on line 6 when its on line four? Anyway here is my code:
Code:
def greater_less_equal_5(answer):
    if "answer" > 5:
        return 1
    elif "answer" < 5:       
        return -1
    else: 
        return 0
        
print greater_less_equal_5(4)
print greater_less_equal_5(5)
print greater_less_equal_5(6)
Here is my error: "it looks like your function output 1 instead of -1 when answer is 3." What exactly do I have messed up? I don't know where they're getting 3 from...
 
To begin with, you're comparing the string "answer" to a number and not the variable answer.
 
They're giving 3 as a parameter to your function. When someone calls greater_less_equal_5(3) , what should the function return? What does your function return?
 
They're giving 3 as a parameter to your function. When someone calls greater_less_equal_5(3) , what should the function return? What does your function return?

I don't know what greater_less_equal_5(3) does because they said not to worry about because I haven't gotten that far :rolleyes:

I figure I just couldn't get it because I was doing this at 2:30 in the morning... Thanks to eof I've got it. I didn't realize I made answer into a string.
 
Last edited:
I don't know what greater_less_equal_5(3) does because they said not to worry about because I haven't gotten that far :rolleyes:

You are writing a function called greater_less_equal_5. If you do:

greater_less_equal_5(3)

You are passing in the number 3 to the function, and you would expect that it should return -1 (answer parameter in this case would be 3).
 
If you want to learn to write code cross-platform then I'd start with GNU C/C++. Learning the basics will develop good style and will transfer across platforms.

If you want to write Windows GUIs then go MSVC++ (not a C# fan either).

I don't recommend learning MSVC++ and then going backwards to GNU C/C++ because you'll develop a hatred of non-Windows programming.
 
I've gotten myself confused again... The aim here is to convert english to pig latin. Focus on the else statement- I have to remove the first letter from the word, move it to the end and then attach the 'ay' suffix.
Code:
pyg = 'ay'

original = raw_input('Enter a word:')

if len(original) > 0 and original.isalpha():
    word = original.lower()
    first = word[0]
    if first == ["a", "e", "i", "o", "u"]:
        new_word = word + pyg
        print new_word
       
    else:
        slice = word[1:]
        new_word = slice + pyg
        print new_word
else:
    print 'empty'

the print new_word gives me "yanay" when I'm looking for "yanray" (I'm using my name 'ryan' for this test.) I think I'm either doing something wrong with either my slice = word[1:] or new_word = slice + pyg line.

You all have been a tremendous help for me finding my way, I really appreciate it.
 
So, you’re not doing anything “wrong” in either line; however, you are missing a step.

Your line, below, will give you the value of “word” minus its first character:

Code:
slice = word[1:]

But from there you’re not doing anything to get the first character from “word” or to add that character to the end of your initial slice before you add the “ay” on the end.
 
I have a question related to this topic.

I currently know Perl and a little of Ruby. I really like Perl, and probably some of that is because Perl is a "lazy" language that lets me get away with stuff that I probably shouldn't.

However, here is my problem. I am getting to the point that people at work are starting to ask me to develop small programs fro them to process various data sets. I also like that it moves between LInux and Windows very easily. But what I don't like about Perl is that the user has to install the compiler to run it. So this puts a lot of effort on the end user.

I would like to be able to learn a language that I can easily make executables (or rather self contained programs) from. So far the Perl 2 Binary programs I have tried cannot even consistently execute my test scenarios. I know C++ is a powerful language and can easily create OS agnostic executables. But I wouldn't mind being able to stay with the high level languages. I looked at Java, and although most people do have Java Run Time installed on Windows, its not guaranteed on the Linux systems we have here. Python looks to have the capability if you stay in the 2.x version, but again not sure. And it sounds like it still has potential for problems when trying to compile a scripting language as opposed to native compiling language. And C#, I'm not sure if that is Linux compatible.

So is C++ the only (popular) OS agnostic language that can consistently be compiled into executable binaries?
 
However, here is my problem. I am getting to the point that people at work are starting to ask me to develop small programs fro them to process various data sets. I also like that it moves between LInux and Windows very easily. But what I don't like about Perl is that the user has to install the compiler to run it. So this puts a lot of effort on the end user.
So is C++ the only (popular) OS agnostic language that can consistently be compiled into executable binaries?
Between web services, ODBC, text parsing, and so many other OS-agnostic communication methods, there are many possible ways of solving the problem and exposing the derived data to users. So is a native app really the only reliable way to present the data set? Why not a webpage?

In fact, you should start a separate thread on this topic.
 
If developing for Windows I would say .NET and C# are the first choice.

C++ is hardly ever used in a web dev, web service scenario. where I work we probably have C# and some old VB somewhere, but NO C++.

Also ODBC is OLD, OLEDB is pretty much the standard.
 
But I wouldn't mind being able to stay with the high level languages.
C++ can be as high-level as you'd like it to be, really. It's not all about fiddling with the bits. What it does not offer versus Java, however, is a garbage collector (though the standard allows for garbage-collected implementations), so you'll have to manage resources (not necessarily memory) by hand. This is not at all as scary as it seems, as C++ supports custom destructors with which you can clean up and release resources automatically.

Other native languages available are Haskell, D, OCaml and others. D may suit your needs well, being very Java-like, but it doesn't have the development tools that C++ has.
 
Back
Top