Unit Tests and Test-Driven Development

Started by
26 comments, last by OrangyTang 16 years, 1 month ago
// thread safeint add(int a, int b) {  return a + b;}// not thread safeint add(int a, int b) {  static int accumulator;  accumulator = a;  accumulator += b;  return accumulator;}
Advertisement
Quote:Original post by SiCrane
// thread safeint add(int a, int b) {  return a + b;}


There's no memory shared there.

Now try writing an entire program this way. It's not really possible in traditional languages built around the shared memory concurrency model, sadly.
My rating perfectly reflects the pathetic yes-men in-crowd attitude of this forum.
Quote:Original post by truthsayer
There's no memory shared there.

Exactly my point.
Quote:Original post by SiCrane
Quote:Original post by truthsayer
There's no memory shared there.

Exactly my point.


So you're talking about a completely uninteresting and trivial case. Congratulations must be in order.
My rating perfectly reflects the pathetic yes-men in-crowd attitude of this forum.
Quote:Original post by truthsayer
Quote:Original post by SiCrane
// thread safeint add(int a, int b) {  return a + b;}


There's no memory shared there.

Now try writing an entire program this way. It's not really possible in traditional languages built around the shared memory concurrency model, sadly.


lol, get a clue.
"I am a donut! Ask not how many tris/batch, but rather how many batches/frame!" -- Matthias Wloka & Richard Huddy, (GDC, DirectX 9 Performance)

http://www.silvermace.com/ -- My personal website
Quote:Original post by silvermace
lol, get a clue.


You must be that scholar I was looking for.

Care to explain yourself, or are you afraid your ignorance will shine through?
My rating perfectly reflects the pathetic yes-men in-crowd attitude of this forum.
Quote:Original post by truthsayer
[...]There's no memory shared there.[...]
That is exactly my objection to the examples in the articles - they introduce shared memory for no reason, as far as I can tell. Perhaps it's a java thing (as I'm not familiar with all the details of java), but in C++ you could use exactly the same design with exactly the same variables but make it completely thread safe by passing around references to local objects instead of using global ones.
"Walk not the trodden path, for it has borne it's burden." -John, Flying Monk
Doh. Before the thread becomes completely derailed...
A selection of TDD articles over at Games from Within
Quote:Original post by truthsayer
Quote:Original post by silvermace
lol, get a clue.


You must be that scholar I was looking for.

Care to explain yourself, or are you afraid your ignorance will shine through?

Oh man, talk about unfriendliness. SiCrane is one of the more knowledgeable people I know on this forum and I know for a fact that he has no intentions but to help others. Dude, you seriously need to chill out.
Quote:Original post by Ashkan
Quote:Original post by truthsayer
Quote:Original post by silvermace
lol, get a clue.


You must be that scholar I was looking for.

Care to explain yourself, or are you afraid your ignorance will shine through?

Oh man, talk about unfriendliness. SiCrane is one of the more knowledgeable people I know on this forum and I know for a fact that he has no intentions but to help others. Dude, you seriously need to chill out.

Nah, not anymore he doesn't... cus he's banned! Wee!

As far as the object mentor articles go:
Thread safety was not a primary concern when writing them, as threading was not not on the docket as far as concerns go for implementation of the problem they are approaching.

In time the project grows, the ignorance of its devs it shows, with many a convoluted function, it plunges into deep compunction, the price of failure is high, Washu's mirth is nigh.

This topic is closed to new replies.

Advertisement