Open Side Menu Go to the Top

10-01-2015 , 09:50 PM
Sigh. Not 25 pages into Head First Design Patterns and my mind is blown. Everything they taught me about inheritance is wrong!
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **
$25m Guaranteed WPM on CoinPoker
Join the action now
Daily Rewards • Splash Pots • CoinRaces
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **
10-02-2015 , 02:35 AM
Quote:
Originally Posted by Roonil Wazlib
Does anyone here use e-books for learning or reference?

I just bought the Cracking the Coding interview book. I'd, uh, 'legally obtained' a copy of the book on pdf and thought it was pretty good. However, I can't for the life of me think of using e-books for anything other than pleasure reading.

I guess when it comes to learning via book vs tablet, I'm a bit like Giles here:



Maybe I just need more practice with e-books, but there's something about know about how much page thickness there is between me and the answer I'm looking for. I can grab a book, instantly flip to about where I know something should be, start to recognize pictures and paragraph layout, and get to what I need fairly quickly.

Hasn't been true so far with e-books. Might be different if I made notes and left annotations or whatever their solutions are.

Roonil Wazlib,


I feel similarly regarding ebooks. I have downloaded many many ebooks, and I have yet to read a single one all the way through. I probably haven't even read 1/4th of an ebook in my entire life. I've read many physical books, however. I don't know what it is about ebooks, but I just can't force myself to read them.

It's strange, because I read so much on the internet, but I'll open up an ebook, maybe get through a paragraph or two, and then close it.

Cheers!
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
10-02-2015 , 08:24 AM
had another good example of why physical beats e last night. Trying to swap back and forth repeatedly between two pages which were 2-3 pages apart.

Very easy to do physically, something I do all the time, often with 2-4 different passages sectioned off to flip between.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
10-02-2015 , 09:20 AM
Seems you could do the same with bookmarks in your e-reader. You're welcome to your opinion about e-books vs physical books but expecting to be as good with e-books after a couple of months as you are with physical books you've been using for years may be a bit unfair.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
10-02-2015 , 10:36 AM
Quote:
Originally Posted by Roonil Wazlib
Everything they taught me about inheritance is wrong!
FYP
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
10-02-2015 , 02:51 PM
Quote:
Originally Posted by Roonil Wazlib
had another good example of why physical beats e last night. Trying to swap back and forth repeatedly between two pages which were 2-3 pages apart.

Very easy to do physically, something I do all the time, often with 2-4 different passages sectioned off to flip between.
Amazon cloud reader works fine for that actually.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
10-02-2015 , 05:48 PM
Quote:
Originally Posted by Roonil Wazlib
Sigh. Not 25 pages into Head First Design Patterns and my mind is blown. Everything they taught me about inheritance is wrong!
What IYO did they teach you wrong?

Java design patterns are fun until you find yourself copy pasting 40 lines of boilerplate **** and find yourself seriously wondering why there was ever a need for a (insert class here)FactoryFactory. ****'s gone off the rails a bit.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
10-02-2015 , 06:01 PM
School so far has been more about quickly making classes that inherit well, versus classes that are more easily maintainable.

Vastly more focus on inheritance with simple composition than basic inheritance with flexible composition.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
10-02-2015 , 07:11 PM
Quote:
Originally Posted by jmakin
What IYO did they teach you wrong?

Java design patterns are fun until you find yourself copy pasting 40 lines of boilerplate **** and find yourself seriously wondering why there was ever a need for a (insert class here)FactoryFactory. ****'s gone off the rails a bit.
Sometimes factory pattern seems to fall out of some designs naturally. I wrote a program about 6 months ago extracting data from a debug log. The amount of data that was logged was substantial and I was only looking for certain things. We had three test teams that logged the data with possibly five different character encoding formats. I was responsible for determining the root of the problem and coming up with a solution. A factory class to read a line in the encoded character type just fell out naturally. Yes I used inheritance but I also used composition in my solution. I think it is fair to say that deep inheritance hierarchies are considered undesirable but a shallow inheritance hierarchy often comes in quite handy.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
10-02-2015 , 07:25 PM
From one student to another Roonil Wazlib, I think you'll find that computing is basically just finding solutions to problems. In your "wrong" classes, maybe the problem was trying to teach you an inheritance concept rather than worrying about maintainable code. Maintainable code really only comes into play when you're designing software (that's obviously gonna be used and updated) - which sounds like the class you're taking now.

I notice a lot of healthy skepticism in your posts wrt the classes you take but I think you'd get a lot more out of the experience for yourself personally if you just go with it and don't be so quick to throw things out the window because they seem dumb. I know because I do that a lot, just my irrelevant 2c.

Adios,

It's mostly this kind of **** I'm talking about and why people complain about java:

https://ws.apache.org/xmlrpc/apidocs...FactoryFactory
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
10-02-2015 , 07:31 PM
Because I'm being vague I'll post a more specific example of something I thought was dumb/wrong/whatever and caused me to briefly question the credibility of my teachers:

My favorite professor who I had for 3 out of the 4 programming classes I'm required to take used to write his for loops like this:

Code:
 for (int i = 0; i < a.length(); i++)
                  { //body }
The professor for my 4th programming class would have a **** fit about the i < a.length() part because you're slowing down the loop a lot by calling that each time the loop runs. Makes sense. But, my first professor probably realized that in the scope of our class it was irrelevant and not to the point of what he was teaching.

I thought she was being dumb for freaking out about it, til I realized later she's right, then I thought he was dumb for a little while because he didn't care, then I realized I was wrong about that too. Basically everyone is dumb and you're not usually right. That's what school has taught me. Ok that's all I have.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
10-02-2015 , 07:37 PM
"Basically everyone is dumb and you're not always right."

That is some serious **** right there.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
10-02-2015 , 08:57 PM
Quote:
Originally Posted by Larry Legend
"Basically everyone is dumb and you're not always right."

That is some serious **** right there.
Solid motto.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
10-02-2015 , 09:43 PM
Quote:
Originally Posted by jmakin
The professor for my 4th programming class would have a **** fit about the i < a.length() part because you're slowing down the loop a lot by calling that each time the loop runs. Makes sense.
You have a ****ty compiler if it can't optimise that out itself. Working out that a is not mutated during the loop should be routine for a modern compiler.

Typical of computer science academics who are stuck like 20 years in the past and have no clue what matters and doesn't matter anymore.

Regarding inheritance, interfaces are vastly more important these days. If I had to program in C# either never using inheritance or never using interfaces, it wouldn't even be a question.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
10-02-2015 , 09:50 PM
Even in Javascript, which is not compiled, there's a StackOverflow thread about it here. There's a link to a jsperf test. Apparently in IE9 it can matter, but in my version of Chrome the two are identical within margin of error over millions of iterations. Presumably Chrome's JavaScript runtime is smart enough to cache the result. But even in a browser where the execution times are different, it is not going to matter unless you have a huge array.

Like I said, this sort of aspie obsession over detail reveals an ignorance of the things that actually matter in modern programming.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
10-02-2015 , 10:15 PM
Yea believe me I agree and I actually had that discussion with her and it was super counter productive. I think it was because I got marked off on a test for a block that was 4 lines when I could have written it in 3 or something and she told me it was inefficient. But regardless what I was trying to say is give things and viewpoints a chance before you just throw them out, unless your school really sucks, in which case why are you even going to school? The material is out there if you wanna teach yourself.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
10-03-2015 , 12:13 AM
Quote:
Originally Posted by Mihkel05
Solid motto.
I prefer "I hate the people who love me and they hate me!"
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
10-03-2015 , 01:50 AM
Quote:
Originally Posted by jmakin
Yea believe me I agree and I actually had that discussion with her and it was super counter productive. I think it was because I got marked off on a test for a block that was 4 lines when I could have written it in 3 or something and she told me it was inefficient.
lol. I'd have checked whether it compiled to the same executable. The answer would likely be yes.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
10-03-2015 , 04:55 AM
Quote:
Originally Posted by jmakin
Yea believe me I agree and I actually had that discussion with her and it was super counter productive. I think it was because I got marked off on a test for a block that was 4 lines when I could have written it in 3 or something and she told me it was inefficient. But regardless what I was trying to say is give things and viewpoints a chance before you just throw them out, unless your school really sucks, in which case why are you even going to school? The material is out there if you wanna teach yourself.
Yes loops are an obvious place to be aware of but performance tuning is not always necessary. in my view other coding practices should get more emphasis in school.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
10-03-2015 , 01:41 PM
Hmmm my professor taught us about separate chaining in a hash tables with inserting new items in the back of the linked list. Is that ever a valid thing to do? From my point of view, this is more inefficient. From all the info I read online, you are suppose to insert front to keep insertions O(1)...
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
10-03-2015 , 01:48 PM
Oh nevermind, I forgot she does singly linked list with a front and back pointer.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
10-03-2015 , 02:34 PM
@jmakin Sounds like female professor is very immature Or has huge crush on that male professor and wanted you to tell male professor, hoping he comes to her later.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
10-03-2015 , 03:27 PM
Lol, actually it's funny you say that, I've corresponded with both of them a bit via email and I do get that sense.

Barrin's class is with her, I skipped it this semester because I just can't stand her teaching style. I seem to be an outlier though, everyone loves her. I'm hoping next semester a different teacher offers the course.

She was pretty cool to me last semester though, I got an 87.8 or something and she gave me an A for the letter grade. Pretty cool of her because she didn't have to at all.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
10-03-2015 , 04:01 PM
She's super nice but as a teacher, I don't like her as much either. Her data structures class is super watered down. So I find myself having to look elsewhere to teach myself. But that's the nature of community college I guess.

But yea the stuff about checking the size of the loop when we know it never changes, the compiler will optimize that out. I remember reading a random article about that. Luckily I haven't been marked down for that yet.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
10-03-2015 , 04:11 PM
It's so ****ing arbitrary what she'll mark off for. I hate it.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **
$25m Guaranteed WPM on CoinPoker
Join the action now
Daily Rewards • Splash Pots • CoinRaces
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

      
m