I need your honest opinion: what's the best programming language for someone who has no experience with programming to start with? Assume a strong tech foundation ( /g/ level) and a good grip on maths.
>>44825889 Depends on what you want to do and how fast you want to do them. C will teach you the basics of programming but it will be hard and take time. Python is faster to learn and will make you do scripting tasks in no time.
Learn a lower level language later on when you have the basics down.
>>44825889 What you want, OP, is a language that will encourage good coding style and habits. So ideally a strongly typed language with semantically important whitespace that allows you to write in several different paradigms. In other words, Haskell.
>>44825889 Haskell would be one of the closest matches for mathematical reasoning... if you are on an University level with that.
Most people will probably start with Python, Java, C++ or something due to the documentation and huge user base and plenty of courses being offered all over the place.
But let me say with some confidence that you could start with almost any programming language that a decent number of people actually use. It's not like you can't learn it just because you don't have 100 books but only 2 and online docs... the other people did, too.
>>44826174 > semantically important whitespace > good coding style and habits Seems very, very debatable to me.
> strongly typed language I agree with that one. Pretending types don't exist is silly. Might as well have your compiler tell you that it's nonsense to look at a number or color or letter as a boolean value of true or false...
Python is the best language for a beginnner to learn. Here's why
1) High level language, so you don't have to worry about pointers and other low level shit that is not relevant to a beginner.
2) You can create interesting programs very fast
3) Huge standard library which can do pretty much anything you could ever want
4) Very clean and clear syntax, so instead of worrying about the syntax you can just focus on the logic of your code
5) because it is white-space delimited it will give you good coding habits because if you migrate to another language you will be familiar with good indentation and code-readability
6) Python is consistently ranked top 10 within programming popularity, it is especially prevalent in data-science fields and you said in your OP that you're good with math. It's also popular for server side web development, although it is used for all kinds of applications.
>>44826260 >python best language for a beginner >pointers and other low level shit that is not relevant
okay, so clearly this guy has no idea what he is talking about.
if you are serious about programming, you should learn C. learning a super high level language such as python is like handicapping yourself. I see it every fucking day, people just have no idea how to actually program, because they were taught some BS scripting language, such as python, and now can't grasp real programming concepts. real programming concepts, that are always relevant, like pointers.
>tl;dr if you want to join the herd of incompetent handicapped "programmers", learn python. if you actually want to learn how to program, learn C.
>>44826353 Real programming concepts are things like abstraction, typing, algorithms and analyzing runtime, not running through gdb step by step to figure out where your shit failed and caused a segfault.
the worst thing you can do is learn an OOP language first. speaking of handicaps, these languages were literally designed for people who have to make analogies to real world concepts, such as objects in order to understand programming. OOP is for people who can't handle programming. do NOT learn this first, or you will always be trying to relate everything back to objects and other shitty analogies. it is like learning a foreign language by always translating it back into your first language rather than actually learning to think in the new language
>>44826319 Do you enjoy the thought of writing a lot of code that does a seemingly simple task only to spend days debugging it? Because that's what you're going to get with C. It should never be considered a beginner language except under expert supervision. It's a punishing, excessively wordy thing that will leave it as late as possible to tell you when you're doing something stupid, if it does tell you at all. IE the precise opposite of a beginner language.
>>44826291 > The amount of shitty code with unreadable indentation I've seen... Just trying to avoid that possible outcome. Not such a huge problem, in my opinion. Every decent programming editor and IDE can reformat code in the languages it supports for you.
> I also forgot to mention that OP also wants a language that doesn't have a ton of gotchas and segfaults everywhere. So definitely not C. Well, you can compensate with experience, but it is really not the most clever/logically designed language and/or standard library, yep...
This is absolutely incorrect and nitpicked. I said pointers aren't relevant to a BEGINNER and I stand by that statement. Learning programming is very hard by itself, there's nothing stopping anyone from learning about all of that AFTER you've got the basics down. The basics are difficult in and of themselves. If you start with C you will be extremely frusturated and your progress will be slow which will discourage you even further. Since C is compiled it takes much more setup and time to test your code, which means you're not getting instant feedback on what you're doing wrong.
Python is interpreted and even further has applications like Ipython where you can instantly test and debug your code and jump to explanations of what each and every function of every library does. Instant feedback on what you did wrong plus a great debugger, not to mention you'll actually be able to create shit and that's the number one thing that will keep you coding longer.
I strongly feel functional programming is one of the best places to start, especially if you have a knowledge math it should feel fairly natural to you and you will get a very good understanding of control flow and the difference between recursion and iteration. I started with scheme and SICP and I feel I am a stronger programmer for it.
That being said, I think there is something to be said for starting with a low level imperative language like C. It will be very hard, but you will not only learn how to program but also how computers actually work.
If you don't give a shit about the details and want to start programming, a high level general purpose language like python is a good place to start.
The only thing I would recommend against is doing too much object oriented work when you first start out. It's popular and a marketable skill to know, but it will teach you habits. People very commonly apply object oriented programming to problems it is inappropriate for.
>>44826219 I also wouldn't recommend starting with an IDE. I would use a text editor so you don't need to rely on an IDE to tell you how to do things. Your choice though.
You probably already have GCC for your compilers, provided you aren't working in windows.
>>44826460 what the fuck are you talking about with not getting instant feedback? just compile your god damn program and test it, is 15 seconds not instant enough for you? honestly, the real world doesnt operate in a super special debugger that holds your hand and writes your code for you.
clearly, they have already set themselves in a poor way thinking and will always be held back by this. the only people who have such a hard struggle with programming are the people who learned a hand holding, high level OOP language.
>>44826448 am I wrong? what was your first language?
It depends on what you're interested in doing. If you wanna start from a level closer to machine code, do C. High level langs abstracts what you can do in a low level lsng but at the cost of efficiency. If speed matters to you, you certainly need C/C++.Not to say high level langs are entirely slow, memory is accessible these days seeing as phones come with at least 2Gbs.
>>44826461 > People very commonly apply object oriented programming to problems it is inappropriate for. Eh? OOP is suitable for essentially anything.
It's just a method of structuring code into "things" that can be instantiated rather than having it all as functions.
If you wrote all pure functions, OOP would be unnecessary, but if you don't, it gives you at least some degree of modularity and separation of concerns. Might as well group those up that only work together (and not alone), and instantiate them one or more times as needed...
I don't think you understand OOP, by the way. The encapsulation of data and the functions that are allowed to work on it is a beautiful thing, and it tends to be a feature of well written code even outside of traditional OOP languages.
I used nano for yeearrrss (and hardly ever programmed, just used Linux 'casually'). I finally switched to vim when I decided I should learn a fucking language after years of procrastination (I chose C btw).
If you want to start vim, add 'enable syntax' into ~/.vimrc (the configuration file in your home directory on Linux) and just go with it. 'i' for inserting text, ESC for moving the cursor around -- starting vim and programming at the same time has been a pretty enjoyably experience; I figure I'll pick up the daunting tall-order stuff as I advance in learning how to utilize languages/structure.
>>44826597 That's true, all it is is just a way of organizing code. Sometimes it's just more intuitive not having to deal with this layer of abstraction. You can design modular code without it, and the overhead associated with it can be undesirable.
I guess what I mean is that with OOP its possible to take a simple task and make it obscure. I'm pretty sure this philosophy is the whole reason languages like clojure exist.
>>44826606 Vim and emacs are both great, text editors are purely a matter of personal preference.
>>44826763 > You can design modular code without it You can. But why don't you have the compiler guarantee for you that you have the expected things in place, and nothing missing from the specified grouping of code and variables?
People have failed to do that right for decades, which is why OOP happened as an industry-wide doctrine.
> and the overhead associated with it can be undesirable. It depends on how heavyweight your OOP is, and what you do.
In most settings, people don't care about using the heavyweight (in terms of RAM or even processing power) options to OOP anymore. If it saves programmer or sysadmin time, they enable it all. Memory management, fancy VM graphs and accounting, networked reporting to a central location, log files all over the place, and so on...
Moore's conjecture surely did its work there. Programmer & sysadmin wages don't follow it, but hardware did.
>>44827572 >if you start with C, you are going to be able to move to another languages faster and better lel, no
If you want to be able to move on to other languages better and faster, you study comp sci theory, particularly algorithms and programming paradigms. You don't jump into the deep end and learn a shitty expert-level language from the 70s. (BTW I'm not one of those idiots recommending python either.)
>>44825889 Start with C. C# is also an excellent beginner language - but C is a great stepping stone and kind of like a right of passage by anyone who considers themselves a decent coder.
After you do shit in C, feel free to learn other languages - it will be really easy after you learn C
Projects to Try:
* Fizzbuzz [Learn Modulus sign - and how to print words to the screen] * "draw" a curve! - Parabolic, Quadratic, Exponential, Linear - w/o graphics you can tell it to give you points to make a line (like the screen will show "x=1, y=0" and you can plot it on paper to confirm) [Learn about for statements] * Write some functions that do math stuff that you're good at (You could write adding, you could find a determinate of a 2x2 - i don't care) [ Learn how to make functions so the function = the answer] * Read a Header of a well-documented format (Doom WAD is a good one) [ Learn File I/O, Data Structures, and How your system works with binary data and memory] * Write a Basic Encryption where a string encrypts text that's decrypted with a single letter[Learn about Exclusive Or commands as well as sizeof()]
Theres also the occasional - Projects posts that people post on here that are fun to learn and do. For Practice in other langauges - convert your C code to a language of choice!
C is great as a first language because it forces you to learn a bit about how the computer works at the same time (memory layout, what kind of operations are cheap and expensive on the low level, etc.).
If you start with python, you don't get any of that. Everything just werks, and you won't have the same intuition when you start optimising your code.
>>44827077 I'm not saying OOP isn't a safe and reliable approach to coding, there is good reason it's an industry standard. I'm just saying it isn't as perfectly suited to all tasks as people make it out to be.
One example from clojure website: concurrency gets much easier without mutable objects.
Start with an imperative procedural language, like BASIC, then depending on how much commitment you put into learning you may move to C/Assembly. Stay away from Python though, not because it's a bad language, but its syntax is unconventional.
>>44826209 You gotta have brain damage if you can't learn a simple language like C, the most complex thing is the concept of pointer, it's all downhill after you master it.
>All of these people claiming that pointers and memory management are fundamental concepts to programming. Fuck off. Programming is about defining and managing procedures and data. Pointers and crap is just one way of doing that, they aren't actually any more fundamental to computers than classes in Python .
>>44827926 It's not learning the syntax of C that's the issue. It's doing anything more complex than fizzbuzz in it, as someone with little experience, without ending up with an unreadable, unmaintainable buggy mess of shit.
>>44827881 This. I work as a programmer, and it is really obvious after working with someone for a few weeks whether they have been exposed to an unsanboxed/non-vm language with direct memory access (i.e C/C++, but also Lisp and assembly). Those that haven't will generally understand objects in a fairly primitive way, and be bad at reckoning optimization. I've seen programmers like this instantiate new objects on every iteration of a loop to avoid a comparison between primitives, for instance. Someone who has learnt lower level languages is likely to understand the likelihood of those primitives being in the cache, the low cost of comparison operations and the high cost of instantiation.
Simply put, they will understand simple data structures far better (trees, lists etc.) and when and why to use them.
I work in C#, and would recommend it to a beginner, but at some stage, if you want to to gain intuition in to how to write optimized code, both for speed and readability (simple data structures are almost always preferable for both), you will have to learn C or a similar language at some point. Or bore yourself to death learning theory with no practice.
>>44828095 >Someone who has learnt lower level languages is likely to understand the likelihood of those primitives being in the cache, the low cost of comparison operations and the high cost of instantiation. That's true, but you don't actually need to learn everything there is to know about computers on the first day.
Leaning low-level stuff is important, but the very first thing a new programmer needs to know is HOW TO PROGRAM: how to think about breaking down tasks and carefully defining requirements. Python and similar languages make for a good "first language" because they start with just the essentials - how to write programs - and leave details about implementation in the background. Once a program is comfortable with building programs, then they can go off and learn about pointers and memory efficiency and so on.
I think Python is good if you want to learn the theory since it's such an easy language to pick up. You can practice and understand techniques and the conceptual stuff more. Learn the details and intricacies later with C, Java etc.
>>44828237 Of course. I was trying to imply that a beginner should be learning a strong, statically typed language. That way the compiler will bitchslap him with an informative error message if he makes a mistake instead of getting weird runtime behaviour. Thus, good habits will be enforced.
>>44828174 I'm the dude your responding to, and I absolutely agree with you there. That's why I said I would recommend C# to a beginner. Python is also alright (it was one of the first languages I learnt), and would serve a beginner well, but if the intention of OP is to move on to other languages, it has a few pitfalls. Typing is something that I think even beginners should learn ASAP. Loose, dynamic typing, while initially seeming easier, is something that can really confuse beginners at times. Personally, I'm not a fan of dynamic types, and while C# has them (via the dynamic keyword and some of the reflection fuckery), it is far harder to unintentionally cast.
Obviously syntax is a tiny thing in terms of moving between languages once you know how to program, but for a rank amateur who will likely be using it as a stepping stone, chances are when they transition, it will still be an issue.
C# is nice since the syntax for classes looks very close to the other major OOP languages, and LINQ extensions add a lot of what I love about python to it.
OP also mentioned that he wanted to maek gaym as well. It's basically irrelevant to discuss the merits of the two in that regard, since OP will be good enough to move between languages fluidly once he's good enough to make a game of any caliber. That being said, I'd say MonoGame is more mature and widely used than anything python has to offer.
>>44828277 I can sorta see you're point, but I'm not sure it's a big deal. I think most of the appeal of strong-typing is in very large codebases where it's hard for humans to understand the code. I started out programming in Python, and my experience with it has been that it's a very hard language to write buggy code in, at least for one-man sized programs.
>>44828346 >That's why I said I would recommend C# to a beginner. Allright. My opinion on C# is pretty strongly coloured by it's association with MS, so I don't really have an opinion on the language itself.
>but if the intention of OP is to move on to other languages, it has a few pitfalls. Why do you think that? I started out with Python, and while it's still probably my most used language (it's what I get paid for) I haven't experienced and real issues picking up other languages (mainly Java and Rust).
>OP also mentioned that he wanted to maek gaym as well. I missed that. While Python has some pretty good game libraries (PySFML is very nice) packaging Python games to be portable is currently a pretty painful.
>That being said, I'd say MonoGame is more mature and widely used than anything python has to offer. Probably, yeah.
>>44828789 Fair enough. There's a few decent books out there but for a completely free language, there's surprisingly little good beginner's materials out there. It's a great language otherwise imo. So much of it is great for learners.
>>44828955 Ada is a system/embedded/application language. Basically anything you'd want to use C/C++ for, Ada can do better. Why it isn't more commonly used remains a bit of a mystery, aside from it being developed by the US DoD.
>>44829013 I'm not quite in a position to comment since I'm just starting to learn it myself. By all accounts Ada results in much more reliable, less error-prone code. It can also be used to call and be called from C/C++ if I remember right. The main downside is that Ada jobs are a lot more scarce than C/C++ jobs.
All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
This is a 4chan archive - all of the content originated from them. If you need IP information for a Poster - you need to contact them. This website shows only archived content.
If a post contains personal/copyrighted/illegal content you can contact me at email@example.com with that post and thread number and it will be removed as soon as possible.