Jump to content

Advice required!! Python or C# or C?


Nivee~

Recommended Posts

So, I have decided to master a programming language. However, I can't decide: Python or C# or C... Which is the hot commodity in the market? There are lots of programming genii here, so I will be glad if someone helps me out on this one...

Link to comment
Share on other sites

c teaches good fundamentals, so its a good first language. python is good if you are going into any scientific field. c# is ok, but id rather use c++. if you are going into programming, then learning as many programming languages as you can will help a lot. 

Edited by Nuke
Link to comment
Share on other sites

For fun or to improve your job prospectives? It's always good to know multiple languages. It shields you better from automatically picking one solution, so consider that as well.

If your interest is purely academic there's no better language than C. Nothing will teach you better how computers are programmed and how they work. The downside is that it's impossible to program in C without it getting very technical, you're constantly dealing with memory, pointer arithmetic and what not. If you like tinkering, that's a fun challenge. If you only want results, it can be frustrating.

If your interest is "I have a couple of real world problems that I want to fix myself" or "I'm looking to automate small parts of my job," Python should probably be your first choice (disclosure: I am a Python programmer. But I'm also trying to be unbiased here...). Python is very easy to learn and remarkably productive; if your goal is "I receive a text file every day and need to turn it into a formatted Excel file," Python is your friend as you'll have that coded in a matter of hours. It's also great as a first language as you can focus on programming concepts like branching and looping without having to struggle to make that work on a machine. Personally I think that learning Python first will pay off learning C because you'll pick up things a lot quicker in C after that. Finally, don't underestimate Python's performance; 3/4 of the internet runs on Python these days (Facebook, Youtube, Instagram, Dropbox, to name but a few). For job searchng though, keep in mind that "Python" itself is pretty useless; you need to demonstrate skills in a certain field like web development (Django), data science (numpy and Pandas), and so on.

C# is a great language but I'd only pick it if you're interested in a specific domain that C# is suitable for - generic applications in Windows, KSP mods (of course), etc. From a job market perspective you're probably better off with Java, that despite all the bashing is still the 800-pound gorilla in the job market. The two languages have a lot of shared concepts and switching between the two shouldn't be too hard.

As @Nuke pointed out, learning multiple languages is very useful. It gives you a better perspective, and helps to think outside the box when confronted with a problem. Many books on general programming use examples written in C, Java or C++ so it doesn't hurt to at least be able to read those (and reading code is usually harder than writing it).

My personal advice: start with Python, you'll get quick results. Even if you stick with Python, at least work your way through Kernighan & Ritchie's The C Programming Language; it's a classic, and it will give you a much better feel for how computers operate which is never a waste. From a job market perspective, learn Java, or specialize in some kind of Python framework like Django or Pandas. In all cases, showcase your work through projects on Github; it's easier to convince prospective employers of your skill with actual projects you finished.

Finally if you're in an office job right now and want "just some programming skills to improve my position," seriously consider Visual Basic for Applications if you're in a Microsoft Office environment. Don't start with it (I still recommend the Python/C trajectory for that). It's outdated and ugly, and I feel like I need to wash my hand every time I've touched code in it. But it tends to work in the most restrictive environments, runs on a platform that is nearly always available (at least in corporate office environments) and it can catapult your position from a mere desk-jock to a nearly untouchable status (I work in an industry that has laid off or off-shored 75% of its workforce, and through half a dozen reorganizations I've never felt insecure about my job position). It doesn't get a lot of respect inside the programming world, and the ROI is low (VB is easy to learn, but mastering the object models of the various platforms like Excel and Access takes effort and is key to your skill set) if you pursue a job as a coder, but high if you're a business analyst who wants to advance their skills.

Link to comment
Share on other sites

Full disclosure, I'm not a programmer. I do, however do some programming for my work related suff.

The very first program I wrote that had an intended use, other than being purely academic, was written in C#, about eight years ago. The little thing is still used today at my work. It's a tiny, but marvelous time saver program that does some brute force combinatorial calculations. Incidently, it is also the last program I wrote in C#.

Nowdays, all my programming is in C/C++ since it all ends up in embeded microcontrollers.

Point being, the choice of language depends on intended use.

Edited by Shpaget
Link to comment
Share on other sites

Like others have said, for learning how to program C is a very good language. I only am a bit more optimistic for the productivity with C than with Python once you got the hang of it and use libraries. The step towards C++ is still difficult afterwards, but whatever you do, you will always need the basics of dealing with memory, pointers and basic data structures. The graphics APIs OpenGL and Vulkan are C APIs.

For me as hobbyist, if i had to start again, the question would rather be C/C++ or Java.

My choice fell on C/C++ 1,5 years ago because there are so many examples and so much free documentation and really good books. K&R as mentioned may be a bit outdated (C has evolved much since the 80s). The learning curve is steep, don't expect quick results if you're an autodidact. At least, C is not a mistake to start with as you will learn discipline and in the same time dirty tricks. Somebody wrote, it is punk rock. But at the same time is catching up towards the top again these days in the Tiobe index.

C++, if you manage it, together with the STL and standard library, is extremely productive.

May i ask, what is your plan ?

Edit: i must add, i am a "linuxer". Whole development environment and complete documentation comes for free. I did not touch Windows any more since Windows 7.

Edited by Green Baron
Link to comment
Share on other sites

As mentioned so many times before; it depends on what you want to use it for. My personal choice was Python and I do think - similarly to what @Kerbart said - it made me understand C code (for Arduino work at school) a lot faster than if I didn't learn Python first.

I personally program very little of actual use, and that which I do is mostly just math - estimating Pi by simulating this, generating factorials, prime numbers or the fibonacci series - or writing some programs intended as jokes.
Python is a lot faster to write than C or similar languages and this is reflected in the way I use it - quickly making a program for some very specific (mathematical) thing. It is slower than C if I understood correclty, but still hundreds of thousands of times faster than doing the calculations by hand.

Link to comment
Share on other sites

The first thing you should ask yourself is: "What would be most useful at work?"

If you're working, that is. And if it's not, it's still a good question to ask.

For me, while being more fluent in C or FORTRAN would be super swell, most of the real coding I do revolves around automating Excel tasks - the real tools we use are made by someone else. So VBA it is.

Link to comment
Share on other sites

6 hours ago, Green Baron said:

May i ask, what is your plan ?

 

11 hours ago, Kerbart said:

For fun or to improve your job prospectives?

Well, I want to get in software development. I am pretty serious about it. A programming language that lets me stand out in the job market, while still being flexible enough to have fun with, will be the best pick for me. 

What's the learning curve of common programming languages? Like C,C++,C#,Python,Lua...

Link to comment
Share on other sites

Student of computer science here.

I'd advocate C over Python, at least for your first language (you can learn Python later if you want to, of course). The reason I say this is that C, while not nearly as practical as Python for scripting, will actually teach you something about how computers work. Python is so complex and heavily abstracted that it's worthless as a tool for learning about computers. C, on the other hand, is a lot closer to the metal, and it's impossible to learn the language in any serious capacity without learning something about how computers work. Plus, since C is much simpler it's a lot easier to learn most of the language spec. Compare this to Python, which is so sprawling that I doubt that even the language's maintainers know the whole spec.

11 minutes ago, Nivee~ said:

Well, I want to get in software development. I am pretty serious about it. A programming language that lets me stand out in the job market, while still being flexible enough to have fun with, will be the best pick for me.

There are lots of languages that companies are looking for; it really depends on what sort of software development you want to do. The only thing to do is to learn a bunch of them, figure out which ones you like and which ones you don't, and get really good at the ones you like. Getting a degree in computer science also helps; there's a lot more to writing software than just knowing a pile of programming languages.

 

Link to comment
Share on other sites

If you want to know how computers work, assembly is unmatched.  It'll drive you insane, but you'll know exactly what's going on in the computer.

If you want to learn how to program a computer, language isn't that big a deal.  You can write a program in most languages.  Some certain specific tasks might be easier or make more sense in one language than another, but it can be done in almost anything.

Instead, the key is to learn how to look at a problem, break it down into steps, logically work through it, and compare different solutions.  Once you understand why this sorting algorithm is better than that one, the syntax of implementing it is less important.  Start learning how to do that, and then transfer your ideas into code, using whatever language you choose.

 

If you want to get a marketable skill you can write on a resume, choice of language becomes more important.

Edited by razark
Link to comment
Share on other sites

10 hours ago, Nivee~ said:

Well, I want to get in software development. I am pretty serious about it. A programming language that lets me stand out in the job market, while still being flexible enough to have fun with, will be the best pick for me. 

Consider Javascript. It's essentially impossible to migrate away from for infrastructural reasons, so tons of companies are stuck using it (including all the big ones of which you've heard). Many are even using it outside the browser context thanks to NodeJS. It's not my personal favorite language, but it has probably the lowest barriers to entry for beginners, since you don't need any special tools to run a Javascript program other than your browser.

Another candidate to take seriously is Objective C, for writing iOS apps. It's kind of a strange cousin of C++. If you have an idea for a smartphone app, Objective C could serve you well.

Quote

What's the learning curve of common programming languages? Like C,C++,C#,Python,Lua...

C is good to learn, but I can't shake the feeling that there's something better for starting out nowadays. Maybe Go?

C++ is the hardest to master. The most features and interactions between features, often implemented with quirks and gotchas to support legacy code. C++ conferences are full of presentations about how to do things that other languages take for granted (but with "zero overhead"). And bugs in C++ code can be difficult to fix.

However, once you learn C++, you'll feel comfortable in C#/Vala, Java, etc. They all follow the same basic paradigm of procedural object orientation, where code is organized into functions which are organized into classes, which relate to and build upon one another. Most large projects use this approach because it provides good tools for organizing code and breaking down big complex tasks into smaller ones. (E.g., KSP, (nearly) all KSP mods, and CKAN are written in C# and are organized into lots of classes.)

Python and Lua are a bit easier. They also use classes, but their syntax and runtimes tend to be friendlier and more complete, so you don't have to do quite as much work to accomplish simple things.

It's healthy to mix in other kinds of languages once in a while. Haskell is quite different from all of the above, usually in good ways, and it can force you to write better code. Once you get used to Haskell, you'll start to notice things you can improve while working in other languages based on that experience (it makes you feel guilty for using side effects).

Finally, a quick plug for Perl and Bash, which have both served me quite well over the years. They're "close to Unix" the way C is "close to the hardware", so if you need to manipulate files or strings on a server somewhere, it's invaluable to be able to whip up a quick Perl or Bash script.

Edited by HebaruSan
Link to comment
Share on other sites

4 hours ago, Nivee~ said:

What's the learning curve of common programming languages? Like C,C++,C#,Python,Lua...

That is a personal thing and depends on your time and abilities. Lua is a scripting language on its own but also meant to be included in your C/C++ projects.

But the path to programming is long and many do this, most of them with an actual degree at the end. Expect competition. If you have a plan on what to actually program that'll make things easier for you once you are through with the basics.

If you are eager and doing this on your own just start. Set up a linux pc and get going. Nice thing is you get everything for free, the most actual compiler, editors en masse, linker, assembler, libraries, documentation and a huge helpful community. All the scripting languages you mentioned and many more come for free as well. Python in different versions, Lua, Perl, with a finger snip (like "sudo apt-get install python3.7"). Even C# is available and Go too. If you're tired of an editor or ide, get another.

Install the languages you want (that'll be "sudo apt-get install gcc g++" for C and C++) and off you gp.

That said, the learning curve of C may be among the lowest as it does not overwhelm you at the start with objects, inheritance, polymorphism, template programming, prefabricated data structures like stack, queue, sets, maps, lists and whatnot that a beginner has no idea of how to use them. A simple C program has a header, a main routine and several functions to call. Can be mastered and understood in a shorter time, i think, and automatically opens the path to higher things. Whole operating systems are written in C.

Just start :-) 

Edited by Green Baron
Link to comment
Share on other sites

Something interesting you might keep in mind for later is the fact that Lua and C get along very nicely. If you want to learn a low-level (adjust the scale above assembly :sticktongue:) language and a high-level one for their respective benefits, this might be a good pair to consider.

As to learning curves: There's a certain initial investment you have to put forth: overall syntax, flow control, memory management or types or what-have-you depending on the features left up to you and the features abstracted away, but once you have a grasp of the way the language is written you can just look at the docs to find specifics for whatever you need. The main thing is to get a solid foothold on the language, and then grow at the pace of the problems you want to solve. Overall, it doesn't much matter what language you learn first, so long as you learn it. Your second language will be much easier—you may even be able to learn it by analogy with your first one ("oh, so that's how they index their arrays").

Speaking of which: If you're looking for problems to solve, I recommend Project Euler. It's effectively an aggregate of progressively more maddening math problems, ranging from the trivial to the incomprehensible, written in a way which strongly encourages you to solve them computationally.

Link to comment
Share on other sites

Woah! Thanks!! Those are lots of opinions, but I think I have a solid idea now as to how I should proceed!

Thanks!

3 hours ago, Green Baron said:

Just start :-) 

That's what exactly one of my friends said a couple hours ago! :D

Link to comment
Share on other sites

Fitting to the initial question of Nivee I'm now wondering whether getting into this industry is a good decision or - conversely - it makes sense to pick up programming merely as a hobby.
I feel like programming is "overhyped"/underestimated in its complexity by the public. It's not easy - it's a pain in the bottom, especially if you just began this trip to hell and insanity.

So does it even make sense to pursue a professional career?

Link to comment
Share on other sites

Hobby and job aren't necessarily converse. At that early stage nobody can say if it makes sense. But one should encourage people who try to do something new. Maybe it works out, maybe not. I know a guy who did an ATPL at the age of 40 and got employed. I studied prehistory at ~ the same age and could have done something had i wanted to. It always makes sense to pursue something not totally impossible.

I programmed one or two (hobby) things around 25-30 years ago (C) and just a short time ago (1,5 years) got back to it. Because of what i did in between i had forgotten everything. Including what a stack is for example. I also wasted much time running in the wrong directions. I am now doing a naive renderer for myself, and many examples i see in the open source community are far better than what i will ever accomplish in this life. Yet i don't think it is a pain in wherever, it can be fun and rewarding, and as frustrating as any complex waste of time can be.

There will be these std::chrono::moments when you can just std::throw that bloody machine out of the GlfwWindow->getWindow(). A reason to take a break;, think it over, try and get help and then continue;.

Link to comment
Share on other sites

1 hour ago, Delay said:

Fitting to the initial question of Nivee I'm now wondering whether getting into this industry is a good decision or - conversely - it makes sense to pick up programming merely as a hobby.
I feel like programming is "overhyped"/underestimated in its complexity by the public. It's not easy - it's a pain in the bottom, especially if you just began this trip to hell and insanity.

So does it even make sense to pursue a professional career?

Well, the pay is good and the job prospects are better. So long as you enjoy programming for its own sake I'd say it's a good idea. It's the latter point that matters - you can put up with how hard the work is if you like doing it. If you don't, a job in software is quickly going to turn miserable.

So, as @Green Baron said, the best thing to do is to try it. If you like it, try it some more. It might lead somewhere.

Link to comment
Share on other sites

4 hours ago, Delay said:

I feel like programming is "overhyped"/underestimated in its complexity by the public. It's not easy - it's a pain in the bottom, especially if you just began this trip to hell and insanity.

Some would say that's part of its charm. To put so much effort into a thing, and then watching as the computer comes to life and solves your problem… it's pretty good fun. And then, of course, something breaks and it's back to the debugger, but that just means you have more problems to overcome.

Link to comment
Share on other sites

3 minutes ago, 0111narwhalz said:

Some would say that's part of its charm. To put so much effort into a thing, and then watching as the computer comes to life and solves your problem…

Sure, it's what I like about programming as well. Seeing the computer execute your own code is pretty satisfying.

That's why I preceded it with something: The fact that I think programming is underestimated/played down as "You write some stuff and the computer does it".
It's a lot more complicated than it looks.

Link to comment
Share on other sites

9 minutes ago, Delay said:

That's why I preceded it with something: The fact that I think programming is underestimated/played down as "You write some stuff and the computer does it".
It's a lot more complicated than it looks.

Oh, no, that's exactly what happens. The fun is in writing the right thing, so that what the computer does is what you mean for it to do.

Link to comment
Share on other sites

Ultimately the language doesn't matter as much as being able to get things done, so learn whatever is easiest and most accessible first. It's developing the thought processes and mindset for programming that leads to good code (and good job prospects). Doing _anything_ and learning how things work is more important than mastering any specific language when starting out of the gate.

Link to comment
Share on other sites

@Green BaronWell, almost :D! But I picked up a C  book and started doing stuff anyways! I am at arrays already, pointers look scary though...

Spoiler

Its like a snakey  feeling...like pointers are slytherins or something...

Also, i had to look up google to know what Segfault is.. :D

 

Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...