Quantcast

Maximum PC

It is currently Sat Dec 27, 2014 2:55 am

All times are UTC - 8 hours




Post new topic Reply to topic  [ 65 posts ]  Go to page Previous  1, 2, 3, 4  Next
Author Message
 Post subject: Re: Seven Languages in Seven Weeks and some other things...
PostPosted: Tue Jun 21, 2011 9:14 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:
Quote:
Otherwise, you could just return a delegate. I don't see why you would really need that though?

I'm sure there's a need for it somewhere. :P

It's kind of a chicken and egg thing...


Top
  Profile  
 
 Post subject: Re: Seven Languages in Seven Weeks and some other things...
PostPosted: Wed Jun 22, 2011 4:15 am 
SON OF A GUN
SON OF A GUN
User avatar

Joined: Mon Nov 01, 2004 5:41 am
Posts: 11605
Gadget wrote:
CrashTECH wrote:
My IDE can insert opening and closing braces and parens for me. The semi-colon is really a non-issue. One keystroke with marginal distance from where my fingers are :)

Uh, you do realize that a paren is a single keystroke too, right? =)
No, no it isn't. :) Shift + 9 and Shift + 0. Looks like two to me :)

Gadget wrote:
Just out of curiosity, what are you actually trying to compare? Lisp certainly has 'programming in the large' facilities like packages and system definition functionality if that is what you're wondering.
I am sure it does. I just don't know how our experience can be compared, since it is obviously very different (and likely why we are such a differing opinion!)

Part of me feels stupid and weak, but I had decided long ago that I wanted to make money. Which meant I likely wouldn't do anything super interesting. I KNOW my skills have dulled since college, and they weren't razor sharp to begin with. I could figure things out and understand them, it just took a lot longer than it did for most of my peers. I went to school with some pretty fucking smart people.

It was interesting, because one of our professors pointed it out to us. He said that was why we often argued over things. Because we were all smart people, and we knew it. It was some what intimidating at times to be on the lower end (ok, really more about the dead middle of the pack) of that group (thankfully not the bottom!).


Top
  Profile  
 
 Post subject: Re: Seven Languages in Seven Weeks and some other things...
PostPosted: Wed Jun 22, 2011 5:23 am 
Bitchin' Fast 3D Z8000
Bitchin' Fast 3D Z8000
User avatar

Joined: Mon Jun 14, 2004 4:04 pm
Posts: 987
Location: Earth
Quote:
Part of me feels stupid and weak, but I had decided long ago that I wanted to make money. Which meant I likely wouldn't do anything super interesting. I KNOW my skills have dulled since college, and they weren't razor sharp to begin with. I could figure things out and understand them, it just took a lot longer than it did for most of my peers. I went to school with some pretty fucking smart people.


I think most programmers feel this way until we surround ourselves with smart and interesting people. The two days I spent in Berlin with a bunch of Ruby guys (met up for a Ruby conference), I ended up hanging out (and drinking a lot of beer) with some of the smartest people in the world. I met Matz (creator of Ruby), met the creator of MagLev (distributed Ruby) and a bunch of other folks who come from very diverse computing backgrounds. It's both intimidating and awesome when you speak of something and it gets validated by the smartest in that field.
Funny enough, they thought my experience as a C# guy seeing Ruby for the first time was interesting. I talked about how Ruby's meta-programming was clearly a magnitudes over C#'s (define_method and method_missing are really powerful), and it was great to hear smart people validating your train of thought. :P

This is why I'm going open source; the projects are there and the movement in F/OSS is fast. They innovate fast, they're always looking for the next big thing. I found that sticking with the MSFT tech stack has left me bored and I know my skills has dulled as well.


Top
  Profile  
 
 Post subject: Re: Seven Languages in Seven Weeks and some other things...
PostPosted: Mon Jun 27, 2011 8:40 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
CrashTECH wrote:
I just don't know how our experience can be compared, since it is obviously very different

Is it necessary? It would probably be more constructive for both of us to argue objectively about the merits of different IDEs, languages, computing paradigms, etc. And others would certainly benefit more from those conversations as well. =)

Regarding your background, trust me, everyone feels this way at some point in their education/careers. After all, you can't be the smartest person in the room at everything. I scored closed to the 100th percentile on the math section of the GRE, and believe me when I tell you that I have felt extremely anxious during weekly meetings with professors. The real trick is to benefit as much as possible from all the hard-work other smart people have put into developing different aspects of the field whether it be research or business app related.

CrashTECH wrote:
<snip>I had decided long ago that I wanted to make money. Which meant I likely wouldn't do anything super interesting.

Oh, I don't know about that one. Pursuing 'interesting' projects or work doesn't mean forgoing money. Hell, most interesting tech companies were started by people during their PhD and/or subsequent research (Google, Yahoo, Akamai, iRobot, RSA, etc). I suspect that you're just more comfortable working in a large company environment than a small company or research lab. Also, it can take quite a bit of time and effort to find a problem(s) that make you want to spend time away from the family, regular hobbies or the security of a salaried job. In many respects, it is much more difficult than finding a first job.

BTW, this is turning into an interesting tangent.


Top
  Profile  
 
 Post subject: Re: Seven Languages in Seven Weeks and some other things...
PostPosted: Mon Jun 27, 2011 8:53 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:
This is why I'm going open source; the projects are there and the movement in F/OSS is fast. They innovate fast, they're always looking for the next big thing. I found that sticking with the MSFT tech stack has left me bored and I know my skills has dulled as well.

In general, I wouldn't say that F/OSS is faster. If anything, it tends to be a slower and broader front than most proprietary corporate projects (stealing a line from Eric Raymond here). It is a great way for companies or researchers to appeal to a larger developer audience (Google APIs and the Plan9 OS come to mind) and offset maintenance costs (bug hunters, porting code, maintaining code that is no longer economical to maintain, etc). You rarely see a companies 'secret sauce' being released into the wild. Given the breadth of F/OSS, we could be thinking of different things though.


Top
  Profile  
 
 Post subject: Re: Seven Languages in Seven Weeks and some other things...
PostPosted: Tue Jun 28, 2011 10:35 am 
Bitchin' Fast 3D Z8000
Bitchin' Fast 3D Z8000
User avatar

Joined: Mon Jun 14, 2004 4:04 pm
Posts: 987
Location: Earth
Gadget wrote:
... Given the breadth of F/OSS, we could be thinking of different things though.


We may as well be. :)

I meant stuff like nginx, jQuery, Rails, node.js...all are F/OSS projects that are backed by a large community base. Rails moves fast: this year at RailsConf, DHH (the creator of Rails) already announced 3.1 when it feels like 3.0 was just released. Five years ago, if you had told me that we would be able to write a web server that uses javascript, I would have laughed at your face and took back that beer I just bought you. Now, node.js makes it possible. I guess it depends on the project, but F/OSS now has movements that are going faster than the commercial ones.


Top
  Profile  
 
 Post subject: Re: Seven Languages in Seven Weeks and some other things...
PostPosted: Thu Jun 30, 2011 1:47 pm 
SON OF A GUN
SON OF A GUN
User avatar

Joined: Mon Nov 01, 2004 5:41 am
Posts: 11605
Gadget wrote:
Also, it can take quite a bit of time and effort to find a problem(s) that make you want to spend time away from the family, regular hobbies or the security of a salaried job. In many respects, it is much more difficult than finding a first job.
I really can't say that there would be much that could do this to be honest.


Top
  Profile  
 
 Post subject: Re: Seven Languages in Seven Weeks and some other things...
PostPosted: Wed Jul 06, 2011 4:18 am 
SON OF A GUN
SON OF A GUN
User avatar

Joined: Mon Nov 01, 2004 5:41 am
Posts: 11605
Interesting article: http://shootout.alioth.debian.org/u64q/ruby.php


Top
  Profile  
 
 Post subject: Re: Seven Languages in Seven Weeks and some other things...
PostPosted: Thu Jul 07, 2011 3:12 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
CrashTECH wrote:

Stirring the pot a bit there, huh? =)

For shigs and gittles, I went ahead and put the information on what I believe is all languages on all machines into a spreadsheet to do a little more analysis (I don't like their box plots... data is from here). I then added some extra dimensions to the data and started playing around a bit.

The categories that I added were "performance fade", which is just the ratio of the worst time divided by the best time for a given language (if I had been awake this morning I would have (hopefully) done variance or std dev... oh well). I also added categories for language type ([functional, procedural, concurrent, etc]) and object file type ([native, either, virtual, interpreted]). Since I haven't looked at the actual code for any language, I've basically guessed the likely paradigm for some of the multi-paradigm languages and object file types (eg functional for lisp). I later decided to remove some of the languages which I'm not familiar (ie ATS, Go, Scala, OCaml). This is obviously a bit of a wonky guessing game, but at least I'm not blindly guessing in the dark with languages like ATS.

Here is the raw data so far...
Code:
Language    |-    |---   25%   median   75%    ---|    -|   Performance Fade   Paradigm Type   Object File Type
Ada 2005 GNAT   1   1   1.05   1.26   1.98   3.39   4.66   4.66   Procedural   Native
C GNU gcc   1   1   1   1.07   1.45   2.13   4.28   4.28   Procedural   Native
C# Mono   1.79   1.79   2.08   2.95   8.26   13.11   13.11   7.32   Obect Oriented   Either
C++ GNU g++   1   1   1   1.19   1.37   1.59   1.59   1.59   Procedural   Native
Clojure   1.65   1.65   3.36   5.32   9.44   15.74   15.74   9.54   Functional   Virtual
Erlang   4.48   4.48   21.25   27.64   48.34   88.97   144.64   32.29   Concurrent   Native
Erlang HiPE   5.17   5.17   6.65   13.17   19.6   39.03   47.3   9.15   Concurrent   Native
F# Mono   2.41   2.41   3.11   9.16   22.48   35.76   35.76   14.84   Functional   Either
Fortran Intel   1   1   1.39   3.89   8.72   19.72   22.03   22.03   Procedural   Native
Haskell GHC   1.68   1.68   3.4   5.26   9.78   14.16   14.16   8.43   Functional   Native
Java 6 -server   1.32   1.32   1.42   1.59   2.05   2.47   2.47   1.87   Obect Oriented   Virtual
Java 6 averaged   1.33   1.33   1.33   1.44   1.81   2.18   2.18   1.64   Obect Oriented   Virtual
Lisp SBCL   1.02   1.02   1.16   1.74   6.74   9.79   9.79   9.60   Functional   Either
Pascal Free Pascal   1.55   1.55   2.21   3.32   8.25   17.32   20.56   13.26   Procedural   Native
Python 3   1.05   1.05   4.52   28.07   83.54   198.5   198.5   189.05   Procedural   Interpreted
Ruby 1.9   3.59   3.59   10.94   65.14   108.31   254.37   329.66   91.83   Multi   ???
Ruby JRuby   5.52   5.52   25.98   66.81   148.62   301.88   301.88   54.69   Multi   Virtual


Some initial observations:

1. How on earth does Intel's Fortran compiler produce a 1 in the best case, a 3 at the median, and a worst-case of 22? Given the quality of this compiler and the high-performance nature of this language, I find that rather perplexing. I'm going to look into this at some point -- Something smells here.

2. I would have expected a higher variation for C# than F# (due to functional programming vs procedural) but the data says otherwise.

3. I also wouldn't have expected the variance in C++ to be lower than C. Based on other similar benchmarks of this type, I would have never expected Java to have a low variance. This is one of the things that Lisp programmers killed Java programmers with here.

4. What the hell is going on with Erlang? I expected it to perform in the C / C++ neighborhood. Maybe it is just the type of benchmarks being tested.

I'll post some numbers on the paradigm and object file types after I can verify some things about the benchmarks. Also, this probably should be the start of a new thread. I'll let the rest of you decide.


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

Joined: Mon Jun 14, 2004 4:04 pm
Posts: 987
Location: Earth
Quote:
What the hell is going on with Erlang? I expected it to perform in the C / C++ neighborhood. Maybe it is just the type of benchmarks being tested.


Nothing at all. Erlang's not designed for speed. However, it is designed for stability, scalability and robustness. Erlang was never really designed to perform like you would in C/C++ apps but goodness, what it lacks in speed it more than makes up for in stability.


Top
  Profile  
 
 Post subject: Re: Seven Languages in Seven Weeks and some other things...
PostPosted: Sat Jul 09, 2011 12:36 pm 
SON OF A GUN
SON OF A GUN
User avatar

Joined: Mon Nov 01, 2004 5:41 am
Posts: 11605
This thread is fine. I mean, it is about comparing languages yes?

Btw, me, stir the pot? NEVER! I would NEVER! How dare you accuse me :)


Top
  Profile  
 
 Post subject: Re: Seven Languages in Seven Weeks and some other things...
PostPosted: Sun Jul 17, 2011 6:24 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:
Quote:
What the hell is going on with Erlang? I expected it to perform in the C / C++ neighborhood. Maybe it is just the type of benchmarks being tested.

Nothing at all. Erlang's not designed for speed. However, it is designed for stability, scalability and robustness. Erlang was never really designed to perform like you would in C/C++ apps but goodness, what it lacks in speed it more than makes up for in stability.

I just finished reading the Wikipedia article on Erlang and must say that I'm a bit surprised with the language. Erlang was originally implemented in Prolog. Not only does Erlang retain a strong syntatic similarity to Prolog, but it is clearly meant to be a type of logic language (I'm not sure to what degree though). What you lose in performance, you probably more than make up for in usability and robustness as you stated. Interesting language.


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

Joined: Mon Jun 14, 2004 4:04 pm
Posts: 987
Location: Earth
Gadget wrote:
I just finished reading the Wikipedia article on Erlang and must say that I'm a bit surprised with the language. Erlang was originally implemented in Prolog. Not only does Erlang retain a strong syntatic similarity to Prolog, but it is clearly meant to be a type of logic language (I'm not sure to what degree though). What you lose in performance, you probably more than make up for in usability and robustness as you stated. Interesting language.


This is a good read about Erlang's robustness.

http://www.erlang-factory.com/upload/pr ... ooters.pdf

In essence, Erlang was written to support an online multiplayer environment. They have around 100+ Dell RC610's running in a clustered setting and with Erlang, they can support up to 10 million users? This is why XMPP (the open source messaging protocol) is written in Erlang, so is CouchDB and the backend of Github.

You're right about robustness; but honestly is speed so important that you trade it in for robustness? In my line of work, I'll take robust over fast. Also, Erlang throws in a LOT of neat stuff like distribution that you would have to think about when writing a similar type of system in C. Erlang had it figured out, so why reinvent the wheel?


Top
  Profile  
 
 Post subject: Re: Seven Languages in Seven Weeks and some other things...
PostPosted: Mon Jul 18, 2011 7:01 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:
You're right about robustness; but honestly is speed so important that you trade it in for robustness? In my line of work, I'll take robust over fast. Also, Erlang throws in a LOT of neat stuff like distribution that you would have to think about when writing a similar type of system in C. Erlang had it figured out, so why reinvent the wheel?

I think you hit the nail on the head with 'in my line of work'. Priorities really depends on the project, and I think many projects are not using languages that best meet the projects requirements. I'd love to see more positions that involve languages besides Java, C# and C++.


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

Joined: Mon Jun 14, 2004 4:04 pm
Posts: 987
Location: Earth
Gadget wrote:
DJSPIN80 wrote:
You're right about robustness; but honestly is speed so important that you trade it in for robustness? In my line of work, I'll take robust over fast. Also, Erlang throws in a LOT of neat stuff like distribution that you would have to think about when writing a similar type of system in C. Erlang had it figured out, so why reinvent the wheel?

I think you hit the nail on the head with 'in my line of work'. Priorities really depends on the project, and I think many projects are not using languages that best meet the projects requirements. I'd love to see more positions that involve languages besides Java, C# and C++.


I have friends who worked in algorithmic trading and they require speed, so they wrote majority of their software in C/C++. I honestly never really understood the logic behind it, Erlang can do the job better since the distributive nature and multi-processor/core requirements come for free. I guess they required speed and kept their data sets simple to improve robustness.

Since I work in healthcare, I would love to see more projects built on robust frameworks. We're not really building software in healthcare to meet project requirements, I find that we often just build software on tools that MSFT tells us that we need to build our stuff off of.


Top
  Profile  
 
 Post subject: Re: Seven Languages in Seven Weeks and some other things...
PostPosted: Thu Jul 21, 2011 1:18 am 
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 have friends who worked in algorithmic trading and they require speed, so they wrote majority of their software in C/C++. I honestly never really understood the logic behind it, Erlang can do the job better since the distributive nature and multi-processor/core requirements come for free. I guess they required speed and kept their data sets simple to improve robustness.

Depends. If they're focusing on high-frequency trading, which often involves quickly responding to news events, relative changes in price or incorrect pricing between different financial instruments (ie arbitrage), they need to minimize latency which doesn't seem like a good match for Erlang. If they're attempting to do something more complicated in terms of computation like finding patterns, they might be hooking their code into existing mathematical software like Matlab which has good support for C/C++ integration. I suspect they're doing the former, but in either case, Erlang probably isn't the best fit. Also, unless they're a giant hedge fund, they're probably only trading during 'business hours'. They don't need extremely high reliability or hot-swappable code.

Now if they were going to open their own exchange.... Erlang sounds like a really good match! ;)

DJSPIN80 wrote:
Since I work in healthcare, I would love to see more projects built on robust frameworks. We're not really building software in healthcare to meet project requirements, I find that we often just build software on tools that MSFT tells us that we need to build our stuff off of.

LOL... I actually haven't seen or heard of that happening before. Were you working with MS consultants or what?


Top
  Profile  
 
 Post subject: Re: Seven Languages in Seven Weeks and some other things...
PostPosted: Thu Jul 21, 2011 4:03 am 
Bitchin' Fast 3D Z8000
Bitchin' Fast 3D Z8000
User avatar

Joined: Mon Jun 14, 2004 4:04 pm
Posts: 987
Location: Earth
Gadget wrote:
Depends. If they're focusing on high-frequency trading, which often involves quickly responding to news events, relative changes in price or incorrect pricing between different financial instruments (ie arbitrage), they need to minimize latency which doesn't seem like a good match for Erlang. If they're attempting to do something more complicated in terms of computation like finding patterns, they might be hooking their code into existing mathematical software like Matlab which has good support for C/C++ integration. I suspect they're doing the former, but in either case, Erlang probably isn't the best fit. Also, unless they're a giant hedge fund, they're probably only trading during 'business hours'. They don't need extremely high reliability or hot-swappable code.

Now if they were going to open their own exchange.... Erlang sounds like a really good match! ;)


Actually, now that I think about it...yeah, they relied on getting prices quickly. They traded mostly commodities and they were looking for low latency to trade as quickly as possible since they were trading sometimes in the pennies (or even fractions of pennies). You're right though, Erlang wouldn't be a good fit.

Gadget wrote:
LOL... I actually haven't seen or heard of that happening before. Were you working with MS consultants or what?


Yes and no. We work with MSFT consultants when there's a product we need but we don't know what it is. :P I work in the administrative side of the hospital, so I never touch the clinical side. Healthcare has an interesting curse to it; the software written in healthcare is generally written by a bunch of obtuse morons who never bothered learning anything above VBA. I kid you not, I know of cancer registry software that uses an Access Database in the backend. I was miffed, then I realized to complicate things more, they actually went one step further and used Access to write to a SQL Server database. They have no plans to upgrade the software to .NET and 64-bit, Windows XP is the best they'll do.

When I said that we build stuff according to what MSFT tells us, well, in reality we build stuff according to the tools they give us. MSFT doesn't support Erlang or Ruby or Python, let alone finding ways to make it talk to Microsoft apps. So whenever I need to build something, I'm stuck with the tools MSFT has in their toolbox. We're a pretty MSFT driven shop and going open source is barely an option.


Top
  Profile  
 
 Post subject: Re: Seven Languages in Seven Weeks and some other things...
PostPosted: Thu Jul 28, 2011 4:43 am 
SON OF A GUN
SON OF A GUN
User avatar

Joined: Mon Nov 01, 2004 5:41 am
Posts: 11605
http://blog.rubybestpractices.com/posts ... dogma.html

This guy has some good points, some which I failed to be able to articulate:

Quote:
Today I have a small rant about the test obsessed culture of Ruby. This area in particular is one in which the incredible enthusiasm surrounding the methodology seems to have outpaced the individual practitioner’s ability to evaluate its utility. I’m not just talking about beginners here, but seasoned professionals as well. The sheer volume of rapidly changing testing tools and techniques is an indicator that we’re nowhere near convergence, but that doesn’t stop many from describing automated testing, particularly in the Behavior Driven Development style, as if it were some sort of magic bullet. It isn’t.


Top
  Profile  
 
 Post subject: Re: Seven Languages in Seven Weeks and some other things...
PostPosted: Thu Jul 28, 2011 6:36 am 
Bitchin' Fast 3D Z8000
Bitchin' Fast 3D Z8000
User avatar

Joined: Mon Jun 14, 2004 4:04 pm
Posts: 987
Location: Earth
CrashTECH wrote:
http://blog.rubybestpractices.com/posts/gregory/050-issues-18-testing-dogma.html
This guy has some good points, some which I failed to be able to articulate:


He has good points but I still digress.

Quote:
But I can also tell you that uses all the latest and greatest tools and techniques, and attempting to “test all the fucking time” on large scale, long running projects, has actually hurt rather than helped me at times.


I fail to see how. Tools like RSpec, Steak (I met the creators of Steak.fm, actually, nice guys), and Cucumber is to make testing more logical and read like a requirements document. While there is a certain of level of testing that is unacceptable - like testing database connectivity or the creation of cookies - tests should focus on the important parts of the logic. The problem with the argument we're having is that tests is left to the developer. We can all agree on testing, it's the methodology and even the granularity of our tests that we can't seem to agree on. But hey, it's the differences in opinion that make this country great. ;)

Quote:
Personally, I’ve found testing to get in the way when I’m first exploring a new project. I almost always spend a couple hours writing absolutely crappy code without any tests at all. Test-first development does help drive interfaces and forces you to think about API design continuously, but it can only really be used to attain a local maximum.


So does the inverse of it. When I explore new things, I don't really write tests for it. I begin to write tests when I want to understand it. It also depends on what kind of thing I'm working on. If it's a new product or something for fun, I generally skip tests. If it's algorithmic in nature, I write tests. If I'm serious into putting together a real project, then I implement tests. His argument of a local maximum is kind of off, IMO and it contradicts his first statement. The problem is what kind of development are you doing? If your goal is to putz around and try new things, sure, go right ahead and skip tests...but if I'm evaluating a library, you better bet your bottom dollar that I will test it.

Quote:
I don’t test complex interactions with users within a system, unless I begin to frequently write code that has system-wide effects. I’ve definitely been in situations in which integration tests have been vital, but they’ve been far and few in between. Part of this is because the projects I work on tend to be deeper than they are wide, but it’s also because I just trust my design capabilities enough to not introduce too many changes that could break more than one part of my application at a time. I feel like the majority of integration testing goes into way too much detail about the expected paths through a system, and as a result, forces a bunch of false-negatives as minor changes that shouldn’t affect users end up breaking tests.


Honestly, he may not need to rethink his tests, he may need to rethink his architecture. Judging based on what he's talking about, complex interactions should have been abstracted as messages. The problem I had with this statement is that he retailors his tests when he should have looked at the architecture. When you get into complex object interactions, sometimes, message passing is easier because it decouples objects from one another. Your integration tests are simple: test the message pass and the behavior, rather than testing the interaction itself. Those false negatives stem from the fact that his objects are tightly coupled - and false negatives are awful because they're misleading to the developer. It's almost a trade-off; testing is a kind of development effort, so you might as well architect well.

Quote:
Note that in the above, I didn’t imply that testing results in writing better code. I also specifically avoided claiming that tests will help you avoid defects in the first place. While I think that occasionally testing contributes to accomplishing these two things, it really depends on the project as well as the individual developer’s skill level and coding style. I also didn’t claim that writing tests saves time or money. I don’t think it actually does, and I wouldn’t trust that claim until I saw some concrete evidence.


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.


Top
  Profile  
 
 Post subject: Re: Seven Languages in Seven Weeks and some other things...
PostPosted: Thu Jul 28, 2011 7:14 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
CrashTECH wrote:
http://blog.rubybestpractices.com/posts/gregory/050-issues-18-testing-dogma.html

This guy has some good points, some which I failed to be able to articulate:

Quote:
Today I have a small rant about the test obsessed culture of Ruby. This area in particular is one in which the incredible enthusiasm surrounding the methodology seems to have outpaced the individual practitioner’s ability to evaluate its utility. I’m not just talking about beginners here, but seasoned professionals as well. The sheer volume of rapidly changing testing tools and techniques is an indicator that we’re nowhere near convergence, but that doesn’t stop many from describing automated testing, particularly in the Behavior Driven Development style, as if it were some sort of magic bullet. It isn’t.

When I read the article, I came away with the impression that he favors the type of testing that DJ Spin and I have been articulating. I agree with the sentiment that automated unit testing isn't a magic bullet, but it sure beats the hell out of the alternative... "Yeah, I've been too lazy to retest this sloppy piece of code. I think it has been three years now."

Quote:
Some tests are a waste of time, and other tests can be actively harmful. If you have ever experienced the pain of refactoring a test suite in which someone overzealously mocked everything except for the object under test, simply to ‘decouple the tests from the implementation code’, you probably have an idea of what I mean.

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.

In his latern vs laser analogy all he is really doing is advocating an informal type of prototyping. It is also subjective. Personally, I wish more people spent ANY amount of time using a whiteboard to think about a problem before writing their crappy code (and subsequently discovering the problems in their crappy code), but it doesn't really matter as long as you're willing to refactor the code (and in some cases completely rewrite). What I hate is when people realize that their crappy code is solving a problem inefficiently, say O(n^2) vs O(n), but they're dead set against rewriting the code because they've already spent three hours writing their crap code. Writing a few unit tests after doing some prototyping to flesh out the API is almost certainly helpful.


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

All times are UTC - 8 hours


Who is online

Users browsing this forum: No registered users and 2 guests


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

© 2014 Future US, Inc. All rights reserved.