How do I learn actual object oriented design and best practices?

How do I learn actual object oriented design and best practices?
I mean, I can slap together some code that works but how do I get to know what's good or not?
>inb4 10 years of experience

Attached: 9789332535824.jpg (501x674, 229K)

Other urls found in this thread:

nofile.io/f/xmBjMxb5f7R/work.zip
twitter.com/AnonBabble

Anybody?

>how do I get to know what's good or not?
If it works and it's easily maintainable. The rest is memes.

>it works
it does
>is easily maintainable
i can slap together more code just as easily

Yet I still failed my C++ class because I presumably write "amateur C with Classes" code "from the 80s"

You classes should be nouns. Their properties should be nouns as well. Their methods should be verbs.

OO isn't fundamentally bad, but a lot of the promoted practices are fucking cancer. With OO, the most important thing above all else is to keep it simple.

Java and then go back to C++

Writing C++ in the same way as Java is just about the worst possible way to write C++.

>C++ class
Oh. Well, in that case, stay informed about what kind of code your professors wank to, preferably going to office hours if it isn't clear from the lectures or the study material. I had a professor who used to madly sperg out whenever he saw code "not conforming" to standards (although he had a point in that case, the code was assembly and not properly unwinding the stack can be deadly), and another one who unironically wanted a retarded 3+ level bloated class hierarchy for even the simplest exercises.
Once you pass those classes
>write according to projext/company standards on the job
>write however the fuck you want on personal projects

It's so frustrating, my professor is a perfectionist nazi. I get that he works as a consultant for vmware and he's really fucking good, but he outright spergs out and slaps low results, then says "Try again, and do it nicely this time".
He's trying to be a martial arts sensei instead of a 21st century pedagogue.

Try and learn from him. Most graduates write fucking diabolical code and being competent will give you a huge advantage in the job market.

damn. my profs are chill compared to yours. just had oop this semester and passed with flying colors. just try to follow his instructions as close as possible and try not to skip classes.

He's still 'chill', as in extremely patient with me specifically.
Interviewers in my shitty country start clapping when an intern knows binary search. My prof wants to make fucking bill gates out of us instead.

>My prof wants to make fucking bill gates out of us instead
that's good. try to be patient; he's just doing his job.

>I presumably write "amateur C with Classes" code "from the 80s"
What exactly did you do?

I'm 22 and feel like 32. Just wanna graduate and work for food and shelter.
nofile.io/f/xmBjMxb5f7R/work.zip

Tell me how shit my code is. It's a system that logs keycard-unlocked door entry and exit.

ZIP. Fuck off

???

C++ doesn't fit a pure object oriented design as well as java where literally everything except primitives is already implemented as an object

Your code is ugly as fuck that's the first thing I notice
I don't really feel actually reading it but much but why the fuck do you use "unsigned" without even putting exactly what kinda unsigned type you're using?

I understand that in this case you shouldn't be dealing with negative values but at least write unsigned int

Also can't you use the string class instead of character array for the owner's name?
Look even got a strcpy there, that's probably a big reason why he said you're using amateur C with classes other than the code making people puke

Attached: 1376660613707.jpg (396x304, 11K)

Prof says Strings are banned unless we know exactly how they work and can reimplement them on the fly.

I forgot to add to the "at least write unsigned int"
You could just write int because none of those value are EVER going to be over the maximum signed int value
Hell you could even use an unsigned char but just type fucking int so it can be understood right away that the purpose is to hold a number without interpreting as something else

The control that the values aren't negative is handled by the programmer (the //TODO: Handle wrong input.) not by declaring types as unsigned

That's good, maybe "on the fly" is asking too much though
But I'd ban strcpy as well while at it if that's the reason
Should teach C first though with this reasoning then move to C++

WHAT. Strings in C are literally character arrays with a NULL at the end.

Just add \0 at the end of a char array and read it out as a string.

That's literally what he did all last semester.
I mean string.h string.

God I'm just so confused with this stuff, C seemed so much simpler.

?
We're talking about the string C++ class
In his code they are already character arrays with a '\0' at the end

Prof obviously means being able to implement all the fancy vector-like in the String class

Attached: smart apu.jpg (238x192, 14K)

>Should teach C first though with this reasoning then move to C++

So essentially mimic what harvard does?

If you can't implement a basic copy of std::string yourself even tho you know about the basics of classes then something went wrong with the learning C part

Lol idk about Harvard, that's just what my high school did but I think it is the best way

He want your code to be hosted somewhere on git meme repo site

You can still make private repos, unless privacy means squat with git

>bothering to put broken beginner homework on github even as private
Yeah no. I hope no one is seriously saying OP should do this. The zip is fine.

Sorry, The confusion is real.

Then again, Wasn't the point of the STL lib that it handles everything from copying to begin and endpointers?

>amateur C

>implying

It's worse, isn't it ahha

>complaining about "unsigned"
If nothing is specified after "unsigned", it's an unsigned int. Everyone knows that. Better yet, use uint32_t.

What makes my code ugly as fuck?

test

Leaving aside that there is no need to make the int unsigned, it's just not good not to specify the type man

>10 years of experience
this

yeah but imo Java is the most pure OO language. everything is a class! it forces you into OO thinking

Any good books on Python and OOP? I haven't really found anything besides the basics.

POO

Huh, Jow Forums's full of lamers and larpers today. Read the following, and do it more than once. Especially the introductory chapters. Design Patterns by Gamma et al. If you can get it cheap, read Don Box' book on COM as well, though it's not an easy read.

Attached: 1418084776304.jpg (404x267, 32K)

and teenage boomers, it's full of them, too

I've read excerpts from it but that is advanced theory. I want basic design theory, as in, how not to suck.

just give me pastebin i wont download shit