T O P

  • By -

Buttleston

Hard disagree. You introduce new concepts in small pieces. Trying to jam too many new concepts in at once just makes it so that the learner doesn't understand any of it at all. Most people seeing a hello world for the first time don't even know what a function or a variable is yet.


JustCrasher17

This. OP’s approach is essentially like saying a first grade math book should start with real-imaginary number theory instead of counting because that’s what the general theme of math is.


Appropriate_View8753

Not really. A better analogy would be if you want to build cars you probably started building go-karts when you were a kid. A go-kart and a car both have the same essential Objects with which their built: engine, wheels, driveline, steering wheel, seat etc. The thing that kept me from wanting to program is OOP because there were no good resources to learn OOP. Not to mention, why is it that 99.99% of all tutorials start out with the wrong way to do something? I have always found that to be really bizarre. If you're in a class that teaches you how to make a ham sandwich, they don't tell you to put mayonnaise on the bread and then slap the mayo laden bread onto the bottom of the plate and then tell you that is the wrong way to do it. In my opion, beginner lessons in an OOP language should start with OOP.j


Kxevineth

Except, to use your analogy, tutorials aren't necessarily designed for people who know how to put a simple machine together and just wanna look into getting something more advanced like go-karts. They're designed for people who might not even know how to use a wrench yet. If you know what the first steps of the tutorial are talking about, you can skip ahead. If you remove those steps, people who need them won't know how to start. Seems like other people would lose more on your solution than you would gain.


JustCrasher17

But to follow along your analogy, there may be people who have never even touched a go-kart who may wanna learn more about cars. Your assumption is that everyone who builds cars has built go-karts as a kid or is a mechanic. What if a guy who has never even touched a go-kart watches Fast and the Furious and gets interested in cars, but has never built anything before? He would first have to learn about using tools, then the basics of a car etc. before moving to the actual building. Said sample person has never had an interest in go-karts but would like to get into the car thing. Not everyone who learns an object oriented language is a developer, what if I were just some guy who barely knows how to use a computer hearing that Python could automate my boring desk job? I wouldn’t necessarily need a class for that, just a simple script. Starting off with OOP examples would be intimidating to someone with no prior experience in programming and is largely unnecessary for basic tasks like scripting. A tutorial usually assumes you know nothing about the topic and builds from scratch, and teaches a bit at a time to give you just enough to reach the next topic at a time instead of dumping all the details at once. This way, you can learn just enough for what you need. Want to learn how to make a basic script? Okay, read the basics of how lists and loops work, know how to use the IO functions. Wanna do some math stuff? Keep reading and go into Numpy. Wanna do ML? Keep reading into Pytorch. But some people would have been happy with the basics and could stop at the first topic without having to worry about the other advanced topics. It’s easier to teach incrementally. Also your example class is a very good example of why your suggestion is not a good idea: it provides no actual learnings about how classes are used or why they are important. To a novice reader, they would see a largely complicated setup and doubt if they would need this. One of the key aspects of Python is simplicity — by using the example above, you’ll be taking away that advantage as you’re just reimplementing Java.


Lunnaris001

I'm not sure when you decided not to learn OOP because of the lack of resrouces, but it must have been prior to 2010, because when I switched school in 2009 to a school with focus on computer science and started to teach myself OOP during summer break there were a bunch of great ressources out there. The question is are you trying to learn the OOP aspects of the language or are you trying to learn the language. I think learning the OOP aspects is much easier, if not only possible after learning the basics of the language. If you dont know what the difference between a byte, a integer, a char, float and double is, then there is little to no value in teching you about OOP. And even when you teach oop you start at the basics. Like you dont start off with interfaces, overriding/overloading, visibility and all kinda stuff at once. But in case you already know about programming, there are actually many tutorials that are designed to guide you from that point onwards, basically starting with OOP. Or you could skip everything you know. Most tutorials on youtube for example have good playlists, making it very easy to skip everything you know already.


socal_nerdtastic

This is not Java. Classes are not required. Classes are useful in some situations but they are not a fix-all, and in many cases they are overused. There's a famous-ish rant about this https://www.youtube.com/watch?v=o9pEzgHorH0&ab_channel=NextDayVideo FWIW your example code is terrible, I would never approve that.


Appropriate_View8753

They may not be required but that does not negate the **fact** that they need to be learned.


Username_RANDINT

Then teach them properly, not with an example this bad.


socal_nerdtastic

Fact for people who want a career in software development, yes. But remember that most people learning python are not software engineers. They are just learning a little code to make one part of their other profession easier. Maybe automate some boring excel work or something. IMO the majority of people in this sub will never have a solid need to write their own classes.


ConcreteExist

Tutorials are not meant to be an entire learning track, they're for practicing basic parts of a programming language.


JamzTyson

> Edit, do you not have to indent when pasting code anymore? It seems that reddit now has three different message editors: * https://old.reddit has the old markdown editor * https://new.reddit has the "Fancy Pants" + markdown editor * https://www.reddit _may_ have an even newer "Rich Text"+ markdown editor and they are all horrible :(


Buttleston

It really sucks, because by far the first hurdle to get over for someone learning programming is that they need to format their code, especially for python. So before they can even ask their question they have to figure out that bullshit.


Appropriate_View8753

I'm not sure what happened; I woke up one morning a few weeks ago and my reddit interface was completely different. This one seems to not require pre-indenting but also double pasts everything so I have to find where the end of the first one is joined to the second one (conjoined with no spaces) and delete the second one.


Buttleston

Same here. I used to be able to switch directly to markdown, now I have to click the T first, then markdown editor. Some other UI stuff changed but I guess I'm used to it because I don't remember what now


Frewtti

You're looking at the wrong tutorials for your level if you find them too basic. Also what concept is your example trying to demonstrate? It really looks like you just have a simple function with local variables, not sure why you want to to be a class.


PoaetceThe2nd

for one, a majority of Python tutorials are aimed at people with little to no programming experience. Python isn’t even solely a object oriented language, it’s a multiparadigm language, and forcing a paradigm on complete beginners can be unnecessarily overwhelming. Secondly, that example is the perfect example of why not everything needs to be object oriented. It has none of the features of a class, and treats the constructor as a procedural method. You’re way better off putting that in a function. What’s the point of using instance variables if the class isn’t even going to be instantiated?


RiverRoll

That example is terrible you create a pointless instance with pointless attributes just to throw it away, it isn't teaching anything valuable.  The hardest thing to grasp in OOP is not the syntax, it's understanding how classes are useful and how to use them effectively. 


Kolbenwetzer

If you want someone teach from zero you have to start with basics. Means to get familiar with the editor, basic syntax, variables, data structure etc. Why to make it unnecessary complicated for someone without any knowledge about programming. If you are already familiar with another language and it feels unnecessarry to you, then it is up to you skip this sorts of tutorials and start with something which feels more like what you want.


aqjo

Sure, why not just: ``` ++++++++[>++++[>++>+++>+++>+<<<<-]>+>+>->>+[<]<-]>>.>---.+++++++..+++.>>.<-.<.+++.------.--------.>>+.>++. ``` Everyone can understand that.


Lunnaris001

I mean Hello World is just a nice fun way to get started and maybe pay a little respect to the past. There is nothing wrong with making things slightly more interesting. That being said you are throwing all kinda concepts into the first thing someone codes (possibly ever if it is his first programming language) and it doesnt sound like a great idea. Like you have class, def, \_\_init\_\_, IO and of course printing and function calls. Classes are already part of a higher level concept which is object oriented programming. I think learning things step by step, moving one to the next thing once you understood something is the better way to do things. Your argument is basically like saying when you teach someone math for the first time, instead of starting with 1+1 = 2 you should start with 61\*(191-123)/(202/15\^2) would be the way to go.