« first day (1792 days earlier)      last day (3203 days later) » 

1:25 AM
a gallon of beer a day, and they wonder why they had a problem with drunkenness.
Man, if I had a gallon of beer to drink a day, I wouldn't get anything done.
 
user20683
1:53 AM
@Ampt small beer
 
user20683
which is like 1-2% alcohol
 
3:22 AM
@WorldEngineer that's still roughly 2 shots of straight grain alcohol (95%) or 4-5 shots of your off the shelf whiskey
 
user20683
@Ampt I don't think we're using the same numbers
 
user20683
in any case, it is time for bed. I am a tired vortex of doom
 
@WorldEngineer 1 english gallon is 1.2 english gallons, at 2% alcohol, is about 3 ounces of straight 100% alcohol
at an ounce and a half per shot, that's a decent amount of alcohol
 
user15026
I just like that I understand what small beer is now.
 
I'd be interested to know the strength of the beer they were drinking too - something in me doubts that it was 1-2% - that's a tiny beer by any standard.
I'm going to have to do some digging - I've got some books on the history of beer
maybe I can find a recipe or something in there so as to indicate the strength of the average beer back then
 
 
1 hour later…
5:25 AM
this might be a conceptual program much better suited for programmers.stackexchange.comMichael Dautermann 39 secs ago
 
 
2 hours later…
7:22 AM
You should probably also delete this question off stackoverflow and move it to programmers. — Jonny Henly 50 secs ago
 
7:37 AM
@JonnyHenly pardon my ignorance but what is in the scope of stackoverflow and what belongs to programmers? — GOR 23 secs ago
 
7:51 AM
hmm I thought stackoverflow's "What topics can I ask about here?" mentioned something about programmers.stackexchange but apparently I was wrong. Although taking a look at programmers' "What topics can I ask about here?", it becomes clear that programmers is a better fit for this type of question. I would just leave it here though, I don't think it's breaking any rules : ) — Jonny Henly 11 secs ago
 
 
2 hours later…
9:35 AM
@Jamiec : code review is for existing, complete, working code. Design questions are more at home at programmers.stackexchange.com imho. — cosmo0 34 secs ago
 
 
2 hours later…
11:24 AM
This site is for programmers to help each other develop. It is not a site for people seeking free code. Try putting "Bid for programming tasks" into your favourite search engine. You will get sites where you can post a requirement and programmers will quote for the implementation. — Tony Dallimore 31 secs ago
 
 
1 hour later…
12:41 PM
Happy Coffee Day!
 
Happy coffee day indeed
 
user55340
12:52 PM
Sad Black Tot day. Go drink some rum at 6 bells.
 
user55340
Black Tot Day (July 31, 1970) is the name given to the last day on which the Royal Navy issued sailors with a daily rum ration (the daily tot). In the 17th century the daily drink ration for English sailors was a gallon of beer. Due to the difficulty in storing the large quantities of liquid that this required in 1655 a half pint of rum was made equivalent and became preferred to beer. Over time drunkenness on board naval vessels increasingly became a problem and the ration was formalised in naval regulations by Admiral Edward Vernon in 1740 and ordered to be mixed with water in a 4:1 water to...
 
@MichaelT I'll take my gallon of beer, please!
 
@MichaelT At 6am? I wouldn't have been able to drive to work.
Oh. 11am. Then I wouldn't be able to work and I couldn't drive home.
Still a bad idea.
 
@MichaelT ah, yes; considering the weather we're having, perhaps I'll celebrate tonight with some grog; Water, Rum, Lemon.
 
@ThomasOwens This is why I take the train. 0 interference with my 6 Bell tot
 
1:06 PM
@Ampt Drive time to work: 35 minutes. Public transit time to work: 2.5 hours.
And there's not even wifi so I could use that 2.5 hours as working time.
 
user55340
Isn't the rum ration part of your contract @Ampt?
 
Hm. Are Futures and the related things not part of the Java tutorial?
That's disappointing.
 
1:44 PM
@ThomasOwens those numbers are reverse for me
Good ol Windy City
 
@ThomasOwens yeah, this is the problem with public transit.... I wonder how transit would be if there was no traffic - imagine roads all built just for busses... Would ride times increase? Decrease? Would wait-for-ride times be wholey untennable? How many busses/vans/whatever be required to be driven for wait-times to be 5 minutes at most? Would it be so many that they'd then contend with traffic with eachother making it just as slow as now? Slower?
interesting thought experiment
Gads I hope next century they've worked out proper automated efficient transit... Imagine them folks "People spent an hour driving their cars each way every single day in traffic? And everyone did this? What were they thinking??"
 
I don't think you can entirely replace cars. There are way too many destinations. And in areas with harsher climates, at least seasonally, you wouldn't want people to have to walk a long way (>15 minutes).
I work in a technology park now, but there are some more isolated offices buildings and such in this area. Either you would need a bus to service a very limited area and it would be cost prohibitive to run or you would force people to walk (and wait) long times in extreme heat or cold.
 
@ThomasOwens definitely not! I wouldn't intend to - I just meant no traffic; as in perhaps an entirely separate road system, or just most of the current one being public only. You'd still use your car to drive to omaha when you decide life isn't worth living anymore
 
@JimmyHoffa In that case, you have geographic limitations. You may not be able to support the weight of stacked roads or be able to go wider.
I do think there are improvements, but I think you need one road system with adequate bus routes and schedules along with rail or ferries in coastal areas.
 
@ThomasOwens would you need to widen the current roads? How many busses/vans/whatever would it take if the morning commute for everyone was bus/van - would it cause enough traffic amongst those shared vehicles that there would still be significant traffic?
 
1:51 PM
@ThomasOwens I can't take public transportation to work at all
 
@JimmyHoffa You can fit more people per unit on a bus than a car, I think. At least in terms of width and length, not height.
 
I'm thinking like - side roads and alleys for individual vehicle use, just enough to get out of town if need be. All other roads are public transit only... Or perhaps people keep their car in a lot on the edge of town - transit to it if you need to leave town, but in town it's like the mall, you park and then go in
 
I forget the number, but I was reading a thing about self-driving cars, and studies estimated some absurd amount of traffic decrease (something like 80% iirc) if nobody owned cars and just subscribed to something like Uber w/self driving cars.
 
@Telastyn plus then you would finally avoid the stupid non-zipper merge traffic jams
 
In the space taken up by my car (max comfortable capacity of 4, rated for 5), you can put like 8 people on a bus with individual seats.
 
1:53 PM
yeh
 
@ThomasOwens yes but the trouble is individualized routes - and maintaining a low wait time for pickup with individualized schedules...
 
@ThomasOwens don't forget the buffer zone of space your car occupies when driving - a bus has a similar buffer zone, too
@JimmyHoffa and basically suburbs make this economically pointless
 
@JimmyHoffa - when every car is a taxi, there's always one nearby.
 
@enderland True. I was just thinking about my car parked next to a bus.
 
@enderland do they ? again I wonder if you could take advantage of an economy of scale where everyone is operating this way, would it make up for this...
 
1:54 PM
@JimmyHoffa well are we talking about the self driving uber cars? or mass/public transit?
 
If one city block has 12 people who need to get to and from work every day, does it not make sense to bus to each and every block?
@enderland either, both, just pondering
 
Has anyone heard of Bridj?
 
@JimmyHoffa assuming they all leave/arrive at the same time, sure, but that's not how it works generally (though it'd be nice to HAVE to leave work at a certain time every day :D)
 
It's a pop-up mass transit system that uses vans and buses: bridj.com
If cities had access to Uber and Bridj data and used it to build public mass transit routes and schedules, it would be better.
 
@enderland aye, it could have interesting social impacts - perhaps people all keep their cars out of town in securitized lots; perhaps schedules normalize (ohmigod would this be an efficiency improvement for all), street lights could go away, would people feel empowered to travel further or less far for work?
 
1:57 PM
Population density is so much smaller in suburbia or midwesty areas, my large metro area has a population density of 183/square mile ok wikipedia had the entire county included
 
Honestly, that's the advantage that these services that use smartphone apps have: data about where their vehicles are along with where riders are and where riders are going, all in the context of time.
 
by contrast the greater boston area of 1422 square miles (and 3M people) has a density of 2156/sq mile
 
@enderland wow that is pretty low, but "suburbia" is a vague term; I learned in pittsburgh they used it to refer to a density that here would be called rural, or "small towns", suburbs here are dense...
 
Greater Boston is the area of the Commonwealth of Massachusetts surrounding the city of Boston, consisting most of the eastern third of Massachusetts, excluding the South Coast, Cape Cod & The Islands. The area can be characterized as the metropolitan statistical area (MSA) or the combined statistical area (CSA), the latter which includes the metro areas of Manchester, New Hampshire; Providence, Rhode Island and Worcester, Massachusetts. By contrast, Metro Boston is usually reserved to signify the "inner core" surrounding the City of Boston, while "Greater Boston" usually at least overlaps the...
not sure how trusthworthy that is, but either way, many midwest cities have a much much much larger footprint than europe/east/west coast cities
 
I live in what is known as a commuter suburb for Denver; outside the city in the metro, it has a density of 3,203.9/sq mi
 
1:59 PM
It depends on which definition you use. Some of those areas that are sometimes considered Greater Boston are empty.
 
Suburb as a term is totally redefined from one place to the next
 
It would be better to use the term "Metro Boston". I think that's the 128 loop.
 
183/sq mi is not a suburb - you live in a rural area
 
Using the Combined Statistical Area would be terrible.
There's a lot of nothing between Nashua and Manchester and in parts of northern Mass.
 
@JimmyHoffa I'm including everything in the "and surrounding area" but maybe wikipedia has incorrect info
either way the actual city itself - not suburbs - has a density of about 2500/sq mile
suburb I work in has 1000/sq mile
 
2:03 PM
@enderland like I said - outside of towns it would be drive-yourself, there's no traffic or troubles for such things outside of town. Traffic is the problem; traffic is why it takes me 25 minutes to drive to work at 6am, but it would be 1:25 if I left at 7:30
 
previous suburb was 1800/sq mile
 
you can't get from point A to point B any faster based on what you're riding in - speed limits and route geography are the limitting factors until you include population density that causes traffic
I'm very curious what a mall-approach would be like.... coming up with some population density classification for defining borders - then on those border edges you have secure parking lots, and there's no individual driving allowed inside those borders...
all of that space in cities used for parking lots would disappear
 
I think the biggest obstacle to public transportation is that when you include a switchover like that, it negates a lot of the advantage of public transport
if I have to drive somewhere to then take a bus/subway/train then in my mind, unless I have huge time savings (or cost savings) then I might as well drive there myself all the way
 
@enderland but that's the thing - you would have huge time savings if there was zero traffic! Public transit is utterly inefficient right now because it contends with traffic and frequent stops. How many buses would it take to mitigate the frequent stops without increasing wait times beyond say, 5 minutes?
 
@JimmyHoffa in some locations sure, but in my large metro area traffic is minimally meaningful
 
2:09 PM
would it be so many busses that they'd create the traffic they're trying to alleviate?
 
it's not 25 vs 85 min
it's maybe 50 vs 60 min
or if there's a terrible accident, 50 vs 70 min
Some cities are dense enough (or have bad enough roads, cough Minneapolis cough @whatsisname) that this scales really poorly
but others are not so dense and/or have good road design that it works out that traffic is much less of a factor
 
@enderland then you wouldn't qualify, like I said - it's a matter of density. I suspect you may not understand the issue having never dealt with it; Put it this way: There's an area about 7 miles south of where I work, not a huge distance, but me and just about anybody north of the line separating that area from the rest of the metro recognize it as an uncrossable border. The traffic getting down there from here, or up here from there will add 30 minutes to any commute just to go 1-2 miles.
 
@JimmyHoffa no I do, I grew up in a suburb of Minneapolis area - where much of the "belt" was only 2 lanes each way and so that problem happened
 
There's a lot of jobs and people and things down there, and so people do this drive - having to add a ton of time to cross a tiny span of space just because in that little space, the traffic is utterly jacked.
 
Hm. I wanted to try to go with immutable objects here, but I don't think I can. Otherwise, it just seems like I have a lot of random indirection happening.
 
2:13 PM
@ThomasOwens random indirection?
you mean objects going into functions and coming out of functions?
 
@JimmyHoffa No. More like these objects that exist, but don't really represent anything meaningful, other than a holding space until I have everything I need to make the main representation.
Either I need a mutable object that I can set the fields as I read a data stream or I need an object to hold pieces and then assemble the final immutable object.
 
@ThomasOwens this is precisely what applicatives are used for, but they require the ability to do high quality function composition so you can partially-create objects until they're complete... Outside of Java 8 you're not going to be able to do that without an explosion because the lack of lambdas
 
I can't use Java 8...yet. But I want to learn more about applicatives.
Applicative functors?
 
@ThomasOwens yeah
 
"Need you opinion on the situation below." Opinion-based questions have no place here. Perhaps try asking this question over at programmers.stackexchange.com ? — Trobbins 8 secs ago
 
2:19 PM
Hmm. Just took a really quick scan. It seems like it may be what I want, but not usable in my current environment. :(
 
they're used for partial construction / construction validation because they have a great interface for it
yeah, Java has the generics necessary to do a lot of these things, it's just the code explosion it would take to create the lambda infrastructure necessary for good function composition...
 
Would it make sense for my classes to accept() data, perhaps?
 
@ThomasOwens you may just want to use a list and continue adding pieces of data, then construct your full object from that list afterwards if you want the object to be immutable
 
The cost of holding the data is...expensive.
 
@ThomasOwens more expensive for a dictionary than the object? You expect the object to process the data to a cheaper form?
 
2:24 PM
There are really three forms. A live stream of data, a stream of data captured to one or more files on disk, or individual data chunks written to files on disk. In a live stream, everything comes in order and it's no problem. When I'm reading from the disk, it may not be ordered, so I could have thousands of partially constructed objects holding on to binary data. My objects are just high level metadata and pointers to this binary data.
So yes, the data I keep in memory is far, far smaller than the actual data that is streamed or read from disk.
So even though it's a violation of SRP, each of my metadata objects accept() a chunk of data, parse out the metadata that is appropriate, and keep a pointer to the data.
 
I need a funny picture for my status update email. Bonus points if it's related to programming, Magnum PI, or the A-Team (don't ask).
 
I love the A-Team!
 
:)
 
@MetaFight Don't send a status update email. Just send this image: iqtell.com/wp-content/uploads/2014/05/…
Then send a real status update email later.
 
2:51 PM
Maybe I'm approaching this whole problem wrong.
I really hate some of the design decisions that I'm working around, though. Or, more accurately, the lack of design decisions where people didn't nail down a clear and consistent interface.
 
user55340
@ThomasOwens there are only two questions with the intro-to-programming tag. Both locked. Please detag
 
@ThomasOwens nice
 
user55340
(Comments on questions flagged to make them easier to find)
 
@MichaelT Why? If it gets burninated, the tag will go away.
 
user55340
3:04 PM
@ThomasOwens because people are adding it back now.
 
@MichaelT Where?
 
user55340
@RobertHarvey flag as offensive
 
user55340
As long as the tag exists on locked questions. We can't get rid of it.
 
I only see one remaining question with it.
 
user55340
3:07 PM
It raises the hurdle for creating a new tag and not something that shows up in suggestions.
 
28
Q: Why learn hexadecimal?

jwegnerI've taken quite a few intro programming classes in my day, mostly just to get my feet wet in every different kind of programming I find. Not surprisingly, just about every class runs through the same format : intro to hardware, intro to software, and then you get into the actual programming. W...

What's the other?
 
user55340
8
Q: Challenging Java questions for beginners

sixtyfootersdudeI am teaching an introduction to computer science lab session this semester. We are using Java. I am looking for some hard bonus questions for students to solve. They should be able to solve them in a relatively minimal amount of code (say 50-300 lines). So Far they know: input using Sca...

 
@MichaelT I would have used a Geico camel commercial, but it's not Wednesday.
 
user55340
Which is complete crap.
 
Oh. Hmm. It's locked but not closed. That's why I didn't find it.
 
user55340
3:10 PM
It's a poor copy of the list of programming challenged sites which is already wiki lock.
 
@MichaelT It is a crap question. But it's averaged 4000 views/year. It could be linked to somewhere. Hm.
 
user55340
Because it has a promising name on a promising site.
 
user55340
It's a buzzfeed of question quality.
 
Fixed.
 
user55340
Problem #4 will surprise you.
 
user55340
3:13 PM
Looking at anon feedback for it - very negative.
 
user55340
that's the "if anon or low rep could vote" - and you know how free they are with up votes on crap n
 
@Jamal Indeed, design questions seem to be a better fit for ProgrammersPierre-Luc Pineault 20 secs ago
 
@ThomasOwens that's always the problem; I'm wrestling with the same right now. Relying on a pretend DAO that was done with a terrible interface which is resulting in causing me to be confused about how to design my code that needs it... Interface design is so important because if done wrong, it causes bad designs down stream..
when it's done right, your consumers won't even think about what they're doing with your object; they'll be too busy paying attention to other parts of what they're doing. Like when you use a list, or a database connection, it's interface is so obvious you don't give it a second thought.
 
3:30 PM
@JimmyHoffa It's even more fundamental than that. It's how raw data is passed around for processing.
BRB lunch
 
3:53 PM
gah 10 already and I haven't yet made my coffee
eff you code. Stealing my important coffee time. I ought to kick your ass.
Oh wait that's what I've been doing all morning... I'm playing right into your trap; damnit!
 
@ThomasOwens @MichaelT I thought was completely nuked yesterday
yesterday, by Thomas Owens
@durron597 I have no idea what you're going on about now.
 
user55340
@durron597 you need to make sure you check locked questions. They don't show up in most searches.
 
@MichaelT Neither of those were locked when I mentioned them to Thomas yesterday.
 
user55340
The Java challenges was locked in '13
 
@MichaelT All I said was this:
yesterday, by durron597
@ThomasOwens @MichaelT
shrug, it's good now.
I have now starred every single message on the star list, lol
 
4:05 PM
0
Q: Where can someone find a comprehensive list of all the information technology jobs?

Naresh KumarA comprehensive list of all Information Technology related jobs

I don't think I've ever seen a question that more correctly fits the "too broad" close reason
 
> Please consider adding a comment if you think the post can be improved.
No. No I don't think it can be improved. Thanks SE.
 
@durron597 :) I think it was 13 seconds from post --> close that time
 
1
Q: answer's "share" link goes to a different answer

Wayne ConradWhen I go to the question Explaining floating point precision to customers and get a "share" link for Scott Whitlock's answer: The link sends my browser to a different answer on the question What should you test with unit tests?

 
5:03 PM
ugh still haven't been able to fend off this code to actually get some coffee
 
@JimmyHoffa how can it be a day without coffee if everyday is coffeeday?
 
@enderland coffee day just hasn't come to my desk yet... the code's been fighting it off all morning... the break room is too far... and the code is so close...
 
5:26 PM
@JimmyHoffa You're doing it backwards.
 
6:08 PM
@JimmyHoffa coffee : code not code ++ [coffee]
 
6:35 PM
1
Q: We should have a question status similar to locking that non mods can set on posts

durron597If this is tl;dr skip to the bottom heading. In the SO Close Vote Reviewers chatroom, there was recently a discussion with @Shog9, @JonClements and a few others about this Stack Overflow question: Where can I download Spring Framework jars without using Maven? This question is very simply a ...

 
@durron597 you know it's a good suggestion when it gets two upvotes in the time it takes to read it
 
@Ixrec I'm also spamming it around
 
you misunderstand SRP - it doesn't mean that class is responsible for all of it's things. Quite the opposite. SRP means any given module is responsible for one and only one thing, not a collection of things. — Jimmy Hoffa 2 mins ago
 
I'm not sure that overexchange's new question really deserves downvotes, as odd as it is
 
:23141915 Yeah, I mean, who does code before coffee anyways?
 
6:43 PM
that didn't seem like a comment in need of quick removal
 
@Ixrec I didn't intend it as it sounded; there are obviously endless ways everyone learns things sideways, it's no reflection on them
 
user55340
7:26 PM
@Ixrec look at the revision history. Some times votes may be saying "enough already"
 
user55340
Alternatively with the context of the rest of the questions "it is unclear what you are having trouble with - it's been explained a dozen times"
 
user55340
Or "this is a warning to people answering that you are going to be drawn out into a dozen comments that will go on and on and on"
 
user55340
Or "these questions have a history of morphing" - note the one answer no longer answers the core question.
 
I'm pretty sure this is a reflection upon him.
 
user55340
There are also high rep people who have given up and self deleted answers. The List<E> question has an answer deleted with the comment "Sone things just aren't worth doing"
 
7:37 PM
...that is quite the revision history
 
@MichaelT Which question is this?
 
user55340
Take a look at the tree data model question revision history.
 
Oh, the overexchange one?
 
yeah that one
 
user55340
It could also be down votes from "you are trying to figure out how to be an architecture astronaut- just write something already and have a real problem"
2
 
7:41 PM
I'm just going to star that for truth because it's the reason I've never considered answering his questions myself
 
user55340
So - lots of reasons out there. How legitimate you consider each one is up to you. I'll note that most of the people who answer haven't answered many questions now - and few answer two of his questions.
 
would be nice if some such people left an explanatory comment
but otherwise yeah it's kinda his fault for asking really...unanswerable questions
 
user55340
7:56 PM
How many times does one need to leave a comment?
 
user55340
Also, when you leave a comment, it gets drawn out to a discussion.
 
user55340
(Speaking from experience here)
 
indeed.
mostly, they're asking terminology questions, as if terminology matters beyond communicating with people.
 
@Telastyn That's what he is completely unable to do. What we've got here is a failure to communicate.
 
he always seems focused on some vaguely-defined words instead of concrete code, as if the words either had a mathematically rigorous meaning, or that they were goals in and of themselves instead of suggestions on how to achieve what actually matters: useful, working, maintainable code
 
8:05 PM
good point.
 
at the risk of drawing this out longer than it deserves, what on Earth does he mean by "English definitions would not be encouraged, unless it is actually required."?
how do you answer a "What is the difference between X and Y?" question without defining X or Y?
 
user55340
He doesn't understand the code - so trying to get no-code answers.
 
that makes more sense than it should
 
user55340
The problem is that to understand the code you have to use it, rather than just pontificate about if something should be an interface or abstract class.
 
user55340
Note: new answer to question, and the start of more "explain this" comments about interfaces and abstractions.
 
8:19 PM
wow, he gave straightforward definitions of the terms (at least how he would use them) and OP's comment is a quote of said definition and "I don't get it"
 
user55340
There are only so many times this can be done before one starts down voting when there is a hint that it will go this way as a warning to others.
 
I'm close to doing that myself
 
You must be new to SE, you are still optimistic that all users can be salvaged with just a little more effort...
 
oh I'd never have delusions like that, that rule applies everywhere on the internet
but overexchange seemed far from hopeless
well yes that's true now, it didn't seem that way when he first appeared
 
user55340
He needs to write some code that is more than just academic exercises. Until he does, he suffers from architecture astronaut induced oxygen deprivation.
 
user55340
8:28 PM
But, how set of implementations for an interface List(say) has anything to do with DataAbstraction? — overexchange 6 mins ago
 
user55340
Sigh
 
user55340
Can you show me the reference for your definition of Abstraction? — overexchange 58 secs ago
 
user55340
Double sigh
 
user55340
@Ixrec and check the most recent revision.
 
blargh
 
user55340
8:39 PM
So, the question back to you - can you think of reasons people would down vote it?
 
I think the naivete of my original question has been firmly established at this point
 
user55340
Consider: if it's at -4, it stops showing up on the front page.
 
9:37 PM
[wanders into chat room, not entirely surprised by conversation stumbled onto]
Alright, so I have an actual, non-Astronaut question, on the subject of IoC.
Let's say I have some service, and I want to unit test it, but it takes a dependency on a logger, an SMTP service and an audit table in a database.
 
mock it
mock it all
 
Eh...
What about a constructor that takes an ILogger, ISmtpService, and IAuditTable as parameters?
Even if it's just for testing purposes... That is, after all, why I decided to program to an interface, right? So that I could swap out all those pesky dependencies.
 
user55340
How are they otherwise appearing?
 
And given that I'm following the Hollywood Principle, I should already have such a constructor in my code anyway.
@MichaelT Well, the aforementioned constructor doesn't exist yet.
 
3 mins ago, by ratchet freak
mock it all
 
9:44 PM
Bleh.
 
Use a framework that binds the mocks for you so you don't even have to write code.
 
user55340
Three ways: either reflection, setters, or constructor. Pick one. Spring likes reflection - so I use that approach.
 
In other words, an IoC container.
 
@RobertHarvey I didn't say that.
 
user55340
9:45 PM
The XML config file binds the stub that I want which can be mocked or injected any which way I want.
 
There's probably a dozen dependencies in this thing, and I only care about mocking the ones that are there for production diagnostic purposes.
 
I don't know what options there are in C# but jukito you can just do testFoobar(Foobar b) and it will inject mocks into the constructor for you
 
user55340
The test stub exists only in the test directory structure.
 
@RobertHarvey Sounds like the problem is that the code violates SRP, not mocking.
 
Well, I didn't tell the whole truth. It's really more of an integration test.
But it uses a unit test stub to fire the whole thing off.
@durron597 But if you are going to mock it, you still need a place to insert the mocks, right?
And that means a new constructor, right? Or do I just not understand mocking?
 
9:49 PM
@RobertHarvey Well how is the object built in production?
 
psr
@RobertHarvey You're a mod on SO - I imagine you've learned a thing or two about mocking.
 
@psr @RobertHarvey is the king of mockery
@RobertHarvey See?
 
@durron597 I click the Build button in Visual Studio. What do you mean?
Continuous Integration? That's for sissies.
 
@RobertHarvey You're saying it has 12 dependencies but no constructor to inject them into. How do they get injected?
This, by the way, is why I try to stay away from Field injection.
 
9:51 PM
The object builds the dependencies and stuffs them into local variables. The constructor parameters are fed to the new() calls.
 
user55340
Mod rh = mock(Snark.class);
when(rh.getAnswer("question")).thenReturn(modClose);
 
user55340
See? I mocked Robert!
 
If your outer object is explicitly calling new, then that should be refactored.
I know how to do all this in Java, but not in C#.
 
I get that. So the dependencies need to be handed in through the constructor, right?
 
In Java you can use PowerMock to overwrite the behavior of new
Yeah, in Java, using Guice, Guice builds all the dependencies internally and feeds them into your constructor
 
9:53 PM
Guice is an IoC container, I presume?
 
@RobertHarvey No, it's a DI framework
 
Because if you're accepting dependencies in a constructor method, and your caller object is accepting dependencies in a constructor method, then it's turtles all the way up, right?
 
You can use it as an IoC container, but you shouldn't.
 
Suffice it to say, they're not using a DI container at this place. Which means none of this works.
 
So I don't know what you mean by turtles, but I suspect this isn't it
@RobertHarvey ninject.org
 
9:55 PM
"Turtles all the way down" is a jocular expression of the infinite regress problem in cosmology posed by the "unmoved mover" paradox. The metaphor in the anecdote represents a popular notion of the theory that Earth is actually flat and is supported on the back of a World Turtle, which itself is propped up by a chain of larger and larger turtles. Questioning what the final turtle might be standing on, the anecdote humorously concludes that it is "turtles all the way down". The phrase has been commonly known since at least the early 20th century. A comparable metaphor describing the circular cause...
 
245
Q: Which .NET Dependency Injection frameworks are worth looking into?

pbreaultWhich C#/.NET Dependency Injection frameworks are worth looking into? And what can you say about their complexity and speed.

doing DI without a framework is crappy, I agree
 
Ah, that edit completely changed the question. I think it's a much better question now, but still a style question which comes down to opinion. I'm not sure where it belongs, maybe programmers.stackexchange.com31eee384 37 secs ago
 
Which brings me to my next question. How does a DI container know when you are in "test mode?"
 
yes, turtles all the way up, but that doesn't matter because you're mocking the bottom turtle.
 
an IoC container would be the equivalent of injecting the entire DI binding structure into your objects and calling getInstance(Blah.class), which is technically possible to do in Guice but also totally wrong.
@RobertHarvey Because you configure the bindings different in test mode
 
9:57 PM
Oh, OK.
Presumably you can throw a switch somewhere? Use this configuration instead of that configuration?
 
user55340
@Duga that's a naming question.
 
user55340
@Duga given have you considered posting a link to the question too (oneboxed) to give context. At most, one link per question per day. Just an idea.
 
user55340
@RobertHarvey in my code, quite easily. Tests have an annotation that specified which config to use.
 
user20683
I have one of these
 
user20683
10:00 PM
it is pretty decent
 
@MichaelT Right. Looks like I'll have to bite the bullet and read my "Dependency Injection in .NET" book.
@fearofawhackplanet one of the only things an IoC container can do that can't be done with poor man's DI is Interception. Good summary here: kenneth-truyers.net/2013/05/16/…Mat's Mug Jul 25 '13 at 16:54
> The goal of AOP is to achieve loose coupling. However, if you have to apply attributes to all the methods you wish to intercept, you’re effectively creating a hard dependency on the aspect you’ve applied
----^ I've wondered about that myself.
 
@RobertHarvey Yeah I don' t use AOP.
 
It doesn't seem very useful, unless you want to do something like instrument every method in your application, and for that, you need code weaving or IL rewriting.
 
user55340
Aop is too spooky action at a distance for me.
 
user20683
I look at AOP and go "WAT"
 
user55340
10:04 PM
Makes it harder to reason about the code.
 
10:14 PM
0
A: How do we encourage edits to obsolete/out of date answers?

durron597The proper solution to this problem was suggested 5 years ago and is the #18 overall highest voted answer on all of MSE: Score = Lower bound of Wilson score confidence interval for a Bernoulli parameter If we provide this sorting formula, the newer, correct answer can get upvotes, which can m...

 
10:36 PM
Ultimately, you can't. Even if you encrypt the data, a determined user can decompile your program to get the encryption key and algorithm. The computer belongs to them, not to you, and what you're trying to do sounds shady anyway, so my advice is to forget this idea and find something else to do with your time. If this is a corporate machine and the use is legitimate, talk to IT and figure out a way to do it with security policies. Make sure you provide adequate disclosure to the users. — Robert Harvey 1 min ago
 
user15026
@WorldEngineer Oh, damn, that sounds like something I'd love
 
user15026
and the more beers sound amazing, the more I know I likely won't be able to get them :P
 
10:55 PM
 
@durron597 He apparently doesn't know about the DMCA.
 
@RobertHarvey the commenter or OP?
 
psr
The DCMA's chief weapon is surprise.
 
@psr Those Defense Contractors are pretty sneaky
 
11:21 PM
@brandaemon StackOverflow or Programmers.SE. Code Review is only for fully working code and also must include code. This question has no code what-so-ever. Which makes it off-topic on Code Review. — Ismael Miguel 1 min ago
 
user15026
The question is from '09, why is it getting poked at now?
 
11:46 PM
@durron597 that's a lot better than my crappy suggestion
 

« first day (1792 days earlier)      last day (3203 days later) »