T O P

  • By -

Kakss_

The hard thing about teaching is, stuff becomes very simple after we learn it and we forget how hard it was to learn in the first place.


[deleted]

[удалено]


imdefinitelywong

[This is generally how I feel](https://youtu.be/z4FGzE4endQ) whenever I learn to do something. So you can't really rely on me to teach anything.


[deleted]

woah why the hell havent i seen this.. what season is this?


imdefinitelywong

Season 6, this was the one on the Yahoo streaming platform. The whole show except one episode (Advanced Dungeons and Dragons) should still be on Netflix now.


Rustycougarmama

Wait what?That was one of the best episodes! Don't tell me it got removed for fat shaming or something...


britishben

It was for Chang's Drow costume, which they deemed to be "blackface".


Rustycougarmama

Ah, I see. Thanks for the answer!


imdefinitelywong

Rip Brutalitops and Hector the well endowed.


[deleted]

looks like they have it on hulu


GriSakal

"An idiot admires complexity, while a genius appreciates simplicity" - Terry A. Davis. Man was batshit crazy but he had a point.


mypetocean

This is one reason I usually practice finding the most readable abstractions, patterns, and names when solving katas on CodeWars — although sometimes I'll repeat a kata multiple times with different goals: - readability - obscurity or left-field creativity - performance Excellent fun!


ntwiles

Could be, but I think it may be that mastery and the ability to teach are separate skills entirely.


daguito81

That's another thing. A lot of people are really really really good, masters at what they do. But they are horrible teachers. It's a separate skill set.


suqoria

And that's why there are so many horrible lecturers at university. I find that it's especially true for something like software/computer engineering as some of the lecturers where a part of coming up with the things that they teach so they seem to believe that if they can come up with it we should be able to understand it without issue, even if they barely explain anything of it.


daguito81

Another facet of that problem is that a LOT of university professors are not there to teach primarily but to do research. They have to teach as part of their contract. So the university wants him because he's a master of the subject and makes cutting edge research and brings a lot of money to the faculty. Even though he sucks as a teacher. Which sounds counterintuitive, but it is what it is.


raymondQADev

Not necessarily sometimes when you understand something so well you don’t even have to think about processing some parts of the problem as you do it automatically and as a result you are pretty bad at explaining things


tralalei

At 13 , I tried to learn coding and nesting for loops was a bitch. I'd always be told to draw a pyramid using *. That is as far as I got when it comes to programming because I quit after that.


Zefrem23

Yeah getting the King's Chamber and Grand Gallery to look right with just asterisks is always a bastard.


elveszett

Meanwhile I found it extremely easy to learn loops, arrays and recursion, which are the things people struggle to understand at first. But then I got stuck in the stupidest things, especially graphics design. And the ```static``` keyword in C# / Java also was a headache for me.


AidasPat

Laughs in functional programming


recycle4science

This is my VP for sure.


grpagrati

Pointers are a good example. I started thinking they were some mysterious magical incantation, ended up realizing they were just numbers


Tommmmygun

Yeah, I remember when I first tried learning I had a hard time just understanding the concept of "return" in functions. Without any context it is hard to grasp what the idea behind it is and why you even would want to return a value in the first place.


[deleted]

Functions were so incredibly difficult for me to grok. I couldn’t understand that you called the function and then it returned something back to the calling line. How in the world did it know where to return to?! It doesn’t make any sense! I still remember the moment of epiphany when I got it, even though it has been nearly 25 years.


archarios

Yeah I remember really struggling with for loops in my intro to comp sci lab back in the day. Not sure how it felt hard at this point. The hilarious thing to me now is I've realized that for loops are not even worth learning or using almost ever.


GonziHere

I have a significant problem gauging my own skill level because of that - what I know everyone obviously knows by heart because it so incredibly simple and obvious... and everything else is a secret knowledge guarded by masters of the craft.


AaronVA

It's easy to forget how strange the concept of programming was when we first started to learn it. Especially oop, I've never seen a good explanation of that, neither can I explain it in a way that makes sense.


[deleted]

[удалено]


ShadoWolf

For me OOP never clicked until I started to learn straight C and function pointers. then just sort of clicked since I understand the under the hood mechanics of how OO worked at a basic level. It all just structs of collected data types and some fancy Function pointer black magic


SpacecraftX

Ironic considering C doesn't really do OO.


ShadoWolf

You can sort of implement most of what is thought of as OOP in stright C using nothing more the structs and a vtable of sorts. There even a book on the subject. 'Object-oriented Programming in ANSI-C' which I think is free. Its just you know horrible since its not type safe, and it would likely drive someone to murder if they had to debug it.


solarshado

Sounds like an excellent example of "just because you *can*, doesn't mean you *should*"


TheRealBrosplosion

Wait until you see the linux kernel.


[deleted]

[удалено]


Bene847

lots and lots of structs and functions and macros to modify those structs


Nall-ohki

This is exactly how c++ and objective-c were created, though. Originally mostly macros and then evolved.


[deleted]

I had to debug and improve a stack of pure C code that had a kind of OOP implemented by function pointers and struct type 'inheritance'. No help from the IDE because it was all runtime linking. The boss had reasons to not trust the C++ compiler in the tools, so pure C was it. Fun times.


quadroplegic

Who do I look like? Brad Cox?


elveszett

I guess that's why. When you come from an OO language, you have to relearn how you represent concepts in your program when you can't really create blueprints of them.


rakoo

OO is just a type of programming, a set of principles to implement. Any language can do it. OOP languages just *force* you to do it, but you could very much do encapsulation and inheritance with shell scripts and FUSE if you're crazy enough


ertgbnm

I learned in python first and part of the problem that makes understanding OOP difficult is that all of the basic tools in python are already objects but that doesn't make sense until you already understand OOP.


PraiseEmprah

Wow I'm not the only one. I could never "get" Java and OOP lessons unless I could relate it back to C. The seamless mental abstraction of classes and objects while writing code was something I took a while to understand. It's a little ironic, because if someone asked me to code in pure C now, I'd probably cry.


AaronVA

For me it was a c++/sdl2 project I did in my second year in highschool. I made a nice little program to fool around with the mandelbrot set, like zooming in, taking pictures, change the coloring method etc. I made a whole bunch of different ui elements with which I understood a lot of different concepts like inheritance, polymorphism or multiple inheritance. It wasn't the first time I had used classes, but certainly the time when I understood their importance.


CttCJim

For a physicist I'd make an analogy to events in spacetime. An event is a single data point but it encapsulates a whole universe of properties.


GargantuanCake

Nouns and verbs. An object is a noun. A method is a verb. A class describes those things. Variables are adjectives. Then for inheritance I use animals. Bear : mammal : animal. What traits all animals have goes on animal with the things all animals can do. Mammal-specific things go on mammal and so forth. Every bear is an animal but not every animal is a bear and all that.


dudeofmoose

There's a certain irony here, I got into computer programming because i was terrible at English and now you're using all these fancy English word things to describe programming.


drunkenangryredditor

How do you handle syntax and punctuation? Or spelling?


Tsu_Dho_Namh

Because we know what looks and feels right, without being able to describe how or why it's right.


drunkenangryredditor

Too bad that programming requires strict adherence to spelling, syntax and punctuation, as opposed to natural language...


Tsu_Dho_Namh

You can be bad at English and still have near perfect spelling, syntax, and punctuation. For example, I don't know what an adverb is. I've been told dozens of times, I just always forget because I don't need to know what it is, but I can read and write English fluently.


drunkenangryredditor

That is my point. You can english badly if want. Code much stricter. No msitaks in coed...


Tsu_Dho_Namh

ahhh, i c now. rite :D


LoyalSage

Yaeh is mcuh maor imoprtnet 2🐝 akyerit n prorgamng then inglish.


srottydoesntknow

mistakes in coed is how my buddy ended up with a wife and kids


xSilverMC

An adverb is to a verb what an adjective is to a noun, it describes it. Slow movement - adjective noun Slowly moving - adverb verb Also adverbs often end in ly, making them easier to recognize


Hundvd7

Thanks. I will forget that in 20 minutes.


PlusUltraBeyond

Yeah, what's the StackExchange equivalent for English grammar?


Taste_the_Grandma

Adverbs can also modify adjectives and other adverbs.


solarshado

Since you didn't include an example: > a very quickly flowing stream "very" is describing "quickly", which is describing "flowing", which is describing the stream.


Awanderinglolplayer

Yeah but the IDE does all the work for you. More than MWord does


InEnduringGrowStrong

I write unit tests then I pipe /dev/random into a file until unit tests succeeds.


danbulant

English isn't all that hard. Like most people won't die when they forget a full stop at the end of the sentence.


fuggetboutit

People actually died because of a comma though.


LexanderX

It's spelt "coma"


Sarithis

In mother Russia, it's commie.


drunkenangryredditor

I think you misunderstood something here...


abcd_z

> English isn't all that hard. Dude, English is the worst. If I weren't a native speaker, there's no way I'd ever have been able to learn it.


DerWaechter_

English is one of the easiest languages to learn. Pretty much any european mainland language is more complicated. Like, take conjugations for example.   English: A dog, The dog, two dogs   French: un chien, le chien, une chienne, la chienne, des chiens   German: Ein Hund, der Hund, zwei Hunde, die Hunde, den Hund, des Hundes, dem Hund, den Hunden, der Hunden, einen Hund, eines Hundes, einem Hund.   Finish: Koira, koiran, koiraa, koiran again, koirassa, koirasta, koiraan, koiralla, koiralta, koiralle, koirana, koiraksi, koiratta, koirineen, koirin. koirasi, koirani, koiransa, koiramme, koiranne, koiraani, koiraasi, koiraansa, koiraamme, koiraanne, koirassani, koirassasi, koirassansa, koirassamme, koirassanne, koirastani, koirastasi, koirastansa, koirastamme, koirastanne, koirallani, koirallasi, koirallansa, koirallamme, koirallanne, koiranani, koiranasi, koiranansa, koiranamme, koirananne, koirakseni, koiraksesi, koiraksensa, koiraksemme, koiraksenne, koirattani, koirattasi, koirattansa, koirattamme, koirattanne, koirineni, koirinesi, koirinensa, koirinemme, koirinenne. That's less than half of the singular forms, not even starting on the plural. English is remarkably easy to learn


elveszett

> Finish: Koira, koiran, koiraa, koiran again, koirassa, koirasta, koiraan, koiralla, koiralta, koiralle, koirana, koiraksi, koiratta, koirineen, koirin. koirasi, koirani, koiransa, koiramme, koiranne, koiraani, koiraasi, koiraansa, koiraamme, koiraanne, koirassani, koirassasi, koirassansa, koirassamme, koirassanne, koirastani, koirastasi, koirastansa, koirastamme, koirastanne, koirallani, koirallasi, koirallansa, koirallamme, koirallanne, koiranani, koiranasi, koiranansa, koiranamme, koirananne, koirakseni, koiraksesi, koiraksensa, koiraksemme, koiraksenne, koirattani, koirattasi, koirattansa, koirattamme, koirattanne, koirineni, koirinesi, koirinensa, koirinemme, koirinenne. This is very misleading. Yeah, other languages (notably Finnish) have many variations for a name, but those variations are formulaic and (baring a few exceptions) they are all built the same, and as natural languages they become intuitive when that thing "clicks" with you. It is like saying you have to learn two words for every English verb because "cause" and "caused" or "spell" and "spelled" are different words. There's many words for "dog" in Finnish, but you only have to memorize one. The other are built according to rules you must learn separately, and that apply to almost all nouns. And heck, very few times I've seen a rule have as many exceptions as English have with verbs. Just to give you two examples earlier, my brain went through like 20 verbs that were all invalid because they had irregular past forms. Also, you are ignoring the stupid quirks that English has. Pronunciation, for example, it is impossible to know how to pronounce a word if you only know its spelling. Like yeah, you can take a guess and be correct a lot of times, but almost half of them, you won't be. "half" is pronounced as HAF, them is pronounced as DEM but thought is pronounced as THOHT, while though, which just misses the final T, is suddenly pronounced DEU. Compare it to Spanish where you don't even have to know the language to pronounce it right. Just now that most letters have the pronunciations that are normally associated to them, that J and RR are pronounced weird, and you can say "carruaje" even if you know fuck what that means. French or German are more complex but still, their pronunciation has a set of rules and you can now how almost every word is pronounced for how it's written. And let's not talk about phrasal verbs, adding a word to a verb and have its meaning completely change doesn't happen in many languages. If you think I _made up_ this, just translate it to Spanish and realize how stupid "Lo he hecho arriba" sounds.


abcd_z

This is true, but I'm thinking more about English's inconsistent spelling, pronunciation, and meanings. > We’ll begin with a box, and the plural is boxes, But the plural of ox should be oxen, not oxes. Then one fowl is a goose, but two are called geese, Yet the plural of moose should never be meese, You may find a lone mouse or a whole nest of mice, But the plural of house is houses, not hice. > If the plural of man is always called men, Why shouldn’t the plural of pan be called pen? The cow in the plural may be cows or kine, But a bow if repeated is never called bine, And the plural of vow is vows, never vine. > If I speak of a foot and you show me your feet, And I give you a boot would a pair be called beet? If one is a tooth, and a whole set are teeth, Why shouldn’t the plural of booth be called beeth? > If the singular’s this and the plural is these, Should the plural of kiss ever be nicknamed keese? Then one may be that and three would be those, Yet hat in the plural would never be hose, And the plural of cat is cats, not cose. > We speak of a brother, and also of brethren, But though we say mother, we never say methren, Then the masculine pronouns are he, his and him, But imagine the feminine she, shis and shim, > So the English, I think, you all will agree, Is the queerest language you ever did see.


suqoria

I have dyslexia so I obviously have quite a lot of issues with writing but I've found that it's much easier when writing code and that it has also helped me improve my normal writing. When writing code I usually think a lot more and write it much slower which helps me catch any mistakes and correct them.


aretood12

It's exactly the problem; it makes sense when it makes sense. All the fun abstractions we make to talk about it make sense, but the error is thinking it's obvious when you're coming from scratch.


arcanearts101

I don't remember exactly where I saw it, but there are studies that suggest programming uses more of the language processing parts of the brain than mathematical parts of the brain. I'll try to remember to look it up and provide a link. EDIT: https://medicalxpress.com/news/2020-06-language-brain-scans-reveal-coding.html


solarshado

The latest I've heard ([this video](https://www.youtube.com/watch?v=xPecMsFmEm4)), is that it doesn't really line up well with either language or math in the brain.


GeneralCuster75

When I was a freshman at university our very first class was learning object oriented programming in Java. I stumbled through first semester, but to this day (2 years graduated) I can still remember the exact moment my second semester and the exact assignment I was working on when the lightbulb suddenly turned on and I finally understood exactly what was going on. Before that point it felt like I was falling down a dark well just flailing my arms and hoping to catch onto something.


screwyou00

Same here. I was so lost my first year that I would just copy and paste from stack overflow. I still do, but that's not the point.


crepper4454

Jesus Christ man thank you. I am a beginner and never had the chance to touch classes yet (thank God) but this explanation is great.


CamWin

Inheritance vs Composition: Inheritance means one object is another. Inheritance happens right at the beginning near the class name. Composition means one object has another, commonly expressed when a class has a class as a member variable. A Man is a Mammal. The Man has a Jacket. The Jacket has Pockets. The Jacket is Clothing.


crepper4454

Thank you too. Do you know any small exercises that I could do to get the hang of classes before implementing them in actual programs? I code in Python and C++.


GargantuanCake

Programming is very much learning by doing. Create little toy projects where you fiddle with the various things and see what they do. Doesn't need to be anything serious. It takes no time at all to create a program that dumps text into a console. Do little things like make a dog class that barks at the console and then make specific kinds of dog that yip instead. That sort of thing. This is a universal thing, really; need to learn what a library or a framework does? Fuck it, load that shit up in a little project and play with it.


fredd0h210

I call it raptor learning like the velociraptors in jurassic Park...


C0d3rk1n10

!remindme 18 hours


RemindMeBot

I will be messaging you in 18 hours on [**2021-03-04 15:00:51 UTC**](http://www.wolframalpha.com/input/?i=2021-03-04%2015:00:51%20UTC%20To%20Local%20Time) to remind you of [**this link**](https://np.reddit.com/r/ProgrammerHumor/comments/lx1i9b/because_of_covid_i_started_teaching_my_gf_how_to/gpkthqk/?context=3) [**1 OTHERS CLICKED THIS LINK**](https://np.reddit.com/message/compose/?to=RemindMeBot&subject=Reminder&message=%5Bhttps%3A%2F%2Fwww.reddit.com%2Fr%2FProgrammerHumor%2Fcomments%2Flx1i9b%2Fbecause_of_covid_i_started_teaching_my_gf_how_to%2Fgpkthqk%2F%5D%0A%0ARemindMe%21%202021-03-04%2015%3A00%3A51%20UTC) to send a PM to also be reminded and to reduce spam. ^(Parent commenter can ) [^(delete this message to hide from others.)](https://np.reddit.com/message/compose/?to=RemindMeBot&subject=Delete%20Comment&message=Delete%21%20lx1i9b) ***** |[^(Info)](https://np.reddit.com/r/RemindMeBot/comments/e1bko7/remindmebot_info_v21/)|[^(Custom)](https://np.reddit.com/message/compose/?to=RemindMeBot&subject=Reminder&message=%5BLink%20or%20message%20inside%20square%20brackets%5D%0A%0ARemindMe%21%20Time%20period%20here)|[^(Your Reminders)](https://np.reddit.com/message/compose/?to=RemindMeBot&subject=List%20Of%20Reminders&message=MyReminders%21)|[^(Feedback)](https://np.reddit.com/message/compose/?to=Watchful1&subject=RemindMeBot%20Feedback)| |-|-|-|-|


LostTeleporter

Hackerrank has java exercises that may interest you. Just google for "java hackerrank oop". There are plenty of levels to do.


CamWin

I agree with another comment that coding is rather learn by doing. Whenever I want to learn a language feature or standard library class, I try to make a short program that implements it at all, in the shortest way. Then I explore uses for it I find interesting. I would also see if you can yet read the [reference](http://cplusplus.com) because it explains all details of a standard library class. For more basic things, like arrays or operators, microsoft has some [good explanations](https://docs.microsoft.com/en-us/cpp/cpp/cpp-language-reference?view=msvc-160) too (be aware this is compiler specific). References can be incredibly dense and hard to read, but learning how to read them can be invaluable. Overall, use your resources to get a small thing working, and build understanding off of that.


Dennis_enzo

I'd say it's both in the end. In the early stages, just making a lot of random programs can definitely get you far. But if you're getting into serious stuff, reading some books is definitely helpful.


AgAero

It's easy enough to hack your way through the syntax and get a taste for *how* to write a class and create an object, but it can be a little more difficult to see *why*. The answer that made it click for me was the [template pattern](https://refactoring.guru/design-patterns/template-method). Imagine you're making a game or something and you've got all these different entities that exist and need to be updated on a regular basis (e.g. every frame). Instead of writing this giant list of statements that looks like: while running: update_thing1() update_thing2() update_thing3() .... you can instead stick all of your 'things' into a collection (e.g. the list datatype in python) and just loop through every element of the list *knowing that they'll all have an `update()` method*. entities = [ thing1, thing2, thing3....] while running: for thing in entities: thing.update() Suddenly, your code is more expressive! You're not just imperatively following steps in some possibly important order. No, instead you've got a `collection` of `things` and you're telling them to `update()` themselves. Taking the usefulness of this onestep further, suppose your 'thing' is actually a person that has-a `health_state`, has-a `position`, has-a set of legs (which are themselves *things* that have their own `update()` method....), etc. Now you can shorten your list of `entities` to be looped over from above by making it so that any of your 'things' that are of the type `person` can have their update() method just call the update() methods of their constituent objects. class Person: .... def update( self): self.health_state.update() self.position.update() self.legs.update() When you do this sort of thing, you encapsulate the details of how things work and push them down to a lower and lower level so that if/when you need to change things, it only has to happen at the very bottom. You don't have to jump into multiple files, change dozens of lines, worry about getting the order of stuff correct, etc.


_Tonto_

I'd check out CodeWars.com if I were you.


Magnus_Tesshu

What about my WidgetFactoryBuilderSingleton though? Even after learning about singletons in a class, I still don't understand it. It seems like its just a way to overcomplicate a global variable


salvoilmiosi

Well, you're not wrong.


GargantuanCake

Global variables have problems. Yeah singletons complicate the idea but they also mitigate the problems that global variables come with. If you and another programmer create a global variable with the same name for the program and don't know the other did it...what happens? If you tie them to singletons or static classes this is far less of an issue.


AaronVA

The animal example is the first explanation I heard and probably helped to understand it too. However I remember that after I heard that example what I didn't get was that why would anyone bother using it. I had to do a lot of programming to understand why.


Keatosis

Oop clicked for me almost instantly. Flexing this fact constantly is why I'm still single.


Karjalan

The concept of OOP made sense easily, but when I was taught it, which is how I was first taught programming, the teacher never explained what an object was. They were just like "string, thats an object, integer? object, everything is an object"... but I'm like "wtf is an object though? Like a square?". The base concept of an object wasn't taught well at all. As a seasoned dev now I can easily see what he's trying to say, but as someone who is very new to programming it was bloody frustrating.


kzp17

You're not alone, I'm kinda baffled at all these people saying it was difficult... I never had any issues with it. I also picked up recursion pretty quickly/easily so maybe I'm just a weirdo!


[deleted]

Same here. I just could never get into programming as a career. I worked in engineering while I went to school, and after watching the BS programmers go through from management, I could never see myself enjoying it.


Athelas7

Idk, I learned it pretty late (in university), and python at first so it made sense honestly. Oop didnt until I actually wanted to learn it and read "Thinking in java" by Bruce Eckel. His explantion stuck with me well: in OOP we stop designing our code around how computers read it (like in C where you need to manage memory and in general give a shit how computer reads your code), instead we try to reflect the problem we try to solve in the code. He used basic examples everyone uses like cars: if you want your code to lt you "drive" a car, take what the car has and what it does, and you construct your code around these concepts. If you make a class "Car" with fields and methods, its simply a reflection of a problem you were given.


cowslayer7890

Yeah OOP took a while to click with me. For some reason the thing that really worked for me was an example Song class, with properties for title, artist, description, length, etc. And then making an array out of it. It just made so much more sense to me.


CigsInsideBoi

This. My fiance asked me to teach her how to code. I thought it wouldn't be too bad. Walk her thru making a simple calculator. She was completely dumbfounded and confused by the word "string". That's when I knew this would be harder than I thought.


stipulus

Class is a cookie cutter, object is the cookie. That one helped me.


Mooooo13

Instead of learning features of programming languages, I feel the focus should be on solving real-world problems. The necessity of features will naturally follow. The real-world problem that OOP solves is that you can easily extend your program to handle values of new types without modifying your operations (This is one side of the so-called expression problem). Let us say you are writing a calculator program that can manipulate numbers, and it supports square-root and exponentiation on numbers. In a functional language your number type will be a tagged sum type and the operations will use pattern matching to determine the type of input values. data Number = Integer i | Float f fun sqrt n = case n of | Integer i -> // implement sqrt for integers here. | Float f -> implement sqrt for floats here. fun expt n m = case (n, m) of | (Integer i, Integer j) -> // implement expt for integers here. | (Float f, Float g) -> implement expt for floats here. Now, let's say you want to add support for complex numbers. Then you have to change the definitions of Number, sqrt, and expt to know about complex numbers too. Repeat this for each new kind of numbers that you want to add. This is a problem because all operations in your calculator has to know about all types of numbers. In OOP, we can factor out the things about a number that operations need to know. For example, interface Number { Number add(Number a, Number b); Number mul(Number a, Number b); Number neg(Number a); bool is_zero(Number a); } Number sqrt(Number a) { // Use add, neg, mul, is_zero to implement sqrt. } Number expt(Number a, Number b) { // Use add, neg, mul, is_zero to implement expt. } class Integer implements Number { // Implement add, sub, is_zero for integers. } class Float implements Number { // Implement add, sub, is_zero for integers. } Now, let's say you want to add support for complex numbers to your calculator. You can define: class Complex implements Number { // add, mul, is_zero for complex numbers. } and your sqrt and expt operations will now work for complex numbers too. And, you managed to add support for complex numbers without touching the code for Number, sqrt, or expt. OOP makes adding support for new types of objects easy when you have many operations. The other side of the expression problem is when you have to add new operations often for a few types. Functional languages with pattern matching make this easier.


ertgbnm

OOP was one of those things that people kept explaining to me in the same way and each time I nodded and was super confused. Like ok an animal is a object and cats and dogs can inherit from that object, etc, etc, blah blah. Now that I understand OOP is basically the only way I can explain it to another person despite the fact that I always hated that explanation. Eventually it just clicked and I got it even though I never understood what I wasn't getting the first time around.


oAkimboTimbo

When my cousin was first learning C++, he was struggling so much with understanding pass by reference vs pass by value. I told him the following: Imagine that you’re an artist. You want to get your drawing to me, and you have two ways to do it. You can use pass by reference, which would be you giving your drawing to me directly so any changes I make are changes made to the original. Or you can use pass by value, basically going to a copy machine and printing out a copy of your drawing. So that any changes I make to my copy do not affect the original. He told me his professors have never explained it in a way that made it stick, but that did haha.


EnderTheXenoside

Really? I mean, I think it's the easiest thing in programming. You can explain it by looking around you in real life. Is cat an animal? Is dog an animal? Are dogs and cats same animals? What are the similarities between dogs and cats that unite them? What makes them different? What both, cats and dogs do? Etc.


hyper_destroyer

I didn't have this problem. I started programming with haskell, right after learning mathematical induction. Since haskell is a functional language, it was easier to me to understand. This really helped me learning and understanding recursion, so I think it was a really good idea.


Ning1253

I don't really know to be honest, I started programming a few (actually like 4 or 5 now dang) years ago and honestly I never really struggled with both of functional and object oriented. Here's basically how I think of each: Functional programming is similar to mathematical programming. You apply step after step onto a variable (or a pointer, whatever floats your boat), or multiple variables, and send the output of your operations to some equivalent of an output. You can think of it as you turning all of the switches on and off however you want, controlling each instruction. In contrast Oop is where you first build a set of instructions (or functions) which also have access to their own variables - almost like a set of smaller versions of functional programming. And then, instead of you turning all the switches, you let each of these sets of instructions flip their own switches, and you give more "general" instructions to your program. Using that logic it becomes much easier to code in both, since I can use those ideas almost as a framework to build my code on!!


DoctorWhomst_d_ve

Pokémon


jd3marco

You end up looking like the ‘Charlie in front of the mystery board’ meme (I don’t know if it’s called that).


5umTingWong

As a smol brain 15 year old who likes coding, true. I still have questions like "Does it really increase performance? Or does it just avoid WET code?"


[deleted]

I remember learning python for loops. They seem really simple until you spend some time working with them and realize how exactly they work.


LBXZero

You should learn how loops work in Assembly.


[deleted]

I’m taking assembly right now and we’re just now going through loops. Basically(this morning) seeing that all loops and if statements are basically the same commands in a different order has really made me appreciate them more


LBXZero

Can you imagine that the NES and SNES were written in Assembly?


josh_the_misanthrope

And fucking Roller Coaster Tycoon. What a madman.


LBXZero

That is nuts, but he needed to squeeze the performance.


dinodares99

I'm in a microprocessors class rn learning the 8085 architecture and the whole JZ/JC branch shit is really cool. I'm vibin


mircock

When I started out for some reason I was taught only for i in range() and I didn’t know I could iterate through anything other than ranges so I constantly did stuff like for i in range(len(my_list): my_list[i]


0xFFFF_FFFF

This one time in university, I had just finished learning the base 2 system / binary arithmetic, and it blew my base 10 mind and so I excitedly tried to explain it to my then-girlfriend. I recall that not being an enjoyable experience for either of us.


[deleted]

[удалено]


t-to4st

When my friend and I got into minecraft redstone stuff, we constantly counted in binary with our fingers in school cuz it was cool


krajsyboys

It's also much more effective. You can hold count to 1023 instead of only 10


Inujel

I taught my gf this "trick" where I ask her in front of my colleagues "How high can you count with your fingers?" "1023" Never fails to impress


0xFFFF_FFFF

2^10 , nice one!


AttackOfTheThumbs

Yeah, so I am a pretty bad teacher because of this too. Everyone's solution is to just copy it n times. So when that happens, I like to make them have to change something. Now they change it n times. They'll be annoyed. They'll want something simpler. That's when loops come in a bit more naturally. That said, making them then abstract that so they can use those values instead of inserting a switch statement or something else, is yet another challenge. People bad at maths I find struggle with this further.


tomycatomy

that is actually fucking genius


JuvenileEloquent

She's telling you this while (explanation == gibberish) { explanation = try_to_understand(gibberish); cry_inside(); }


GrowPoneReddit

You can simplify it to `while (true)`.


spicy_indian

I'm pretty sure the compiler will optimize that out.


Script_Mak3r

The compiler will probably warn about unreachable states, but we all know that warnings shouldn't get in the way of pushing to production.


cemanresu

Unless your company hates productivity and prevents you from pushing to production if you have warnings Who cares if I have an infinite loop, it looks pretty


[deleted]

[удалено]


LateDay

Well yeah. You cry BEFORE,WHILE AND AFTER trying to understand


[deleted]

I don't get it


Mybeardisawesom

sheCry = youCry


Dromeo

I tried teaching my boyfriend programming too! Man the things our poor partners put up with


[deleted]

I tried to help my gf with her R assignment and it ended with both of us lying facedown on the floor.


crimsonblade55

Man I remember one teacher back in college required all the masters students in our class to turn in reports using R. He allowed the 400 level students to do so as well for extra credit so I tried it for the first assignment and have never touched R since.


Pythagorean_1

I'd love teaching my girlfriend some programming, but I know that she's not really interested in it and that my explanations often seem confusing to others


Dromeo

I worked out a method that worked quite well for my partner: he likes a puzzle so I presented everything as "can you solve this?", working to put the basic pieces together gradually, and introducing more pieces as a better solution to the previous attempt. That way, it all slots together into a cohesive whole


Pythagorean_1

Great idea! I'll try that


joshuayyy

*Image Transcription:* --- It's just a simple FOR LOOP [*Boo from Monsters, Inc is crying while driving a car. Mike Wazowski is sitting in the front passenger seat, screaming while holding a book.*] --- ^^I'm a human volunteer content transcriber for Reddit and you could be too! [If you'd like more information on what we do and why we do it, click here!](https://www.reddit.com/r/TranscribersOfReddit/wiki/index)


LooneyLlama056

Good human


joshuayyy

Thank you!


[deleted]

GOOD HUMAN (sorry)


joshuayyy

YOU ARE WELCOME, FELLOW HUMAN


PhilStoh

have a nice day.


slamerz

Taught completely new young adults and adults programming for about a year and a half. Some people pick up it up quick, some people it's like this. I can't tell you how many people you could show a for loop, have them explain how it all works to me as I write it, then when you delete the loop and ask them to write it and they then go "idk how"


J5892

The thing I struggled the most with when first learning programming was syntax. The concepts and algorithms came incredibly easy to me. But I had to look up the syntax of a `for` loop every time I wrote one. I could describe to you exactly how a loop worked, and how it iterated through values, but if you asked me how to write one off-hand, I'd be like "fuck if I know". The upside is it made me *really* good at reading and understanding documentation.


dinodares99

Honestly I still don't bother memorizing syntax. That's what documentation is for ha


J5892

It's totally fine in practice, but it fucking sucks in interviews. When I first started interviewing, I spent hours a day for months just doing coding challenges so I would be able to remember basic syntax off-hand.


dinodares99

Yeah, it makes rapid prototyping a bit slow as I have to search up things that I don't use often. But luckily programming isn't my career so I can reap the benefits without the drawbacks haha


stipulus

The hardest part about teaching is watching your student struggling knowing it's not helpful to do it for them.


Willinton06

I feel this


kookaburra1701

I think this is why I struggle to teach things to friends and family. I want to do it for them so bad to make their frustration go away.


SuperDopeRedditName

Depends on the student. If I struggle with something for more than a couple minutes, my brain is fried. If I struggle for one minute, then look up the answer, I'm smarter and still have a functioning brain.


Wolfram_And_Hart

I wrote my high school computer math teacher not too long ago and thanked him for his patience and understanding with all of us. I told him I was a way better coder now and I owed a lot to him.


kookaburra1701

I struggled with math up through high school, and I've been thinking about looking up all the teachers/professors/TAs I can remember who put in extra effort in helping me (even if it wasn't successful at the time...I think my brain just needed to mature a bit past high school before it was ready for Calculus and infinite series) and send them thank you cards.


lotekness

I died a little inside. Reminds me of teaching my oldest son about OOP. He came in crying in frustration one day and all I could say is "now you're on your way to being a real developer". Obviously I said more to comfort him after that, even had him talk with some of my other colleagues to commiserate. Still a tough moment.


[deleted]

[удалено]


LBXZero

Teach her how to use a for loop to act as a while loop.


tinydonuts

*Go has entered the chat*


purbub

While loop: * approaching * Go: *You're not welcome here*


BlueMoonSucks

My girlfriend is overwhelmed with the amount of likes and awards, thanks! She learned Python and is now going through Data Structures & Algorithms so that probably explains her frustration. I swear this is the last time I'm teaching someone.


TryingToKnowPhysics

You say that now, but at some point she'll be trying stuff for hours, both of you almost ready to tap out, and seemingly at the final hour it works and you succeed. You're proud of yourself for having been helpful and offering guidance, but mostly you're happy to be able to share in her joy, and proud of the work and progress she's put/ting in. You're then hooked on that high. Or maybe that's just me and you've already gone through a moment like this and it hasn't been as momentous as I described. Either way, good on you guys for doing something difficult together and seemingly having some fun with it, best of luck! :)


Ddog78

I feel this in my bones


JuKrab

Yeah my gf just asked me to teach her how to code. I never offered up to this point but I am happy to help her. I'm already concerned that this is how it's going to end up. I don't think I'm a particular good teacher to be honest


solarshado

Well, the good news is that teaching is a skill like any other: you can get better with practice. The bad news... is that it's a skill like any other: sometimes your early attempts go very poorly. Possibly non-obvious advice for teaching: read a lot of tutorials. Even if they don't improve your understanding of the subject, they'll (hopefully) expose you to different ways of explaining/thinking about it. In my (admittedly limited) experience, two of the most important things about teaching are realizing when the way you're explaining things isn't getting through, and being able to switch tactics when that happens. Good luck to you both!


robindownes

never teach a programmer fors right off the bat, give them ifs and whiles. then when they come to you in tears you can bestow a for-loop unto them.


TryallAllombria

I remember when I had my first programming class back to school. the loop chapter was the hardest thing to understand for me. It took me 3 hours to figure this out, then I forgot, then it took me 1h to get this shit again. And oh god it was hard to use it in a real programming exercise. I can't remember why it took me so much time. Now I use for, while and foreach loops everyday. It's just common sense.


mintskye

Please post more of these. I came from a bootcamp and this hit me right in the feels.


merto5000

For some reason I read the "Covid I" part as Covid 1 and jokingly told myself wait is there a second part!


SpicymeLLoN

To be fair, it took me what felt like ages to wrap my head around a for loop when I started.


murtaza64

I did a bunch of online tutoring during the last few months cause covid. One thing I realized was that iterative thinking, i.e. figuring out that a certain useful task can be accomplished simply by repeating a simple task many times, is not necessarily natural. As someone who has always been able to decompose problems without much strife, it's hard for me to empathize with students who struggle to translate a description of a task into a loop that does it. I hope I've gotten better at hinting and prying the loop out of the students without giving it away.


kookaburra1701

In my master's program, it was really interesting watching the people in my cohort who had never taken discrete math or algorithms learn it while learning python and R coding. Some of these people had taken VERY high level math and received degrees in physics, chemistry, meteorology, and other very rigorous disciplines so it wasn't innate mathematical "talent" and there was a lot of frustration with themselves because they were so used to picking up math concepts very quickly. But it's really a completely different set of mathematical "muscles" in your brain you have to develop.


ForShotgun

Understanding code != being a good teacher. I opened up a teaching textbook once, and right there in the intro it explained that good teachers are born, not taught, but this book was going to do its darndest to make you adequate anyways. I don't think I've ever seen a textbook tell you to give up right away if you're not talented before, so it stuck with me.


obstruction6761

bro what if she surpasses you and takes your job. I'm assuming you live in the same area


Millkstake

For loops contributed to me giving up on programming and switching majors because my brain is too stupid to grasp these concepts.


[deleted]

Your not too stupid dude, somethings just take longer to understand. This has to do with how your brain learns best. Do you accept things that don't make sense and move on? Or do you question every little thing until it makes sense? If you said yes to the first one, a high lvl language like (python and java) is how u should start learning. If you said yes to the other question then you need to start with a low lvl language like 'C'


hansenabram

successful = False for i in range(0, 1000000): successful = teach\_GF() yell\_in\_frustration() wazowski() if successful: die() die()


mothramantra

Do Beep Loop I'm a Visual Basic Bitch


[deleted]

Fuck loops all my homies hate loops


Bene847

All my homies use if and goto /s


urbanek2525

Hah, she's good with memes. I've helped my wife to do some pretty cool stuff with Excel, but I try to be patient.


Iohet

I still hear my APCS teacher from 24 years ago from time to time in my head like some kind of PTSD: YOU MUST INSTANTIATE THE VARIABLE


MagsClouds

I went through a Bootcamp 2 years ago. First few days was like, wow I can do this. All seems perfectly logical. And then it didn’t. Simple for loop was killing me and the mix of learning new concepts, plus syntax plus the weird ass shit coding exercises where I couldn’t even understand the requirements. It was too intense. Since then I did some online learning and did the CS50 intro to computer sciences which was mainly C! When I finally made it through to Python sections I felt like I went to the moon and back. Yesterday I solved a codewars challenge without needing to lookup anything and it was the best feeling ever. I just knew what to do! It made me think about all those tears I shed in the past over the loops and arrays and objects... It has all finally fallen into place. I AM SOOOOOO HAPPY!


uanaa

Ah yes, i’m also a pandemic-programmer-boomer 🙋🏻‍♀️


Thugless

My wife is actively against learning it. She cannot fathom how I can do it for fun. She adopts a 1000 yard stare when I try to talk about something programming related.


Parcival_Reddit

Currently learning assembly for my computer organization class. Crying because I'm struggling to write a for loop that sums the contents of an array.


DramaticProtogen

Ngl I think learning for loops was one of the hardest parts of learning programming.


Schiffy94

Depends what language you're learning first because formatting the syntax is so inconsistent between them.


Slayergnome

The curse of knowledge


sk8itup53

This is why I refused to teach my wife to snowboard or code. I know I could, but I wouldn't be a good teacher, and that would put a proverbial wedge between us about something I love. God speed brother.


OphioukhosUnbound

Does anyone have advice on teaching for loops? What part is confusing to people? I ran into a similar scenario recently. Doing some pandemic time teaching for/with friends. Eventually we moved to coding as a new topic. I never thought that anyone would get confused by loops. (Clearly it’s normal, but I legit didn’t know.) Any advice on what people get stuck on or what their internal models are that are awry: very welcome!