[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y ] [Search | Free Show | Home]

>Tfw it only took me 2 months to understand how classes work

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 88
Thread images: 6

File: Python.png (34KB, 502x270px) Image search: [Google]
Python.png
34KB, 502x270px
>Tfw it only took me 2 months to understand how classes work in python

Am i in the upper ranks of genetically gifted programmers?


I read somewhere that it usually takes normal people 6-8 months to understand classes
>>
>>59043032
>thinks understanding a class is special

We're all objects nigger
>>
File: lqb.jpg (2KB, 97x97px) Image search: [Google]
lqb.jpg
2KB, 97x97px
>>59043032
>>
>>59043062
for your own sake, have some self.__respect
>>
>>59043032
That is half of what it took me. Good job!
>>
>2 months to understand classes

are you like sub 50 iq ape
>>
>>59043080
for your own sake, self.__delete
>>
>>59043032
how do classes work?
do you mean you understand what python does under the hood or the concept of classes?
>>
>Taking 2 months to understand Python's neutered OOP
Congratulations, you might qualify for a free lobotomy.
>>
>>59043133
Do you want me to give you a quick rundown of how classes work?
>>
File: 1486888663076.png (47KB, 164x280px) Image search: [Google]
1486888663076.png
47KB, 164x280px
>>59043157
If OP, please do.
>>
>>59043157
I'd love to
>>
>>59043157
op i've been using python for many years now and i am only starting to get this. any website or tut you followed specifically?
>>
>>59043157
I think I need a quick run down on these classes.
>>
>>59043116
Self.__DELET THIS
>>
You're fucking kidding me
>>
>>59043208
How about deez nuts? I think I can run them down your face.
>>
>>59043178
>>59043196
>>59043205
>>59043208

Wow, you guys must be brainlets.

Classes are basically blueprints for how to build an object.

You specify within a class what methods or behaviors you want it to have.

You can then create instances of the class and call their specific methods or behaviors when needed.

That's pretty much it
>>
File: 1430116552319.jpg (77KB, 599x800px) Image search: [Google]
1430116552319.jpg
77KB, 599x800px
>>59043342

tell me more.. are you op or someone else? i have not been able to find this information anywhere else. how do more people get this?
>>
>>59043032
just put self everywhere
>>
>>59043378
lol are you being serious?
>>
>>59043378
I have nothing to gain from helping you acquire knowledge that you could then utilize to surpass me.

I want to help you, but one of the side affects of being intelligent is being unable to willfully do stupid things.
>>
Yes go forth my child
>>
>>59043462
i tried asking my professors in school but they tould they havent touched python yet

>>59043465
i will not surpass you i am just a beginner my friend. please give me your journal
>>
>>59043813
journal of knowledge
>>
>>59043154
Kekk
>>
What kind of gay shit is this?
>>
I dont get it. Why use classes? Why not just use methods?
>>
>>59043934
because you want dynamic dispatch
>>
>>59043813
I'll give you a hint

Youtube.
>>
>>59043442
"True"
>>
>>59043032
>python
>genetically gifted
Go learn whole C++
>>
>>59043032
I'm still a novice when it comes to programming, but I've yet to actually understand the purpose of Classes/Objects.

I just don't understand how/why people write their code with a fuck ton of OOP.
I mean I understand what it does and I've used some of that stuff myself, but I just feel like it's sort of unnecessary. Maybe my brain just isn't wired for OOP. I don't understand how people can come up with code that's like 60% abstract, even if I wanted to do that I couldn't if I tried.
It just feels so much better and easier for me to do things the "hard" way, it's more simple
>>
>I have nothing to gain from helping you acquire knowledge that you could then utilize to surpass me.

Nice inferiority complex bro
>>
Is going from Python -> C a common thing?
>>
>>59044898
I did and I love C now.

Switching languages is actually really easy desu
>>
>>59043032
Do people actual struggle with classes? It's really not difficult.
>>
>>59043032
kek. Like 2 months from not programming at all to understanding classes in their entirety? hmm. Maybe that's the average person.
>>
>>59044948
I googled to make sure I wasn't misunderstanding what OP meant by classes. I'm actually really upset now that people struggle with this enough that OP feels special for understanding in *only* 2 months.
>>
>>59043032
>he doesn't dream in python
>>
OOP is a meme
>>
>>59044898
Yeah, as soon as you notice that Python is slow as a pig.
>>
Classes and by extension object-oriented programming are probably the simplest idea to hit CS after structural programming. A natural extension if you will. If you have functions, and you have data operated on by functions, doesn't it make sense from an organizational perspective to tightly couple the functions to data that they operate on? These encapsulation prevents pollution of the namespace and (if used correctly) makes it easier to understand what a program is doing.

The goal of OOP is to remove global state. I frankly don't get how people struggle to understand classes/objects because they are literally an idea derived from the real world functioning of objects.
>>
>>59044984
prove it faggot
>>
>>59045001
but interfaces, but abstract classes, but inheritance, but design patterns
>>
>>59045001
>(if used correctly) makes it easier to understand what a program is doing

Nah
The opposite.
>>
>>59045001
>remove global state by creating a singleton

lmfao
>>
>>59043032
took me a weekend

OP is confirmed retard
>>
>>59043032
>it only took me 2 months
It took me 15 minutes.

Don't worry, I'm sure Pajeet is willing to share his cubicle.
>>
>>59043032
The upper ranks are those I take two weeks and they're fluent in Ruby.

Two months? You, on the other hand, should look for a different pastime. And don't even think about making it into a career.
>>
6-8 minutes
>>
>>59043342
that's how classes work in a lot of languages.
>>
Come back after you learned numpy and caffe
>>
A genetically gifted programmer can learn from books rather than attending classes.
>>
Basics of OOP in C++/Java are covered in a 12 week university course. Students usually take four to six courses at a time.

So yes, the fact that you learned one subject in 2 months, while every CS student will learn that subject plus 3-5 more in 3, makes you a fucking genius.

Moron.
>>
>>59043032
Kek classes are basic OOP. Takes an hour(s) to understand then apply
>>
Is this thread a joke of some kind?
>>
structs + information hiding = classes

Am I stuck in the nineties?
>>
jokes aside, how long should it take to understand classes? I took a cs101 class last year and I think I understood them within about a week of the class starting, so I'm a little confused about OP unless he's trolling
>>
>>59045324
...Classes aren't even hard to understand in the first place. At the maximum, 5 days.
>>
Now that you understand the concept, it's now time to learn object oriented design.
>>
>>59045340
k so if loops and conditionals are step 1, and classes are step 2, what's step 3?
>>
You should be able to learn classes in 30 minutes if you re not a brainlet.
>>
>>59045324
Depends on what you mean by understanding. The basic concept, and implementing them, with documents at your side? A day to a week.

Being able to code a basic design pattern in your sleep without even thinking about it? A few months.

If you truly understand something, it has to be second nature, and that doesn't come in a week.
>>
>>59045357
algorithms and data structures
>>
>>59045402
thanks
where do I start?
>>
>>59045357
Low level intrinsics
OOP
Memory management
Pointers
Optimization
>>
>>59045409
I'm not the best authority on that. This is often recommended:

https://www.amazon.com/dp/0262032937/?tag=stackoverfl08-20

The book I used in uni was Java based and pretty terrible.
>>
>>59045105
>>59045084
>>59045119
>>59045138
>>59045219
>>59045376

You're obviously narcissistic, pretentious and idiotic enough not to realize that it was tongue-in-cheek and you had to chime in how you're smarter. Kill yourselves.
>>
>>59043032
>it took me 2 weeks
>>
>>59043032
kill(your.self)
>>
File: 1487467073896.jpg (192KB, 583x474px) Image search: [Google]
1487467073896.jpg
192KB, 583x474px
Here's a quick rundown:
-objects bow down to classes
-in contact with class-private methods
-possess parent/child-like abilities
-control object instances with an iron but fair fist
-are included in 99% of mainstream languages
-people with 215+ IQ use classes
-you likely have classes in you RIGHT NOW
-fuck off
>>
>>59045652
>-people with 215+ IQ use classes
>-you likely have classes in you RIGHT NOW
>-fuck off
topkek
>>
>>59043032
It took me about 5 minutes in my C++ and I am on the retarded end of the spectrum.

I also realized that OOP is a complete meme and an awful way to programm.
>>
>itt /b/ baby OP tries to troll and gets effortlessly counter-trolled and derailed by /g/
I love it.
>>
>>59043032
Iktf OP, it took me 20 years to understand the Von Neumann architecture
>>
Classes are just collections of related attributes and methods

ignore javatards that try to tell you otherwise and self.360°() out of there
>>
>>59045843
I'd like to learn SmallTalk to see the real power of OOP.
>>
>>59043342
That's wrong on a pretty simple level tho tbqh senpai. Like, that's babby's first explanation.

Classes in python are much more than blueprints for objects.

You can use classes without ever defining methods for instances. Hell, you can use classes without ever defining __init__ or __new__. I use Mixins and multiple inheritance all the time to make sure I write code in one place that gets used by tons of instances. Many of those Mixins never __init__, and some are exclusively class or staticmethod mixins that make no reference to instances.

A great example of that is how you can make a counter shared by all objects of the same class that indicates how many instances of that class are alive. That attribute is a class attribute, not really something for the instance.

You're right, but what you've said is babby's first book on classes, and should be grokable in under 2 months.
>>
>>59043032

You'll understand a big deal about OOP when you completely undersatnd the SOLID principles:
>https://en.wikipedia.org/wiki/SOLID_(object-oriented_design)

[S]ingle responsibility (a class should have only a single responsibility)
[O]pen/closed principle (open for extension, but closed for modification)
[L]iskov substitution principle (code stays correct if you pass a subtype of a class instread of the class)
[I]nterface segregation principle (many client-specific interfaces, no god-class interface)
[D]ependency inversion / Inversion of control (bascially over-enigneered callbacks)
>>
>>59043116
>>59043214
It's destroy u CIA niggers
>>
>>59046301

Rather learn Ruby instead.

It's heavly inspired by SmallTalk and gives you a big deal of what SmallTalk does, but it's not an obscure language nobody uses.

Also the SmallTalk community is super cancerous.
>>
>>59049389
>Learn the language i, some random retard on the internet, suggest you learn.

No.
>>
>>59050756

Dude, I'm pretty langauge agnostic. But if you want "OOP done right", Ruby is the way to go.

SmallTalk has sunken into oblivion, see:
>http://stackoverflow.com/questions/711140/why-isnt-smalltalk-popular

While Ruby is among the most used langauges..
>http://www.tiobe.com/tiobe-index/

..and has plenty of Jobs:
>https://www.indeed.com/q-Ruby-developer-jobs.html


Also just surf some random SmallTalk discussion and see them hating about how great their language is and how bad other langauges are. It's basically the D community in denial.

Also:
>http://www.codethinked.com/what-is-so-great-about-ruby
>>
You might be in the above average class of code monkeys.
>>
>>59043032
>>Tfw it only took me 2 months to understand how classes work in python
>Am i in the upper ranks of genetically gifted programmers?
Well, it took me less than a week to understand classes in all languages, since it just a concept.
How do you feel now?
>>
File: 1463660343479.png (152KB, 1948x858px) Image search: [Google]
1463660343479.png
152KB, 1948x858px
>>59044898
It's actually quite a good idea to start with Python and then switch to something else.
Python teaches you good style and basic programming logic that you can build on with a more advanced language.
>>
>>59051998
I feel sorry for you.
Thread posts: 88
Thread images: 6


[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y] [Search | Top | Home]

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
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 that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.