Quantcast

Maximum PC

It is currently Thu Apr 17, 2014 8:37 pm

All times are UTC - 8 hours




Post new topic Reply to topic  [ 65 posts ]  Go to page Previous  1, 2, 3, 4
Author Message
 Post subject: Re: Seven Languages in Seven Weeks and some other things...
PostPosted: Thu Jul 28, 2011 7:29 pm 
Bitchin' Fast 3D Z8000*
Bitchin' Fast 3D Z8000*
User avatar

Joined: Tue Jun 29, 2004 11:32 pm
Posts: 2555
Location: Somewhere between compilation and linking
DJSPIN80 wrote:
The one part I definitely agree on! However, writing tests creates a contract. I argued this with another guy from twitter who didn't agree with the open/closed principle. The problem is that objects, invariably, have a contract. Their signatures are their method behaviors, and the contract is that the object will behave as expected. Tests enforce this behavior, so it solidifies the contract between developer and object.

This is true of procedural and functional programming as well. If a function doesn't perform as expected, it is violating a 'contract' with the user.

I like your point about algorithmic code needing more unit tests. Often the problem bad programmers have with writing a unit test is their algorithms are surrounded by three layers of other stuff. The focus in most companies is so oriented towards a top-down design, often used for budgeting, that the programmers fail to think about any of the bottom-up design aspects, hence they never break down their modules to the 'atomic level' of a unit where code is easily tested. Typically, they also never have internal libraries (90% of the teams that I have worked with). They just copy and paste the same crap code over and over ad infintum.


Top
  Profile  
 
 Post subject: Re: Seven Languages in Seven Weeks and some other things...
PostPosted: Fri Jul 29, 2011 5:07 am 
Bitchin' Fast 3D Z8000
Bitchin' Fast 3D Z8000
User avatar

Joined: Mon Jun 14, 2004 4:04 pm
Posts: 985
Location: Earth
Quote:
Yes, and unfortunately, you do see this crap occasionally. They're usually the guys who can't solve an easy top coder problem within an hour, but will gladly take an hour to explain why the 13 design patterns they used to parse a simple test file are necessary. They're obsessed with decoupling everything, design patterning everything, middleware everything, documenting everything. All this guy is really saying is that unit testing isn't idiot proof.


[offtopic]BTW, I'm officially gonna recommend TopCoder to any newbie wanting to learn a language.[/offtopic]

What you described above was my time at JPMorgan Chase. ;)

I always struggled comprehending developers. When I came out of college, I knew all these algorithmic stuff but not patterns...in the real world (at least at Chase), they told me that the Pattern gods would hate me if I didn't include at least one pattern in my code.

I never really learned patterns, I don't really implement them in my code base but my obsession to decouple everything stems from creating simple objects. Less is more, I say. It's easier to test and mock decoupled objects. I prefer to test behavior and making sure that my objects do as they're supposed too.


Top
  Profile  
 
 Post subject: Re: Seven Languages in Seven Weeks and some other things...
PostPosted: Fri Jul 29, 2011 5:12 am 
Bitchin' Fast 3D Z8000
Bitchin' Fast 3D Z8000
User avatar

Joined: Mon Jun 14, 2004 4:04 pm
Posts: 985
Location: Earth
Gadget wrote:
I like your point about algorithmic code needing more unit tests. Often the problem bad programmers have with writing a unit test is their algorithms are surrounded by three layers of other stuff. The focus in most companies is so oriented towards a top-down design, often used for budgeting, that the programmers fail to think about any of the bottom-up design aspects, hence they never break down their modules to the 'atomic level' of a unit where code is easily tested. Typically, they also never have internal libraries (90% of the teams that I have worked with). They just copy and paste the same crap code over and over ad infintum.


One of the Rails philosophies is DRY code (Don't Repeat Yourself). I wrote an internal library at work, and it's tested. All of my active directory libraries? tested. My object extension methods? tested. I have more faith in my libraries because I've tested these systems. If I make a change, it's tested. Bugs are tested as well.

I test the behavior of objects since it makes logical sense. There are aspects of my library that are algorithmic (i.e., I use a BST algorithm to search for individuals in my AD library), so I try to test those granularly.


Top
  Profile  
 
 Post subject: Re: Seven Languages in Seven Weeks and some other things...
PostPosted: Fri Jul 29, 2011 1:49 pm 
Bitchin' Fast 3D Z8000*
Bitchin' Fast 3D Z8000*
User avatar

Joined: Tue Jun 29, 2004 11:32 pm
Posts: 2555
Location: Somewhere between compilation and linking
DJSPIN80 wrote:
I never really learned patterns, I don't really implement them in my code base but my obsession to decouple everything stems from creating simple objects. Less is more, I say. It's easier to test and mock decoupled objects. I prefer to test behavior and making sure that my objects do as they're supposed too.

I haven't taken a course that really covered design patterns in depth either. I basically learned a handful of them on my own, during my free time, while working at Boeing. I found one of the biggest benefit of the patterns to be they allowed me to get away with documenting a design less verbosely. We didn't really do any real UML diagramming, so the patterns helped in that regard as well. I'm always amazed by the people who advocate design patterns, yet fail to create their own library, they obviously missed the whole "reusable part" of the book!


Top
  Profile  
 
 Post subject: Re: Seven Languages in Seven Weeks and some other things...
PostPosted: Sat Jul 30, 2011 9:32 am 
Bitchin' Fast 3D Z8000
Bitchin' Fast 3D Z8000
User avatar

Joined: Mon Jun 14, 2004 4:04 pm
Posts: 985
Location: Earth
Gadget wrote:
I haven't taken a course that really covered design patterns in depth either. I basically learned a handful of them on my own, during my free time, while working at Boeing. I found one of the biggest benefit of the patterns to be they allowed me to get away with documenting a design less verbosely. We didn't really do any real UML diagramming, so the patterns helped in that regard as well. I'm always amazed by the people who advocate design patterns, yet fail to create their own library, they obviously missed the whole "reusable part" of the book!


One of the architects I worked with was pattern obsessed. Everything had to have a pattern in it, forgoing the fact that the stuff they built before I arrived were complex implementations of a simple problem. I like patterns because it does allow for less verbiage in documentation but a reusable library carries more value than patterns. I do think that behavioral patterns have the most amount of value. I use the Null object pattern religiously - especially since I use a lot of POCO (Plain Old CLR Object) in my code.


Top
  Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 65 posts ]  Go to page Previous  1, 2, 3, 4

All times are UTC - 8 hours


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group