« first day (1320 days earlier)      last day (3661 days later) » 
03:00 - 22:0022:00 - 00:00

3:49 AM
@psr I call it the segmentation pattern, it's got horizontal and vertical segmentation, which is more than can be said for most monolithic mudball software..
 
 
4 hours later…
7:27 AM
hallo ?
 
7:52 AM
echo
 
 
5 hours later…
1:04 PM
Hello there, anyone home?
I would like to ask about a possible migration from Code Review
Please give your opinion on following question:
0
Q: OO design choice and single responsibility principle

PJanssenI'm currently refactoring an application which periodically downloads content from various sources (http, ftp, sql, etc). There is a schedule which controls the times during which the application can be active. For example, it can download content between 8AM and 16PM. The application has been wr...

 
@Vogel612 I just told one of the CR mods that design questions are on-topic and to just send them over to us as long as it looks like a good question. It's a lot easier and quicker. And please, never suggest cross-posting in comments anywhere - it just makes a mess for us to clean up.
 
@Thomas unfortunately I am not a mod... Also skimming through your on-topic help, I think that "software architecture and design" definitely qualifies for this question.
 
@Vogel612 If you see design questions on CR, please just flag them. A mod will review and send it right over. It's pretty easy to tell if it's a good question or not. If there's any concerns, they can ping us.
 
Okay, will keep that in mind ;) Thanks
 
 
1 hour later…
user55340
2:22 PM
Btw, for prospective P.SE blog authors: stackedit.io/… could be useful for topic choices.
2
 
user55340
(that link came from Shog when we were discussing tools that would give 10ks some additional information about inbound activity from low rep/anon voters)
 
Hey. I understand that tomorrow is the big day. The Splitting of the Metas.
101
Q: Operation 'Split, All The Metas!' Shall Commence On April 16, 2014

Tim PostNot all of them mind you, just Meta Stack Overflow into Meta Stack Exchange. I'll have you know, factually, that we really did believe this would take place in six-to-eight weeks when it was originally announced, but we've finally got a tentative date established. If things go according to plan...

 
2:48 PM
13
A: The future of meta.stackoverflow and meta.stackexchange

gnat                                                                                                                    "we all'd love to see the plan" This is going to be quite a challenging "fork", would be very interesting to see how it finally works out. For a start, I would probably move every...

^^^ plan was drafted about 1,5 years ago :)
 
user55340
3:17 PM
{insert me making fun of the decimal comma here and starting to read that as "1500"}
 
user55340
Related reading: npr.org/blogs/krulwich/2010/10/19/130674804/… and en.wikipedia.org/wiki/Indian_Numbering_System for something that makes me really go "huh"
 
user55340
And while I'm at it... Canada WTF?
 
user55340
 
@MichaelT French Canada, perhaps?
I see the comma used as a decimal point in France and Spain. It makes sense that Quebec would do it as well.
 
user55340
It appears to depend if you are writing in English or French.
 
user55340
3:20 PM
Or money.
 
user55340
> In English Canada: There are two cases. The preferred method for currency values is $4,000.00 while for numeric values it is 1234567.89; however, commas are also sometimes used although no longer taught in school or used in official publications.[21]
 
user55340
And on SE:
 
user55340
8
Q: Is adding commas to numbers a cultural thing?

Cécile BoucheronIn the US, it's very common to add a comma for numbers of more than 3 digits (ex: 1,000 for one thousand ; 1,000,000 for one million ; etc.). In France though, we don't use this at all and commas are used for decimal numbers only (ex: 2,46). Do you know which countries are following the US rul...

 
Also, still no major negative reception to the Help Center / About changes. That was far less painful than I expected.
 
user55340
And don't get me started on date format in canada... (YYMMDD in goverment, MMDDYY in english text, DDMMYY in french text)
 
3:23 PM
@MichaelT DD MMM YYYY is the only right way to write a date.
Spaces optional, of course.
Today is 15Apr2014. Writing it as 15 Apr 2014 or 15 April 2014 is acceptable.
 
user55340
@ThomasOwens YYYYMMDD No spaces. All digits. Lets me do nice sorts on the data.
 
@MichaelT That's fine for an internal representation of the data, yes. I'm referring to display.
It does make sorting trivially easy.
 
user55340
(I love going into directories with logs and finding the log files numbered with anything other than YMD style... and trying to see how big the logs are sorted by time)
 
I guess today is "why was this language decision made" day.
 
user55340
@RobertHarvey with no prior search.
 
user55340
3:29 PM
Fail audit review... it shows the bounty.
 
user55340
(not me fail, but fail in the system)
 
user55340
(a bountied question can't be closed... so I saw "0 score, scroll down reading it to find the actual question... "Worth a +150 bounty"" -- yep, thats an audit)
 
Audit reviews are like interrogations, where the interrogator tells you something that isn't true to get you to talk.
Or witholds vital information.
I'd love to know how well they actually work, given the apparent number of false positives.
 
user55340
4:06 PM
(well, at least that java one got owner deleted so I don't have to go chase it down with a delete vote later)
 
4:32 PM
what's an audit in this context?
 
@RobertHarvey Yes.
 
Ugh, I used to have that attitude
"This doesn't help me with <goal>! Why should I know this?"
cue several years later where actually knowing how dictionaries/hash maps, tables, trees, etc ends up being hugely useful at random spots in my day to day job.
how they work*
 
Just the other week, I used material from a class from my second (or early third, I forgot) year of school that I thought was a total waste of time.
 
You never know when it comes in use.
 
4:41 PM
Representations of floating point numbers, ftw.
 
hahaha, I remember that class
hugely difficult, but very useful
 
And actually being able to explain IEEE whatever that defines floating point representations.
 
or even know that a spec exists, and what kind of implications it has
 
That was the big thing. I get floating point math and errors and such, but being able to explain it was huge.
 
Exactly.
What also ends up being randomly important is algorithms to minimize floating point errors.
 
4:53 PM
^^^ asker is essentially crap-bombing site, repeating same extremely low quality question over and over again. Delete votes are welcome on both their questions dropped at our front page so far
 
wish I had some to give
 
user55340
5:14 PM
@Zeroth One thing to remember that is helpful in cases like these is that for a 20k to do a speedy delete vote, the question needs to be at -3 rep. And -4 will kick it off the front page. These don't need any more down votes... but in other cases, down votes on things that are completely off topic, having that additional down votes makes it easier for the 20ks to cast their delete votes too.
 
I asked my question about how many hours to plan a sprint in the Lounge<C++> and got beautiful answers :D
 
@JohanLarsson You should have asked it on Programmers. You were approaching some really good, answerable questions yesterday.
In fact, you still can.
 
If you have the time and feel like it please ask them. I always hesitate to ask on main cos my English is pretty broken.
I'll upvote them :)
 
They are your questions. And you shouldn't worry about broken English - we have many people with edit powers. As long as you get your point across, we can clean up spelling and grammar.
 
trudat
I got a feeling programmers is ~architecty~ and fear that I will not get the answer I want :D
 
user55340
5:23 PM
We're all parts of the SDLC other than implementation. Design and architecture tends to get the lions share of the activity, but planning is part of it too.
 
@JohanLarsson come on in, the air is fine up here, nice and thin; might want to get your helmet on.
 
@JohanLarsson Architecty? 50% of my job is process improvement.
I welcome methodology and process questions personally, usually with an answer and/or an up vote.
 
@ThomasOwens I wasn't accusing.
 
user55340
Btw, @RobertHarvey you know you'll love reading the transcript of that "debate" room.
 
psr
@ThomasOwens I can try to work up a rant if you like. Which historical villain would you most like to be compared to?
 
5:29 PM
@psr Clearly, you must invoke Hitler at some point. Everything on the Internet must eventually.
 
user55340
Nah... need to go with something with more fun... Vlad the Impaler is such a great one... then you can get Yannis talking about draconian laws.
 
user55340
(I thought it was Yannis... hmm... can't quite find that discussion)
 
user55340
Actually... @psr go with Draco.
 
user55340
:Dracon redirects here. In fiction, it may refer also to the home world of the Dracs. Draco (; , Drakōn) (circa 7th century BC) was the first legislator of Athens in Ancient Greece. He replaced the prevailing system of oral law and blood feud by a written code to be enforced only by a court. Draco's written law became known for its harshness, with the adjective draconian referring to similarly unforgiving rules or laws. Life During the 39th Olympiad, in 622 or 621 BC, Draco established the legal code with which he is identified. Little is known about his life. He may have belonged ...
 
Godwin's law (or Godwin's Rule of Nazi Analogies) is an Internet adage asserting that "As an online discussion grows longer, the probability of a comparison involving Nazis or Hitler that is, if an online discussion (regardless of topic or scope) goes on long enough, sooner or later someone will compare someone or something to Hitler or Nazism. Promulgated by American attorney and author Mike Godwin in 1990, It is now applied to any threaded online discussion, such as Internet forums, chat rooms and blog comment threads, as well as to speeches, articles and other rhetoric. In 2012, "...
 
5:43 PM
What are your views on testing private methods?
I sometimes make stuff internal and expose them for testing cos it makes the tests small and nice.
 
4
A: Is the "decimal" type in C# binary-coded-decimal?

Jon SkeetNo, it's not BCD (where each digit is individually encoded in a specific number of bits) - but you don't want it to be. (And I certainly never claimed it was.) decimal is a floating point type in that it has a significand and an exponent, both integers - it's just that unlike float and double, t...

 
the downside is that it makes things heavier to refactor and perhaps makes the api a bit noisy
 
Hmm... I had always just assumed that decimal was implemented in base 10.
 
@JohanLarsson If the private methods aren't used via the public interface, they should be removed since they are dead code. If you're doing white-box testing, the only thing that your private methods can do is drive test cases. It could reveal potential edge cases.
 
The private methods are called by the public methods, refactored for readability.
googling white-box testing
 
5:50 PM
@JohanLarsson So testing the public interface will, by definition, test the private functions.
 
There's no need to do anything crazy to expose those private methods to your test code.
 
Problem is that the setup gets big for the public methods, hurts readability of the tests
 
Just watch your test coverage, to make sure you're providing inputs to your public interface that exercise the bounds of your private methods.
 
user55340
@JohanLarsson Don't make it private (friend, package private, etc...) or test it through the public facing API (if you can't tickle all that private functionality you've got things you can't test anyways).
 
5:52 PM
@JohanLarsson It shouldn't matter. Either all the code is in the public methods or it's extracted into private methods. Your inputs to the public methods won't change in order to exercise all of the code.
 
It is np to exercise all code through the public api, the tests will not read very nice though.
So the consensus is that it is bad?
 
user55340
Its not bad or good, it is.
 
8 mins ago, by Johan Larsson
the downside is that it makes things heavier to refactor and perhaps makes the api a bit noisy
^ other reasons?
 
You're potentially exposing implementation details to a client.
 
user55340
 
5:54 PM
If you give someone something, they will use it. Control the public-facing API very well.
 
user55340
Package private doesn't expose the details but lets other (test) classes in the same package to get access to them.
 
@ThomasOwens is that a security issue?
 
user55340
Only if it deals with security...
 
@MichaelT yep that is they way I do it, internal in C#
 
user55340
But it means that the client could write code that is based off of deeper calls than you want to present meaning future upgrades will break when those functions change.
 
5:55 PM
@JohanLarsson Potentially. It's more of a contract issue, if you give someone access to something that's not supposed to be public, they will find a way to rely on it and then complain when you break their code.
 
They are pure functions btw, not mutating anything.
 
user55340
See for example the old Windows things were Windows apps called somewhere deeper in the stack rather than the public api - they had to maintain those same addresses in later versions for backwards compatibility.
 
@ThomasOwens ok but internal is not like handing out access, they could always peek and reflect if they really want to use stuff not meant for them.
It is an issue to consider, it is true.
 
@JohanLarsson At that point, it becomes cluttering my packages up with test code. I prefer to have my test code as an entirely separate entity from my distribution code.
 
user55340
Consider, you've made a internal bit that returns a class A that leaks outside of the library through a public API call intended for testing. Now you want to make that a class B... and while your code works (you've fixed it all) anything using that leaky method before will break.
 
5:58 PM
@ThomasOwens Do you write C#?
 
user55340
(in the Java world - see Maven directory structure /src/main vs /src/test maven.apache.org/guides/introduction/… )
 
@JohanLarsson I have done a little. I mostly work in C++ or on the JVM.
 
user55340
Java world: package private with matching package structure in /src/test that allows access to those internals. The distribution code is only built from /src/main but tests run with both /src/main and /src/test in the class path.
 
Sounds similar, in C# if I make something internal it is scoped to the project (dll). I can then explicitly expose it to the testproject by setting assembly:InternalsVisibleTo("Projectname")
I didn't think of the leaking implementation aspect, ty sirs for pointing it out.
do you guys use jUnit?
 
> <rant "I think I heard enough whining. Guess it's about time to say loud and clear..."> Private methods are beneficial to unit testing...
6
A: Why did Java make package access default?

gnatDefault access does not render the private access modifier redundant. Language designers position on that is reflected in official tutorial - Controlling Access to Members of a Class and it's pretty clear (for your convenience, relevant statement in the quote made bold): Tips on Choosing an ...

...Fine, to fix the gap, I add a unit test for missing scenario, repeat coverage analysis and verify that gap is gone. What do I have now? I've got as new unit test for specific usage of non-private API.

New test ensures that expected behavior for this usage won't change without a notice since if it changes, test will fail.

An outside reader may look into this test and learn how it is supposed to use and behave (here, outside reader includes my future self, since I tend to forget the code a month or two after I'm done with it).
 
6:09 PM
@gnat Yea they capture the unit part well often.
 
@MichaelT I was unaware C# also supported that kind of thing. That's good to know.
 
user55340
16
A: Why doesn't C# have package private?

Kirk Wollinternal is what you are after. It means the member is accessible by any class in the same assembly. There is nothing wrong with using it for this purpose (Product & ProductInstance), and is one of the things for which it was designed. C# chose not to make namespaces significant -- they are u...

 
user55340
I'd have to dig around the functionality for C# style maven build structure... might poke @JimmyHoffa for that.
 
user55340
Might find something in nuget.codeplex.com but I really don't have the experience for C#
 
I hate Maven, but I do tend to have /Project/src and /Project/test directories.
 
user55340
6:18 PM
I've got love/hate relationships with most build tools. They're great when they work well and a pain when they don't. I haven't dug into gradle too far yet.
 
Another test related question: I skip nullchecks in constructors sometimes because I think it is nice to be able to pass null instead of a mock if it is not going to be used.
 
user55340
My dislike of maven has been drastically reduced now that I use a good maven integration with Idea (rather than the eclipse plugins).
 
Failing fast is nice but in this instance I trade it for readability of the tests.
 
user55340
Anything you leave in a public API will be used, and maybe in unintended ways.
 
Do you make a difference if it is a small selfcontained app or a library?
 
6:28 PM
@JohanLarsson I tend to treat everything like a library. Especially on the JVM, when the output is a JAR that can just become what looks like a library.
 
ok I'm yet to be burned by it :)
But I get the idea of course.
 
11
A: Is there a software engineering principle that relates reuse and regression test cost on a production system?

gnat we don't want to modify code that could be shared, because that will cause a big regression test impact Above sounds about right to me. The more important is the code, the more it is shared, the higher are quality requirements, the more quality assurance should be involved when it changes. ...

^^^ library quality code is way too expensive to design. In small self-contained app, compromised code quality may make sense (especially if you don't compromise on unit tests)
 
user55340
@ThomasOwens Everything is a library anyways... it just some libraries have defined entry points.
 
@gnat It depends on the design rigor needed for these small, self-contained apps.
 
@gnat Have an upvote even if I don't 100% agree. The argument is sound.
Do you see only library quality code in your daily work? I don't.
 
user55340
6:34 PM
That philos comes from a mix of perl / python / ruby / java experiences.
 
user55340
I once saw a C program that if it was renamed 'runtest' would run all of the tests instead of its normal functionality... and yea, that was undocumented code that got discovered in a decompile.
 
user55340
I've also stuck 'main' methods in java libraries for this because the .jar was used in another application... and when things broke they'd blame me for writing buggy code (in my lib) so I'd ask them to do java -jar snip.jar (snip.jar being the library I wrote) which would spit out all the debugging info about the environment... and show them they named the machine wrong.
 
@MichaelT You mean the name of the executable was changed?
 
@ThomasOwens oh, that's 200% right, how could I forget! If that's something code-for-sell, intended to use somewhere out there (and potentially at risk of bothering you with midnight support calls for whole application lifetime) then yes, investing into design rigor may be perfectly justified
 
@gnat More like potentially at risk of putting human lives on the line...
 
user55340
6:38 PM
@ThomasOwens Yep. Look at vim / vi sometime... or sendmail / from / mailq
 
user55340
~/foo$ ls -l /usr/bin/mailq
lrwxr-xr-x  1 root  wheel  16 Oct 23 21:18 /usr/bin/mailq@ -> ../sbin/sendmail
 
@JohanLarsson see what Thomas pointed out. Small self-contained code for non-critical internal use, I am seeing it regularly and it doesn't bother me that it's not perfect
@ThomasOwens this too, of course. Critical use is another factor to consider
 
Any views on skipping nullchecks in ctors for cleaner tests?
 
user55340
I'm unsure of the example for that...
 
Once, an intern asked what the worst case for one of our systems failing in the field is. Someone responded with the normal thing like degraded imagery, or no imagery at all. The mission would be a failure. Then I showed them the health effects of U2 pilots flying missions at altitude and duration. Every time a pilot flies a plane with our stuff, they are risking their health. Not to mention the normal risks of flying the planes.
Quality is a pretty big deal to me.
 
user20683
6:46 PM
@ThomasOwens Worst case: "Boom!"
 
@MichaelT ok trying to code up an example.
    public class Car
    {
        public Car(IEngine engine)
        {
            Engine = engine;
        }
        public IEngine Engine { get; set; }

        public void FillTank()
        {
            // Fill the tank with fuel
        }
    }
pretty dumb example but if I want to test the FillTank method that does not touch the engine I can pass null instead of a mock for engine.
 
user55340
What happens if I do that with production code? I'd error out somewhere down the road from some internal call in your stack.
 
Makes the test read good as it communicates clearly that engine is not used when filling the tank
 
user55340
If you want to instantiate the car without an engine in the constructor, make a public Car() { Engine = defaultEngine; }
 
user55340
Otherwise, someone will call your method with a null there some day.
 
6:52 PM
unless the tank is integrated into the engine...
or you error when null is passed for the engine
 
public Car(IEngine engine, bool throwOnNull = true)
{
    if (throwOnNull && engine == null)
    {
        throw new ArgumentNullException("engine");
    }
    Engine = engine;
}
 
user55340
The last thing I want is here's a call of car.go and then you've got 5 stack frames of your library code that populates up a null pointer exception that I've got no way to debug.
 
mabye that is a solution to both
 
don't make throwOnNUll a parameter
 
user55340
no no no - bad bad bad bad code.
 
6:53 PM
just make a mock when you need to
 
@MichaelT that is the downside
 
user55340
@JohanLarsson its a really big downside.
 
Yes, hence my question
 
user55340
So don't do it. If you don't want to pass an engine in, make a constructor that populates it with a default object instead.
 
@MichaelT What is so bad about it?
 
6:54 PM
you let the caller decide if the object will even be valid
 
user55340
NPE thrown from:
Car.doStuff called by
Car.doOtherStuff called by
Car.go called by
MyCode.do
 
(if engine needs to be non-null for it to be valid)
 
user55340
Why was there a NPE thrown there? I can't see what the code did in doStuff.
 
user55340
I just know the error is in your code.
 
ok so clear consensus that checking for null and passing mocks that are not going to be used is better?
 
6:56 PM
yeah
 
user55340
Yep.
 
you can even let the mock error out if it is used when not needed
 
ok ty sirs :)
The issue I have with the mock is that it is noise. Perhaps worse than noise since null communicates that it is not used in the test to me.
But the NRE scenario is also huge pain
 
user55340
Use the mock and test it when its done that it wasn't invoked - thats even more clear.
 
that is even more noise to me :)
 
6:59 PM
just in the test code
don't poison production code with test enabling code
 
^ that is a solid point
How long are your average testmethods?
I aim for < 10 lines
 
I have to confess that I don't really write test code...
 
user55340
test() {
    MockEngine me = new Mock(Engine.class);
    Car car = new Car(me);
    assertTrue(car.go);
    verify(me, Mockito.times(0)).someMethod();
}
 
Want then to be obvious at a glance
 
user55340
Some java ish code there with Mockito... but you say "this method was not called with this process"
 
7:02 PM
very similar to Moq in .net (and other frameworks)
 
probably based on each other
 
@MichaelT You've a question about internal?
 
user55340
The thing is, thats a better test. If you're passing nulls around there who's to say that you don't have a null check somewhere else in the code that covers up the error of the null invocation?
 
Packages suck. I hate that some languages opt for packages over libraries and executables. It's such a backwards way to put together your code
 
user55340
@JimmyHoffa was wondering about internal and C# build frameworks to keep test and production code seperate.
 
user55340
7:04 PM
@JimmyHoffa by packages... you mean?
 
@MichaelT Not sure I agree, I agree 100% on the NRE issue though.
 
@MichaelT yes
@MichaelT and yes, let me dig up the convo where I explained to @RobertHarvey my approach for precisely this..
 
user55340
@JohanLarsson How do you test to make sure that the engine wasn't called unless you can pass something through it that can keep track of it (not a null)?
 
A null asserts it in a good way, reads extremely clear to me also.
 
Dec 12 '13 at 16:56, by Jimmy Hoffa
@RobertHarvey That's what I figured, just wasn't super clear in my reading. When I'm doing lots of unit testing I end up with practically no privates; I just use internals instead and set InternalsVisibleTo("My.Project.Name.Tests") and have a Tests project for it...
 
user55340
7:06 PM
Because some sloppy coder noticed nulls getting tossed in the code and did a try { engine.foo(); } catch (Exception e) { log.info("meh"); } which caught them all and hid the problem.
 
user55340
@JimmyHoffa Ok... I think we agree at some level there.
 
or added a if(engine==null)engine=new DefaultEngine(); somewhere
 
@MichaelT you use InternalsVisibleTo attribution on an assembly to with a list of other assembly names which you want to be able to see that assemblies internals
 
@MichaelT That is a much more serious problem, gonna have a talk with that guy :)
 
user55340
@JohanLarsson but you won't know from the unit test passing a null in there in there for the sake of 'clean' tests.
 
7:08 PM
or it is caused by the guy replacing you after you got hit by a bus
 
I look at mocks as a code smell, sure they solve a problem and have their uses. I don't love when they are needed though.
 
user55340
What smell are they covering up?
 
@ratchetfreak some day a dev is going to get hit by a bus; survive, and his pointy-haired-boss is going to give him a huge raise to ensure he never leaves on account of his extreme value from immunity to the bus factor problem.
 
user55340
The pupil asked two master programmers:
“I cannot test this code without mocking and violating encapsulation. What should I do?”
One master programmer answered:
“Mocking is bad, and you should never violate encapsulation. Rewrite the code so you can test it properly.”
The other master programmer answered: “Mocking is good and testing trumps encapsulation.”
The pupil, confused, went out for a beer. At the local watering hole he saw the great grand master programmer drinking beer and eating buffalo wings.
 
ah, back from long backlog grooming session
 
7:15 PM
@MichaelT state, nonpurity don't know a good word.
They have their uses though no question about that. Refactoring away from the need of mocks has often led to cleaner code ime.
 
user55340
@JohanLarsson They can be used to expose a lack of purity or querying of other state in ways that nulls can be hidden.
 
the null is not a solution to the mock smell, it is the same smell probably a worse ~solution~
@MichaelT :)
 
user55340
You are instantiating a car, and it requires an engine. You've got two options for inserting specific functionality into the car to test how it behaves if you've got a hamster wheel in there or a regular engine... you can use a mock or you can code up a test specific class to pass in.
 
user55340
The advantage of the mock is that it is easier to maintain and is set up in the test itself rather than having another class somewhere else that you need to maintain. And if you need two different mocks for different classes...
 
Cars, wheels and animals. Terrible examples of OO, because inheritance is seldom used that way anyway (although composition is).
 
7:25 PM
yes mocks are nice like that
 
What is this guy on about?
No -- unit tests do not even enter the picture, nor do contracts or requirements (don't worry, I know about these). You can do condition tests only by ripping out the decision, then test its conditions. But that doesn't tell you anything about anything. Except if you are testing the hardware implementing the condition!David Tonhofer 5 mins ago
 
I've had just about enough of this OOP crap. OOP solutions to modeling computations blow... I think I'm going to start trying something a little more exotic... Wrestling with encapsulating query and update logic into serializable data packets is resulting in what will probably require a lot of gnarly conditional garbage logic...
 
user55340
In the pre-mock days of unit testing I had a dozen classes that were designed to tickle specific functionality in the class. I much prefer mocks.
 
I'm sincerely debating defining an AST for this shit
 
Inheritance is another smell imo :D Hurts readability.
 
7:27 PM
@JimmyHoffa Particularly with compilers, passing around tokens in objects immediately starts looking like a code smell. Just looking at the object definitions in Mono makes my head hurt.
 
user55340
@RobertHarvey any bets as to where the downvote whining rooms will go after the split? MSO or MSE? And if its MSE... you'll have the joy of not being a mod and letting Shog say shut up.
 
All of the butthurt is on MSO. Always has been. Will still be even after the split.
 
user55340
But then you can say "Take it to MSE and quit complaining here if you want an SE wide change"
 
Nobody cares as much about the intricate details of the network than the SO'ers. Everyone else just gets bent out of shape when their question gets closed.
@MichaelT Or just migrate it.
 
user20683
@RobertHarvey I care about the intricate details...mostly because people don't understand them. And then I have to deal with the whining...
 
user55340
7:30 PM
(btw, the specific complexity measure is npath comlexity for the bifurcation at each if)
 
@RobertHarvey yeah... what I'm working on is graph query and update over an intelligent object graph that models our real-time data in memory... I initially did it with very coarse updates for the simplicity but there's concern if we don't make the updates fine grained to the property level rather than replacing whole portions of the graph we'll be sending too much data around and the whole thing will be less flexible and less performant. I don't disagree.
Trying to tear up my update logic to allow more granular updates but modeling the computation to update data in objects is terrible...
 
For lots of objects, the Flyweight Pattern comes to mind, but I think that's about similar objects.
 
22 hours ago, by Jimmy Hoffa
user image
16 hours ago, by Jimmy Hoffa
@psr I call it the segmentation pattern, it's got horizontal and vertical segmentation, which is more than can be said for most monolithic mudball software..
that's the only pattern I'm using from now on.
Perhaps it's time I start playing with the DLR for this... if I want to go the AST route the Expressions were moved into the DLR...
 
@WorldEngineer Yes, but all of the arguing about the finer details occurs in a tiny, tiny fraction of the community. Most of the time, it doesn't matter. Removing the "doesn't demonstrate adequate understanding" close reason in favor of the more sweeping "Too Broad" and "Unclear what you are asking" was one of the best things SE did for Stack Overflow.
Of course, "doesn't demonstrate adequate understanding" was their idea in the first place.
@JimmyHoffa There's some Helper Libraries and Compiler Stuff that goes along with that... Let me see if I can find that.
Here it is:
Oh, and Roslyn is open-source now.
 
ah, that stuff looks great if I want to do some il emit for perf, which may not be a terrible idea though that's a little further into the imperative hole than I'd like to go... perhaps I just need to come up with the right compositional API to make modeling this as computations easier rather than thinking about using encapsulation and conditional logic...
 
7:41 PM
IronPython was written over the DLR. Leppie used a heavily-modified version of the DLR for IronScheme (it's about half the size, from what I understand; he stripped out a bunch of stuff he didn't need).
3
A: What is the relationship between the Dynamic Language Runtime and C# 4.0?

Robert Harvey From: jimmysch Robert, The facts: IronRuby and IronPython both use the DLR, in fact most of the DLR's features are derived from earlier implementation of IronPython. I'm not familiar with how what version of the DLR IronScheme uses. A portion of the DLR (Microsoft.Scripting.Cor...

 
@RobertHarvey now you're just taunting me. There's no chance of me using either of those.
 
No, but they do provide some "footprints in the sand," so to speak.
 
@RobertHarvey yeah, to be sure I think I'd take a look at massive before any of that. What I'm doing isn't dissimilar from an ORM, and his dynamic code may well give a good idea....ahh now there's an idea I can work with...I could write a code generator...
 
Massive is incredibly cool. An entire Micro-ORM, in about 600 lines of code.
 
the dynamics stuff is one way, but ORMs are also often done with code generation, and in this case... I think a code generator wouldn't be terrible difficult
 
7:46 PM
They're not. They're just... messy.
 
@RobertHarvey that depends...
Thanks for your candor, definitely gives me some things to think about..
 
Hmm.
 
user55340
@RobertHarvey btw, that package/each problem is a very real one and a huge nightmare from my days as a point of sales coder.
 
1
A: Questions featured at Ars Technica

GlenH7Yes, there was an informal “protection racket” in place to protect questions that were to be featured in Ars Technica. The racket came to be after several of the regulars within The Whiteboard noticed the effects of being featured. Those effects included lots of views and votes, but also freque...

^^^ @GlenH7 I think you stole accept from Shog (frankly, I didn't expect this to happen)
 
So basically to solve your problem, you need a whole new language/ast parsing?
 
user55340
7:52 PM
For things that can be broken apart and sold as a case vs unit that have the same upc the register would force the cashier to enter if the scan is a package or a unit.
 
user55340
@Zeroth Interpeter pattern.
 
Presumably the case has a different UPC than the individual items. Them both having the same UPC would be pretty silly.
 
ah, yes
 
user55340
@RobertHarvey The system I worked with stored had a mapping of UPC 11-1 (unit) to quan:1 sku:1021101 and UPC 11-2 (package) to quan:12 sku:1021101 --- unless the package was sold at a different rate than the units (12 pack of soda is cheaper per unit than 6 pack is cheaper per unit than singles). In those cases, each was a sparate sku.
 
user55340
Note that there was some fun in there for some itmes... where if you bought the equivalent unit (not sodas) it would recombine items into a larger 'package' so that it could be sold at the appropriately discounted rate.
 
user55340
8:02 PM
(I wish I could change my close as a dup vote to close as 'this is crazy talk')
 
> This question is off topic because it is about a heaping pile of crazy splattered across the internet like a used meal
 
snicker
 
user55340
-3
Q: How do remote programmers working on proprietary software go about securing their work/source code?

user55476I was just wondering what kind of protocols a software engineer would go through if they were working at home for a company developing proprietary closed source software. Would you use a third party anti-virus or would you fear they could steal your code? Can you trust web hosting services like...

 
user55340
It's a different question than the proposed duplicate. That question is about being the company and extending trust to employees. Mine is about being the employee and securing the information on your pc as well as communications with the company. The proposed duplicate doesn't address any of the questions I raised in the body of the post as well. And @:Michael how does a contract between the employee and the programmer mitigate theft from the employees computer? — user55476 52 mins ago
 
user55340
He's worried that Microsoft or Norton will try to steal the code he is writing...
 
user20683
8:13 PM
If your code is that sensitive, why the hell do you have an internet connection?
 
^^^
 
user55340
@Andrew Medico: Can you elaborate on what you think is a reasonable level of paranoia? Say your company is depending on you to keep the information on your computer secure. Say your code included highly valuable pieces of hard to trace code ( hypothetical ). — user55476 4 mins ago
 
user55340
That would be a good followup.
 
Of course, if its a laptop, maybe provided by the company, then the company should be putting security on the laptop
I do find it slightly funny we have 20 laptops in our office
every single one is literally chained down
so any portability benefit is nil
 
user20683
aye
 
user55340
8:15 PM
Did I tell you the stuff about my former employer and laptops?
 
user20683
if I ran a company with that little trust, I'd have a contract where everyone consented to wear tracking anklets.
 
user20683
You know, the kind they use for felons.
 
user20683
Because you're all criminals, you just don't know it yet
 
user55340
@WorldEngineer video cameras always active on each computer...
 
user55340
335
Q: My customer wants me to record a video of how I develop his software product

MainMaWorking as a freelancer, I often see strange requests from my customers, some of which can negatively affect my daily work¹, and others trying to set some sort of control. I usually encounter those things during preliminary negotiations, so it's easy enough at this state to explain to the custome...

 
user20683
8:16 PM
I saw that
 
@MichaelT that's dumb, he should be scared both of them will steal his code, and then they'll sue eachother, trumping up the costs, and after appealing three times they'll both sue him for causing all this mess at many billions of dollars for all the legal fees he cost them and the product troubles from his low quality code. That's clearly the appropriate level of paranoid conspiracy for someone of his stature.
 
user55340
... and out of close votes.
 
psr
8:39 PM
@MichaelT "Clearly 'home' in this case in underground bunker where you and your fellow developers live for your own protection until the code is finished and you can all be killed to ensure secrecy. The key technical challenge is preventing information leakage via gravitons, but addressing that is too broad for this site."
 
@psr stupid gravitons... can't keep their damned mouths shut...
 
user55340
Regarding the duplicate: I may have been wrong in my first reading of the question for the duplicate and instead should have closed it with 'unclear' or a custom one instead. As described the question does not describe an actual problem that you face (see the help center) and isn't clear what problem you are trying to solve... or if there is a problem, how an answer of "don't connect the computer to the network" would fail to answer it (this is a valid approach - Linus has such for the master copy of Linux). Please clarify the exact nature of the question you have rather than hypothetical. — MichaelT 9 mins ago
 
psr
@MichaelT Yes, that was nice of you to respond.
 
user55340
8:55 PM
And World did a forceful reclose of it (thank you)
 
user20683
The dupe appeared valid to me, this adds weight to the unclear
 
user55340
There's the "how do you secure the code from the remote programmer stealing it" and then he's asking "how do you secure the code from the remote programmer's system" where the system include anti-virus, and the operating system itself.
 
ell.SE or english.SE?
0
Q: Boolean OR in English

TruthOf42What is the English equivalent of boolean-OR? "Either or both" seems right, but still seems awkward. The answer should be easily understood by a non-programmer.

 
user55340
I'd go with English.SE and one of their request tags.
 
user55340
 
user55340
9:06 PM
and I think the answer would be 'at least one'
 
user55340
@ratchetfreak and I've got a flag in there too for mods to migrate.
 
Ok. I want to use a dynamic block now...
I know exactly where to put it and how...
 
user55340
"block anyone who says the word monad in chat for as many minutes as other words in the chat message"?
 
monad
I think I found a loophole. :)
 
user55340
See, that would do nothing because there are 0 other words in the sentence.
 
9:10 PM
with a minimum of 10
 
user55340
however, I suspect you mean some other type of dynamic block...
 
@MichaelT yes, dynamic { } in C# is how you get into the DLR
 
user20683
O Hai Andy
 
user55340
It looks to be one of those "this is magic" things that you scratch your head over until you find a real use for it and go "Thank the Skeet and Lippert!" that it was included.
 
user55340
9:15 PM
@WorldEngineer I get my socks in pairs... I wonder about you if you don't.
 
user20683
@MichaelT I get my socks in hexes. The Hanes protocol specifies that format.
 
user55340
The good socks are pairs.
 
user20683
@MichaelT The affordable socks are hexes.
 
user20683
I also only own black socks.
 
Andy really screwed the pooch, didn't he?
 
user55340
9:19 PM
I've got quite a few of the affordable ones... but I really like smartwool... and those tend to be pairs.
 
user20683
@RobertHarvey Andy finally started using "user[number]" IDs though.
 
Actually asked a decent question, but because he's Andy, it probably ends in incomprehensible muttering.
 
user55340
He started that at the end of his last sock wave...
 
Well, at least I was spared being trolled again.
 
user55340
So there were two socks? You only linked one question... and the user obliterate doesn't leave a trail in deletes.
 
9:23 PM
I'm not curious enough to care about the other socks.
 
user20683
@MichaelT Different question
 
user20683
ran the typical names
 
user20683
I have a list
 
9:35 PM
@MichaelT I get a discount by buying them in 3 packs.
 
user55340
The only place I've seen the use of three socks at a time is fat tire cyclists.
 
Eric Lippert on Movies and TV
Note that in several of those -- I have not seen them all -- though the children are not orphans, their parents are temporarily removed by forces beyond their control. — Eric Lippert yesterday
Oh...
17
A: Why do Disney parents usually die?

Eric LippertIts not just the animated movies; Disney corporation also made a lot of live action films that have this pattern: A family is damaged. A child has an adventure as a result. During the adventure the child becomes more like an adult, taking responsibility for themselves and others, and ultimately...

 
user20683
9:54 PM
@RobertHarvey Because Joseph Campbell :P
 
03:00 - 22:0022:00 - 00:00

« first day (1320 days earlier)      last day (3661 days later) »