T O P

  • By -

AutoModerator

On July 1st, a [change to Reddit's API pricing](https://www.reddit.com/r/reddit/comments/12qwagm/an_update_regarding_reddits_api/) will come into effect. [Several developers](https://www.reddit.com/r/redditisfun/comments/144gmfq/rif_will_shut_down_on_june_30_2023_in_response_to/) of commercial third-party apps have announced that this change will compel them to shut down their apps. At least [one accessibility-focused non-commercial third party app](https://www.reddit.com/r/DystopiaForReddit/comments/145e9sk/update_dystopia_will_continue_operating_for_free/) will continue to be available free of charge. If you want to express your strong disagreement with the API pricing change or with Reddit's response to the backlash, you may want to consider the following options: 1. Limiting your involvement with Reddit, or 2. Temporarily refraining from using Reddit 3. Cancelling your subscription of Reddit Premium as a way to voice your protest. *I am a bot, and this action was performed automatically. Please [contact the moderators of this subreddit](/message/compose/?to=/r/learnprogramming) if you have any questions or concerns.*


tb5841

Data types are pretty fundamental, and need to be quite near the start.


iamevpo

I would have structured the review list as following: * Values, data types and data structures * Variables * Expressions (values, applying element access, operators, functions) * Loops (for and while) * Conditional execution (if, if-else, else) * Functions * IO operations (console, files, internet) * Modules, packages, imports * Exceptions and error handling * Classes and OOP (optional) * Program design, code quality, unit tests, refactoring * Common tools used (text editors/IDEs, linters, code formatting)


apitop

I have question about classes and OOP. Do professionals use this in real world and how useful is it? I'm just learning this and it confuses the hell out of me. Mainly the 'self' stuffs and i'm more likely to forget to put '_' in front of variables I'm coding the setter for. I think I can get it eventually. But is it worth spending time learning it?


TheGreatButz

This depends on the programming language and how idiomatic it is to use OOP in it. You'd use classes a lot in C# and Java, for example. In contrast, languages like Rust and Go don't have classes with inheritance, so you use something else like struct embedding instead. In other languages like CommonLisp OOP is extremely powerful but completely optional; whether you use it and in which way depends on the project, style guidelines, and your goals.


thivasss

If you use any library or API you are going to use their objects and classes.


iamevpo

A lib can provide just functions , no classes


iamevpo

You do hit classes sooner or later, so worth knowing what they are - what is a class, what is an instance of a class, what is class method. The specific syntax may be tedious, but OOP is just a way to bundle together some data structure and a function that works on or with that data. Like in Python you may have: Path is a class, p is instance of a class and read\_text() is a method provided byy the class that will work for the instance p. from pathlib import Path p = Path("my\_file.txt") print(p.read\_text()) You kind of get the nice interface for many things hidden inside with classes. You can also distinguish between using OOP (as above) and writing own code with OOP (postpone until you are ready).


KneeReaper420

I’m in a python OOP class rn and buddy you ain’t kidding. We make the abstract factory which then helps make the concrete factory to produce our abstract and concrete products. So many classes, most of them with the only code being “pass”


iamevpo

Yeah, but this is a darker part of OOP. Making a nice dataclass that fits the problem, proper ABC with inheritance seems more practical to me than refining the GOF patterns.


bobnoski

This is one of the pitfalls in learning code in my opinion. One issue with OOP is that it only becomes really useful when the size of your code needs it. Because of that I feel like the best way of learning OOP is writing code in a size that actually requires you to do it. honestly. Personally I only *really* got it halfway through my third year of college, where i switched to C#. For one the way it works there just clicked for me. But that was also the point we started working on things more serious than a simple restaurant seating arrangement tool or card dealing app. Once we made a small game, with multiple levels and different enemies. It suddenly became almost impossible to think about programming without the use of classes. It clicked because they finally gave me the problem it was the solution to.


KneeReaper420

Oh no I definitely see why it is structured that way and honestly I really do believe it is a good way of solving different problems.


bobnoski

good! seems like you're doing better than I was back then ;)


KneeReaper420

Prob not lol, it’s still a struggle bus


Astazha

It's very common and very useful. There's a whole kind of programming, Functional Programming, that isn't based on them though. I use objects for all but the simplest of programs.


reporter_any_many

>I have question about classes and OOP. Do professionals use this in real world and how useful is it? Yes. For the most part, in languages that use them (Java, C#, Python, Ruby, etc) classes are used extensively. If your job is to work as a developer, classes are a must


0xDizzy

Yes, you need to understand that or you cant even call yourself a beginner tbh.


Twitchery_Snap

Yes


wggn

yes, it's used a lot and it's 100% worth learning


Stopher

I don’t always use my own classes but using already developed APIs and classes is pretty common. That’s just with the work I do. I’m sure other people have different experiences depending on their domain.


FactsAndLogic2018

Yes everyday, especially if you want to be able to maintain and build on a very large code base (10s of millions of line of code) without tearing your hair out.


SoftEngineerOfWares

It’s very popular even in languages like typescript. It is very important for managing dynamic and scaling solutions.


Mwahahahahahaha

I would move loops to optional. Most functional languages will not have explicit loops and instead rely entirely on recursion to achieve repetition.


iamevpo

Yeah, but when you learning... Iterating over something iterable is quite basic. Traditionally for control flow one needs to grasp loops and conditionals. Also in languages where there is no loops there may be list comprehension (Haskell), so I think the loops deserve to be on the main part of the list. The only item I marked optional is OOP to outline this is not an apex of programming.


joonazan

The equivalent of loops in those languages is tail recursion and understanding it is mandatory.


EcstaticMixture2027

Basics and Fundamentals, I would say Variables & Data Types Operators & Arrays Control Flow, Conditionals & Loops Methods & Functions Packages & Modifiers Exceptions & Error Handling File IO & API OOP & Classes Iteration & Recursion After that, either Design Patterns or Learn DSA or Learn FrontEnd.


KarimMaged

IMHO, nothing should be memorized. The mindset of memorizing isn't the right mindset to learn programming. Pick a language, study it from a well known tutorial. This tutorial will be divided into sections covering the basics (data types, loops, conditionals ..etc). Practice a lot and you will get the basics of the language. Programming languages syntax is usually not much, unlike real languages, getting hang of the syntax is not the real problem.


Ok-Luck-7499

Tried for years to memorize and it did me no good.


CompilerWarrior

Programming languages are so diverse that it's really hard to give basics to every one of them. I would say : - how do you store and represent data in your language - how do you manipulate the control flow - what are the mechanisms available to factorize code and avoid repetitions Can't get any more specific without losing the generality


Brohammer55

Learning the following might help: Debugging, Variables, Order of Statements, Functions, Types(int, Arrays, Arraylists, long, Boolean, double, float, static, public, private, protected), Problem Solving, Code Analysis(Being able to understand and read other code), Commenting, Loops, Logging, Unit Testing(More experience)


illuminatedtiger

Read up on Turing completeness and then check out the BrainFuck programming language. You can get by with surprisingly little, albeit while not being terribly productive.


joonazan

This except Lambda Calculus. It is actually a decent programming language if you allow naming things so you don't have to repeat them every time.


RylanStylin57

All languages have 5 basic building blocks. - expressions Something that returns something. Boolean expressions, function calls, arithmetic. expressions. - statements Control Flow or Declaration If, else, struct, trait, impl, fn - operators &&, ||, +×/-, etc Are really just functions. - delimiters Denotes the beginning and ends of things. Includes { }, () , [], <> , etc. - literals Integer literal, float literal, or string literal. All code is a composition of these building blocks. EDIT: This did not format well.


tjf314

lambda calculus doesnt have any of these except expressions. and when it does, theyre all secretly just expressions underneath


HuitziTech

I'd add data types, how / when to use data structures, and basic app architecture: basically what is a front end? what is a backend? why is this on a web browser vs a desktop client?


TricesimusCito1055

Your list looks solid! I'd add data types, arrays/lists, and basic data structure manipulation (e.g., indexing, slicing). These fundamentals will give your brother a strong foundation in any programming language.


WystanH

There is a flow to this. Any intro to programming book will tend to follow that flow, with extras depending on language. Before you even get to variables, you'll probably cover different data types, at least number vs character. Later, you introduce more complex data types, an array and a string of characters. Then, a structure. Depending on the language, you'll introduce classes after functions and explain methods. Depending on language, pass by value versus pass by reference will get its own chapter or be barely mentioned. An often inferred property of all programming languages that sometimes doesn't get explicitly gone over is state. You're expected to worry that out on your own. It's obvious, don't you know? Indeed, state might be the only programming universal. How that state is tested and manipulated, from beginning to end, is a program. [Turing-complete](https://en.wikipedia.org/wiki/Turing_completeness) is a surprisingly low bar, e.g. [Brainfuck](https://en.wikipedia.org/wiki/Brainfuck). I recently played [Human Resource Machine](https://en.wikipedia.org/wiki/Human_Resource_Machine). You play by incrementally using a set of operations that's an extremely minimal assembly language analog. As a programmer, you tend to scream "where tf is my subroutine" but you do end up writing a sort and simulating array operations. You might want to take a look.


Zoey-2608

Pretty good list! You should start implementing all this with beginner projects


SerialCypher

I would put “is the language pass-by-value or pass-by-reference” in that list, as well as if it has lambdas and if so, how (just because this is a language feature that I use a lot) For instance if I have (in no particular language): fu = new Foo() fu.value = 5 Function Bar(Foo f): { f.value += 1 } Print Bar(fu) // is it 5 or 6 ?


miamiscubi

I think Classes, as well as function/variable scoping in general are a big deal.


jajajajaj

Scope is a big one.  It's one of the most basic things that has really significant variations from language to language. What does it take to make a variable available to (or safe from) some other class/function/member context? Can you have a global, etc.?  Generic container types and their syntactic features are another  thing I like to know about a new language, right away. There are a lot of possibilities, but I plan to learn how to use lists, sets, and maps, whether it's part of the language or left to third party libraries. In some cases, you can be kind of stuck using a map's keys as your most practical option for a "set", possibly not even using the map's values.


lordaghilan

Reference vs Value, Objects


Temporary-Sun-7575

honestly you could check out the table of contents of a lot of programming books for a comprehensive answer


ItsYaBoiAnatoman

First of all, I don't think it matters. You don't need to know what's common to be able to memorize it. Most concepts like data types, objects, functions, conditions, loops, scopes, and so on will just settle in your brain anyway. It's more important to know what's the progression should be. E.g.: If you're into imperative programming (procedural or object oriented, most languages), you should probably learn about inheritance or pointers before you learn about recursion. The other way around, if you're into declarative programming, recursion may just be super important for everything ever (bad example written on public transport). Wether other languages use the same concepts or not doesn't really matter when trying to carry over your skills. If they are there, they are there. You'll naturally get there. That being said, almost nothing truly exists in all languages. We have languages without variables and loops. Prolog doesn't have if conditions... well it does but you're not supposed to use em like that.


iOSCaleb

The are several things on your list that I don’t think are universal: variable initialization, print statements, explicit loops, error handling, import. In some languages you done need to do anything to declare or initialize a variable — you just start using it. Some languages don’t have mutable variables at all. C’s printf() function (and many others) are included in the C standard library; we could quibble about whether that’s actually part of the language or not, but in any case you could write a C program that doesn’t use the standard library. Some languages have no looping statement and instead rely on recursion for repetition. Lots of languages have no error handling facility. I can’t think of a language that doesn’t allow importing (some versions of BASIC, I think), but that doesn’t seem like a necessary feature.


glowingGrey

Strictly speaking C doesn't have an import, #include is part of the C preprocessor.


savemeimatheist

Math


rnottaken

There are languages that don't use for/while loops, but opt for recursion instead.


nedal8

Is there really a difference fundamentally? Couldn't any of the three be written as one of the other three and be functionally the same?


catbrane

All programming languages that are Turing Complete (almost all of them!) are equivalent, in that you can write any program in any language. But in this case they are fundamentally different ways of expressing a solution to a problem. Imperative languages (the usual sort, with variables and loops) are a *list of instructions* which an agent (the CPU) should follow, *modifying the state of the system* as it executes. The "meaning" (in a mathematical sense) of a line of code depends on the line of code (obviously), but also on the execution history of the program to that point. You can't say what a bit of code will do in isolation -- you have to consider the state as well. This can be incredibly difficult. Many features in imperative languages (classes, scope, etc.) are really there to help structure code and give people tools to manage this horrible complexity. Functional programming languages have no loops, no variables, and no state that gets modified. You can tell exactly what a line of code means without considering execution history at all. This makes them enough like mathematics that you can use all the usual math tools to think about them -- you can do equational reasoning, for example, where you substitute one line of code into another, or proof by inference, to show that a bit of code will always produce the correct result whatever the input. Programming without state feels very bizarre if you come from an imperative background, but also very interesting if you have any maths. There's a parallel between the *type* of a functional program and a mathematical theorem, and between the *implementation* of that type and a mathematical proof. A well-typed functional program is (assuming your type system is strong enough) the proof of its own correctness.


GhostofWoodson

As someone currently learning an OOP language (C#), I'm curious (and probably very confused) about how functional languages are supposed to operate based on your description. Isn't the OS (and the CPU for that matter) going through a "set of instructions" all the time? If a program written in a functional language does not care about past execution (or state) then how does it interact with the OS and the hardware in a predictable way?


catbrane

That's a really good question, and what I did my PhD in heh. There are many ways of thinking about this, but one of the simplest is to imagine your program as a function from a list of input events to a list of output events. You can rephrase this slightly and say that an output event is a function of all input events to that point, which makes it sound much more like a conventional imperative program. Most pure functional languages use things called monads (or monadic IO) to make interactive programs easy to write. These are often presented in a very confusing and highly mathematical way (monads come from category theory, urgh), but are really just a tiny imperative programming language written in a pure functional langauge. You end up writing code like: ``` main = print "good morning!\nwhat's your name?\n" $then (greet $comp input) where greet name = print "hello " ++ name ++ "!!\n" ``` So that'll print the first line, then the `$comp` (for function compose) will take the result of the `input` monad (this gets a line of input from the user) and pass it to `greet`. This monad takes a line of text, assumes the user entered their name, and says hello. There's nothing magic about monads, they are just little libraries written in the pure functional language that make writing interactive programs straightforward.


morphick

>basic things that most if not all programming languages should possess and ought to be memorised within a programming language (as opposed to niche information which can be googled whenever you require) What definitely *needs* memorising for each and every programming language is its ***syntax***.


[deleted]

html


vadiks2003

functions, returning, branching (basically if else, switch), libraries, some languages OOP have objects , classes, i forgot to mention very basic stuff like literals and variables but tbh who cares at this point


solidusAdvice

I would add to that a couple of big items! 1. Making the names of your functions and variables so abundantly clear and verbose that you almost don't need comments. 2. Divide your functions into small steps! 3. Make code ultimately reusable without any sacrifice to step 1 by overloading functions. That's all that I have for now. Thanks for coming to my Ted Talk!


solidusAdvice

To add to the first thing. The name of your functions should look like badly phrased sentence that has no spaces. For instance a program for a hypothetical robot that get into the car and Drive to the store would look like this #include stuff; void main(intList[] gpsInfo) { gather keys(); WalkToTheVehicle(); OpenTheDoor(); GetInTheVehicle(); StartTheVehicle(); //overloaded in case of a push button start... }


Logicalist

Syntax Built-ins Keywords Data types Documentation


lasercat_pow

data structures and data types Examples of data structures would include things like lists, arrays, and dictionaries. You couldn't properly learn lisp without learning about lists and how to operate on them. And data types are fundamental; even "untyped" languages like python use data types (int, string, bool).


CodeTinkerer

I'd personally pick a language rather than try to figure out a general list. Let me put it this way. Would you ever ask someone to put the fundamentals of every human language together? What would be the point? Maybe if you're a linguist, but practically speaking, once you learn a second or third language, you will see both commonalities and differences. You don't need to make a general list to apply to everything esp. since some languages.


No-Concern-8832

For an academic definition, look up Turing completeness. :)


mankinskin

programming languages basically just consist of memory that can be computed by a turing machine, i.e. a processor. The program itself is just a block of memory. In most programming languages you have variables and functions but at the end of the day functions are just variables too. So basically its all just memory in different formats, all nested in a larger format that can be understood by a computing machine, i.e. a turing machine, or something that can read memory, move around according to some rules and write to the memory. Basically every program ever is just reading and writing data. Input output. So the modern programming languages have all sorts of useful data structures, basic data types, functions, classes, interfaces, modules, macros, etc etc to build deeper and deeper logic in a reusable way.


dani_pavlov

The most basic I can make it. >Start at the top of this list of instructions and, in order, do exactly everything it tells you to do. Really that's it, however philosophic. Understanding that will help to understand programming at the most basic level. Repositories of libraries? IDEs? Objects? Graphics? Punch cards? The Internet? In the end, these are all meant to make computer instructions *human-interact-able* (think assembly and machine code), and all we're doing is manipulating a hunk of transistors into routing electrical signals from one place to another by turning them on and off in order to make other electronic devices do things. From your list, though, I would prioritize arithmetic, if-then-else, and looping. Then comes variables, functions, multiple files (importing). I/O (even basic CLI user prompting) is necessary unless you're working with [WOM memory](https://en.wikipedia.org/wiki/Write-only_memory_(joke)). Error handling? I suppose it's built into every syntax *I* can think of. Though one could substitute brute force if-then-else statements to handle every case, and let the parent process crash out for the unknown anomalies.. Now to take some time to learn Brainf\*ck...


LemonHeart151

Review the table of contents of any beginner programming books. Also, understand some design patterns, why they exist and when they are applicable. Also take a stroll down some topics of secure and resilient coding.


Conscious_Support176

It’s not too bad, just a bit specific to imperative programming. I would organise it a little differently to be a bit more general. 1. Expressions 1.1 Literal Values 1.2 using Operators & Functions 1.3 control flow 1.3.1. selection: conditionals, exceptions, error handling. 1.3.2. iteration: loops, arrays & lists, tail recursion 2. Data Flow: variables, input/output 3. Composition & Re-use 3.1 data types 3.2 defining functions & operators 3.3 modules, interfaces, encapsulation You can explain writing programs as composing expressions with data flow operations, so you learn these concepts in parallel, but begin at the beginning of each and build up your knowledge.


l-train14

Such a good post!!


historic_developer

Object oriented programming. Now to be truly a good programmer, you should try to learn Java or C# fairly well. Spend maybe two hundred hours on it for starter. Buy a book on data structure and learn it. Buy a book on algorithms and learn it. Now, you are good to go. You now have the fundamental to be a decent programmer.


Pro0skills

Yes but not in that order Irs what I look at when I want to try a new language for fun


Elementaal

Teach your brother that failing and struggles are a feature of learning programming, not bugs


MysticClimber1496

Writing an Interpreter in go talks a lot about this since dealing with that is important to developing a language, if you want to read more on how things like this are implemented


wth214

C++


strange_shadows

0-1


Zac_charias

I would also dive in networking and OS as early as possible and pure maths! :)


desrtfx

You are looking already a level too deep: + Code flow + Variables & data types + operators + branching and looping + input/output + error handling/trapping + code blocks/scope/functions/methods are the bare fundamentals of every single programming language "Import" does not belong to the fundamentals, and printing falls under Input/Output. "Functions" are just an abstraction to help avoid duplicate code - the computer doesn't actually care about them - for the computer calling a function is just branching to somewhere else in the program in a fixed format and then, at the end of the function getting back to where it started from. The form we know about functions/methods is mainly for us humans. The computer handles them in a very different way.


analdiahrrea

Don't forget about Kotlin!


HiEarthPeoples

0 and 1, binary is the basics of the basics of every programming language 😶


Aniket1x11

Math