« first day (1504 days earlier)      last day (3559 days later) » 
00:00 - 19:0019:00 - 23:00

12:22 AM
You can think of Left and Right as Failure (left) and Success (right) when you're thinking of them in terms of handling exceptions in the "Exception" monad or "Error" monad as it's also called at times, but really it's just the Either monad, and in haskell Left is of a generic type not a fixed Exception type so that Left can hold whatever type you wish to form your errors in; a string, an int, a custom data type, whatever. But that's another layer of genericism not necessary for getting the basic Error/Exception monad concept across in C#, so I left that part out to avoid making the code an
@RobertHarvey crockford may come off as an arrogant snob at times, but it's best not to let peoples shitty personality flaws get in the way of learning from them as in his case, he's still really damned smart.
take me for instance; I'm the veritable definition of an asshat.
but sometimes I say stuff that makes sense (if your english parser is running in quirks mode)
You are bad at being an asshat if that's your goal (Rule #1 - don't feed the trolls)
12:43 AM
@MichaelT / @ThomasOwens - Close reasons on CR have been updated to link to CR-meta posts with additional detail. You're invited to edit those posts (probably this one ) to redirect people to Programmers in the most advantageous way.
@rolfl Thank you.
You're welcome.
1:35 AM
@rolfl - I put some edits in place to suggest asking on Programmers in some cases and provided links to the relevant guidance someone ought to check before asking a design review question. Feel free to change the tone to match CR's culture as necessary.
I wonder what their design variables to optimize were
2:16 AM
Have the failures look as comical as possible?
2:30 AM
@Ampt an old genetic algorithm project to evolve things that move. Project Golem
Part of it was to actually make these things too. For example simulated and 3d printed or another simulated and printed
6:36 AM
Hi chat
7:03 AM
Hi mods, seems we have somebody trying to build a micro spam network. So far RodeoSkillful asks questions and Autofell and BooXoxoAlly add answers with spam links.
6 hours later…
1:31 PM
Well, that's nice. I can't open Outlook. It crashes every time it opens.
Exactly what I need today.
You don't have a webmail interface?
I do, but I don't like it.
It's OWA, and OWA sucks.
it's still a place where you can check your email
It doesn't have reminders, though.
I also have a OWA webmail interface and it has a setting for reminders
buried in options->settings->calendar (translated)
1:42 PM
Oh. Maybe. But outlook works again. I turned my computer off and back on again.
that works for me as well sometimes, stupid exchange server crap
I'm guessing it was a server issue, too.
or a old connection that was messing everything up
So many problems with Outlook.
And Exhcnage.
@thorstenm├╝ller Looks like the secondary accounts are gone. Primary (rodeo) is still there, but all of their questions are gone.
1:53 PM
@ThomasOwens Having worked with both Notes and Outlook, I'll agree that both stink.
2:51 PM
Anyone here ever use SciTools Understand?
3:04 PM
@ThomasOwens Did you try turning it off and back on again?
@GlenH7 what do you prefer? I've used outlook forever, only other thing I've used was many years ago, I think it was either lotus or eudora... don't even remember now
Just from having used outlook forever, I quite like it... it's little appointment list thing next to my messages and easy folder organization and easy to create rules... I don't really know what's wrong with it (the client- the server has sketchy stability and features depending on how MS-knowledgeable your IT is)
@JimmyHoffa As an email client, I think both kind of suck. I used to really despise webmail type accounts, but gmail won me over. Outlook seems to play more nicely between mail and calendar. Notes did a much better job of allowing ad-hoc databases to be used for collaboration purposes.
@GlenH7 yeah, outlook is literally just mail+calendar for me...
not sure what else you'd use it for?
@JimmyHoffa Finding the right thing to tweak can be very difficult. Settings can be inconsistent. Have to completely restart the app whenever Exchange mods make a change. It has its fair share of problems.
@GlenH7 again, I've been using it for so long having been an MS dev my whole career, perhaps I just know where the things are to tweak, and yeah if your server isn't totally stable then it can be a pain
no I'm remembering now, that was Eudora I used before outlook... it was pretty terrible too, but then so was most software of that era
I've seen a lot of connectivity issues when I know the network is stable. Outlook could work harder to reconnect / resynch
3:13 PM
@GlenH7 eh, I've worked more than one place where it was 100% stable - it's an effect of how well setup/maintained/configured your exchange server is - and that is an entire careers worth of knowledge all it's own... setting up/configuring/maintaining an exchange server is something that requires someone who really knows their shit in doing SA for MS
I grant that sucks. But I am curious, what are the alternatives that are better?
@JimmyHoffa webmail? Gmail? :-)
@GlenH7 for work?
@JimmyHoffa There is a google apps for biz, but I don't know of any medium+ sized business using it that way
@GlenH7 yeah I'm aware of that, but that's still in browser, yeah? (I gotta be honest- GMail's interface I have never been able to stand, it's sooo slooowwwww)
There are other email providers that can be used. I want to say mimecast is one
3:16 PM
are you referring to like some desktop apps google has?
@JimmyHoffa It's got full pop3 / imap capabilities so you can use it with a desktop client. I used to do that with iMail on my mac
Once you turn the email server into just a service, you have several more options wrt to your desktop client. I'll admit I haven't gotten very far into that realm
@GlenH7 at that point why wouldn't you use a basic POP3/IMAP server instead then? I was referring to what would you replace the outlook client with
Offhand, not sure. Never had been able to make that decision. :-)
@GlenH7 yeah, so you're where I am- people complain about outlook a lot, but I just don't know what else somebody would use? I am genuinely curious though about alternatives
I'm going to have to poke around now out of curiosity...
3:19 PM
@JimmyHoffa and ... sniped. :-)
(2011, bit dated)
at the end of the day, MS has a huge warchest and has for many years, almost entirely due just to their Office department. They could at any point in time just trim every other part of their company (or as some have speculated, break apart completely) and the office portion alone would rake in so much money over their cost it would be ridiculous
it basically funds the rest of the companies failing projects because its so profitable
people just can't figure out how to get away from it
@JimmyHoffa it's heavily, heavily entrenched, no doubt
I like outlook
I think it functions well
@Ampt In a well administered environment, it's tolerable enough
and its hooks into lync can be pretty cool.
3:27 PM
@Ampt me too. but people hate it, so I'm curious if they've come up with alternatives that validate them in showing it can be done better
I suspect it's just hold over of M$ hate that some people still carry around
15 hours ago, by enderland
You are bad at being an asshat if that's your goal (Rule #1 - don't feed the trolls)
@GlenH7 I just think before you can say something is particularly bad, it's better to show someone can do it better. That's like saying "The moon lander was a really crappy ride, uncomfortable, and I got a heat burn on my leg"
well maybe that's not true. If you think it's really bad it may just be bad and nobody's done better, but I think if there's things about it that are "bad" then there should be something out there that someone made without that badness?
(the moon lander is probably a terrible ride)
@JimmyHoffa But those are also true statements. I agree that it's better to present an alternative, but not necessarily having an alternative doesn't take away from the shortcomings of XYZ
@GlenH7 fair enough. I guess my contention is I don't see the bad you do, if I could see an alternative without it perhaps the contrast would make it apparent
@GlenH7 We use Lync here. Love it.
@Ampt wish we did here :(
Used it at previous jobs
@JimmyHoffa IM, voice chat, screen sharing, video
so good
automatically changes your status based on your calender
3:32 PM
@Ampt I know, I've used it. Just not in my current workplace.
@Ampt I dislike that recording chat conversations can be controlled by the exchange admin though
@GlenH7 ours are all set to don't record for security purposes
@GlenH7 you dislike it, but office admins probably don't. It's not a feature for the users, it's a feature for the company.
granted they are Man in the Middle so they can do what they want
and all I'm getting from this is that @JimmyHoffa thinks theres room for a new email client
@Ampt likely in our case too. <sighs>
3:34 PM
and to that I say: Get going.
@Ampt no, I love outlook, @GlenH7 and others think so; I'm curious to see if they're right
My last workplace, you would get an emailed transcript when you left a convo
aaand my ssh shells all got terminated again
thanks tunnel to texas for absolutely no reason!
@JimmyHoffa I don't think there's "one right" solution. Different biz have different needs.
3:37 PM
@GlenH7 I just don't see outlooks flaws like you do
45 secs ago, by GlenH7
@JimmyHoffa I don't think there's "one right" solution. Different biz have different needs.
@JimmyHoffa You're just a corporate shill MAAAAAN
question: why is every single code sample i receive godawful
@durron597 insufficient spec; not recruiting from the right places; too high of standards; expectations outside of norms; ...
Feel free to pick one, many, or none.
3:39 PM
and my boss keeps scheduling interviews with these people before i even look at the sample so i have to talk to them
the guy my boss liked the most didn't even know what the SRP was. as a java programmer
@durron597 Use it as a chance to validate your earlier presumptions
@durron597 That's in one of those new libraries, right?
@GlenH7 lol
today's code didn't 1) have a main method 2) inconsistent capitalization 3) flagrant encapsulation violations 4) at least one obvious bug 5) a random extra class "Test" that just printed the results of some float subtractions
Seriously though, I don't mind interviews that I think are going to go badly. I do my best to give the person a fair chance, but I think it's good feedback to see if my read of the other information was correct. Many times it is, but not always. If nothing else, it helps you fine tune your screening process.
I keep telling my boss we just need to get a lot more candidates but it's hard
even the recruiting firms are only giving us like 3-4 candidates each
3:47 PM
Well if you want better candidates you've got to make your offer enticing
Likely because you're a small firm with a small number of slots open. So it's going to be harder for you to get visibility in the job searches. And likewise with the recruiters - they're going to slowly trickle candidates to you. They don't want to create false expectations for their candidates and they're still trying to build a relationship with your firm.
Where are you getting these people from?
College events?
a mix of dice, careers.so, and recruitment firms
well now is when to strike at college events. by may you're looking at the leftovers
if you're looking for entry level positions anyway
also, while it's not necessarily a problem to hire an immigrant, a lot of times they have language issues and the process of sponsoring an H1B is annoying
but we get almost zero american applicants
3:50 PM
Wait are you the ones doing the banking transactions?
in java?
automated trading in java
Ah. Yes.
@Ampt trading != banking. Different regs behind the two
haters gonna hate, but my code is pretty dang fast.
It's not the language or what you're doing I'm hating on :)
That website on the other hand... ;)
3:52 PM
@durron597 I can never find the link, but there's a large UK outfit doing the same thing and doing quite well by it.
@GlenH7 Whatever. Money trading hands = banking = trading from where I'm sitting
Implemented an Actor pattern which bought them lots of speed
@Ampt Such an uninformed point of view... I say that gently, but it's horrifically wrong.
@GlenH7 Never heard of the actor pattern. but honestly my code is not that different from an actor pattern
(from a quick wikipedia skim)
3:54 PM
@GlenH7 Does it really matter from where I'm sitting? In either case you have regulations and much higher security concerns
@Ampt do you mean from a technical implementation perspective?
I understand that they do not do the same thing
the term you may be looking for is "financial"
@GlenH7 is correct
@durron597 IIRC, it's very heavily based in Actor and strong governance behind SRP. It's SRP that allows them to get screamingly fast times from the trading portion. All the logging and support crap is pushed to other actors
3:55 PM
@Ampt I'd argue that yes, there's definitely different technical requirements too
my logging and support crap all happen on different threads too
I have a WrapperLogger class that implements slf4j.Logger but forwards it off to a logging service thread
@GlenH7 Alright, Inform me. It seems like there is some clearly obvious standpoint which I'm missing.
@durron597 I want to say they used a pub-sub queuing mechanism to help with that, but I'm not positive
@GlenH7 my code also uses pub-sub queueing for market data
@Ampt regrettably, I have a new system I need to stand up at the moment.
3:57 PM
@GlenH7 Awfully convenient end-note, don't you think?
i was using MBassador for awhile but it was too slow so I implemented a pub-sub model myself
Short version: trading is transactions between separate parties with flexible terms. Banking is transaction between persons and the bank on generally fixed terms.
@Ampt I'll inform you in his stead, you see a monoid must be associative, and have an identity, with an inverse, the law of the inverse is as such: forall x from your closed set S, there exists on and only one element i which satisfies: x * i = i * x = x
banking transactions generally aren't rolled back because they (almost always) conform to the rules. trading transactions can be and frequently are rolled back or canceled just prior to execution
the list monoid has an identity element of [] so [1] ++ [] = [] ++ [1] = [1]
3:59 PM
@JimmyHoffa Oh do shut up
19 hours ago, by Ampt
...my head hurts
trading transactions are subject to external scrutiny (in theory)
Trading transactions are often carried out through third parties whereas banks handle their own transactions.
@GlenH7 ehh that's a stretch
4:01 PM
I'm not gonna say that you're splitting hairs but...
I worked on banking software - I worked on the communication software for communicating with the federal reserve bank to do transactions with them. Transactions in banking aren't often just 2 party affairs, the communication we did had messaging for doing transactions with other banks through the fed as they acted as arbiter and authority of accounts for many cases, banks have all kinds of accounts and transactions with many parties
I'm just saying that when you start to mix money and technology, you get into this whole other subfield of programming where there's a lot more oversight and convolution and from where I'm sitting, it all looks the same because I don't have to deal with it.
@Ampt I'm just saying, @GlenH7's statement above is a simplification...
4:44 PM
This guy's question got me thinking... How do you protect ID's from being tampered with in an ASP.NET MVC edit form?
@RobertHarvey I think if you don't know you need to put identifiers on models to keep track of what's being edited you might not have done much CRUD work
I do know that.
But the ViewModel is not an editable object, strictly speaking. The objects inside the ViewModel are.
@RobertHarvey also authorization is a concern separate from identification. After you've identified the object you want to update on the server side, there must be an authorization step in your system that verifies the authenticated users authority to edit that entity.
so in answer to you question of how do you protect <data> from being tampered with in an <application>, the answer is Authorization. (which can only be done effectively on the server side)
Yes, but how do you authenticate the object ID's? How do you know you're editing the record corresponding to the same ID that was displayed in the edit form. How do you know that the user hasn't hacked the HTML, and put different ID's in there?
@RobertHarvey you don't. You never trust the client.
4:50 PM
How do you know it's a good ID then?
you have to check the authority of the user on the object they tried to edit. The user could at any time run your website through fiddler jacking with anything they want in the proxy
@RobertHarvey If your server is assuming it's a good ID then it's already made a mistake
Never trust the client.
Ack. How do you find out?
@RobertHarvey look up the entity, have an authorization system robust enough to tell you if the user who tried to commit the action has the authority to do so on that entity
if the entity doesn't exist then it's a bad ID, if it exists and the user's not authorized then it's an authorization error
Yeah, I guess that works, though I have the feeling that we're missing something.
Some bad thing a user might do. Maybe they have only limited access to other people's records, but complete access to their own, and changing the ID is a workaround. It would be better if you could verify that "Yes, this is the same ID that I sent to the form before."
@RobertHarvey you can't
which is why you should: Never trust the client
Fiddler, remember? They can send you anything they want
4:54 PM
I knew that. :)
@RobertHarvey your best bet is to use OpenAuth type authentication on the ID to authenticate it
nonces and hashing with a private secret salt yadda yadda
but that's just a lot of extra work for no reason
at the end of the day, it just doesn't matter what they send the server in regards to the data itself, because you won't trust it anyway
so why put all the work into making it verifiable when you can just check their auth when they send it back to you?
I was thinking more in terms of sending a token with the ID. Or using some sort of ID that can't really be tampered with, like a GUID.
@RobertHarvey yeah, that's where the hashing + private salt + nonce comes in to play so it can't be tampered with, but again why ? You're still going to do the same authorization check on the server, rendering the verifiable ID redundant
I'm thinking about this, not for the things that I know I can do, but for the ways people could fuck with a system that I don't even know about.
But I see what you're saying.
@RobertHarvey Have you read about OpenAuth and how it works?
4:57 PM
It's actually cool to learn
it's a smart authentication system
It works with ASP.NET MVC?
one second I'll find the URL I used when I implemented it...
I'm talking the technique, not a library
it's just got a spec on how to do authentication which makes sense for making a verifiably non-tampered-with data communication
^-- interactive OAuth token generator step by step shows the data that goes into it and how
hueniverse.com/oauth <-- good starting place for walking through the details of what there is with OAuth
Yeah, that's more like what I had in mind.
@RobertHarvey right, and for authenticating your user that's great to ensure your user is who they say they are, but after you know the user, you don't need to verify the entity ID they sent you is what they say it is when you know the user and can authorize whether they have access to it or not
5:07 PM
How long have you been doing the programming thing. A few years, I guess?
@RobertHarvey err? Sorry?
Just a random question. You don't have to answer if you're busy with work.
(change of subject)
@RobertHarvey depends on your definition I guess, professionally 14 years
Ah, I was gonna say 15
"pick the correct stack exchange problem"
i have a race condition and I want to ask somewhere whether my solution to fix it is good
i can write an MVCE
5:11 PM
It's not "good" if you have a race condition.
If you have working code, you might get away with Code Review.
Seems like the best fit. If you have working code.
@RobertHarvey Race conditions are great!
You're thinking of race tracks.
Oh... right
I'm partial to Nürburgring myself
Afraid to google that.
Its a real thing.
5:19 PM
@Ampt You listen to James May?
@rolfl Well I tend to listen to all 3 of them, but yes, he's in there too.
He really rants about that... ;-) Much better as a spectator venue than a design/development tool, apparently.
Haha I could see it. The problem is that you need to balance the two. If your sport is delightfully entertaining to perform, but dreadful to watch, no one in their right mind would sponsor you.
So Nurburgring isn't a great development track, but it does have a storied history and a lot of entertainment value
@durron597 If the code works, then yes, Code Review is a good place to get your concurrency aspects critiqued too.
5:40 PM
@rolfl @RobertHarvey I posted it
Q: Solving a race condition

durron597In my application, I have a message dispatcher. Each message gets relayed to a dispatcher thread. In some scenarios, I can get two responses from the third party in the same millisecond: An "I received your message" ACKnowledgement "My response to your message" RESPONSE When I get both mess...

So much of that code is just framework. But I don't have a problem I can't solve, I have a problem I have solved, I just want to know if I solved it well.
Looks like a decent quesiton there. Should be addressed soon enough... ;-) And I can see some things to say already.
@rolfl I don't really want feedback on things that aren't the concurrency code, I wrote the whole thing in the last 20 minutes
That's why I wasn't sure about which SE
hm. i made an assumption about what your "some things to say" are :-P OOPS
No problem, If you're interested in chatting about the queston more, the chat component would be more on-topic on the code review chat room: The 2nd monitor
I'm in the room, but it's dead
Not that we mind here either of course :)
but you may find more CR experts over there
5:50 PM
I find I almost never have any questions to ask on SO anymore
I can basically always figure out an answer
and i find myself wondering "is this a good answer"
Code Review is an awesome site. When it was first proposed, I didn't think it would work, but it really does.
You're biased ;-)
You had the last word on the scope ;-)
Seems as if I felt the original proposal was too vague.
5:56 PM
@durron597 it looks a bit too contrived for me to really understand what it's supposed to be doing off hand
Well, you called it Code Review, for a start, instead of "Beta Testers": area51.stackexchange.com/posts/11464/revisions
@JimmyHoffa What do you mean?
I can read it but... I don't understand it's purpose
it looks like everything funnels to ensureAck which just sleeps and tries something 10 times
everything else in the file looks like ceremony, that's the only code doing anything
@JimmyHoffa right
...so what's the point of the rest of the code?
5:58 PM
To set up the race condition
@durron597 I guess the race condition is getting lost in the ceremony
if you comment out the call to ensureAck and run it a few times the race condition is obvious
there's only one method that does something, and it only does something with locals - how can there be a race condition
it's racing itself I guess? Nothing else in the code does anything...
the race condition is on the state?
if you comment out the call to ensureAck, the code is nondeterministic
you either get:
It's late in the day.... but doesn't this accomplish nothing??
public DateTime LastDataTimeStamp
                lock (this.SyncRoot)
                    return this.lastDataTimeStamp;

            internal set
                lock (this.SyncRoot)
                    this.lastDataTimeStamp = value;
6:00 PM
Received response event: NEW
Received ack Event: NEW
Received ack Event: NEW
Received response event: READY
@durron597 oh so the state is the race condition
@durron597 oh you have to comment out that line, I thought you were claiming the comment line was a comment (which was weird)
@durron597 editted your Q
now I get it
also "this is the important bit" confuses to draw your attention to the code you want to get rid of because it's a hack
I thought it's where the race condition was supposed to happen
@durron597 you need to synchronize in handleEvent, that's the problem.
which sucks
but that's the way it is
err no what? you need to synchronize where the state is changed
is it a hack? or is it the "ordering code"
i need to do something to ensure ordering
the messages can come out of order BEFORE handleEvent is even called
@durron597 ...your code doesn't make sense. What is it supposed to do?
@JimmyHoffa in the real application the code does more tasks, it does stuff with the data in the Event object
and yes it's a hack, thread polling for readiness is usually best avoided wheresoever possible
@durron597 yeah but what is the example code supposed to do... ensure "ordering" ? of what?
6:10 PM
the Event processing
@durron597 so put the events in a queue
but it's not necessarily FIFO
the message dispatcher itself might order the messages improperly
@durron597 ? It's supposed to ensure ordering or not, if you want order use a queue or stack
If you use a queue or stack, dispatcher just says "Hey go look at your queue", dispatcher order doesn't matter
like, in the example, imagine if the submit(ack); and submit(response); lines were switched
the ack must still come first
the ack message might not be in the queue yet when the response is popped
@durron597 There ya go ... ;) : codereview.stackexchange.com/a/66909/31503
6:14 PM
@durron597 so the processor knows it needs an ack first and pushes response back into the queue and looks at the next message in the queue instead
@rolfl Argh you replied to me putting prints in the synchronized block. of course i would never do that in production code
but i guess it might be valuable for another
That's just fluff in my answer.
If you don't want to be called out, don't put it in your code :P
msg = queue.pop()
if (_needAck && msg != ACK)
if (queue.length > 1) recurseIntoThisFunction
else do nothing until dispatcher tells us another message was pushed into queue
//here we actually have our ack or don't need our ack
cough fixed font
6:18 PM
@rolfl Anyway as I said in the comment, that's a great solution. Thanks :)
Pfleh, avoid thread polling wheresoever possible. I'll toss a non polling solution in CR later
@JimmyHoffa Um... do you consider a wait-state on a lock to be polling (immediate notification on state change)?
I put the system in a 10ms loop to handle spurrious signals, and to timeout at the right time, if that happens.
in theory, all other things being 'normal', the system will never poll, but return immediately when the notify happens (or 10ms expires).
@rolfl Sometimes I wish I could +1 a chat sentence without necessarily putting it in the sidebar for a day
Oh, go ahead. You know you want to.
The thread sleep loop is polling - it'll sleep for <period> + is timer accuracy, other signal approaches are is timer accuracy after event
6:31 PM
@JimmyHoffa @rolfl's answer is not thread sleep though
@RobertHarvey You're the little devil on everyone's shoulder
@MichaelT - As a thought experiment, imagine if your former retail employer decided to submit their application, one function at a time, to the SE CodeReview site.
I was referring to your solution durron
@JimmyHoffa I kinda knew my solution was crap. That's why I went on CR
6:32 PM
So I'm going through my requirements matrix, and I notice that it's very easy to write a requirement that is really multiple requirements, even after I already know better.
The Chapter 10 Tools application shall indicate an error if the sync pattern of a PCM packet does not match the sync pattern defined in the TMATS section
@psr Assuming that it takes ~500ms for the server to respond and post the question and make it available for everyone to see, it would take ~85.3 years to post all the questions
The Chapter 10 Tools Application shall provide a mechanism for determining Actual Minor Frame Status (CHECK or LOCK), in accordance with the settings specified in the SYNC1, SYNC2, SYNC3 and SYNC4 attributes of the TMATS P GROUP.
Which is actually about a dozen, more specific requirements.
Generally speaking
1. I have a programming problem
2. I come up with a solution that technically works but I'm also fairly certain is crap
Do I:
A) Write up an MVCE with the crap solution and put it on code review
B) Write up the problem without any solution and put in on SO
C) Write up an MVCE with the crap solution and put it on SO
D) Other
B) Closed as "What have you tried?"
C) Endless discussion in comments, no real answer forthcoming, possibly closed as meh.
A) get told by @JimmyHoffa how much my code sucks
6:36 PM
@durron597 He only hates it because it's not Haskell
In Haskell, thread polls you
@Ampt And doesn't have any monads or gonads
In Ruskell, thread polls you.
@RobertHarvey 3/10 Forced, rehash of haskell joke already made, implying that haskell is literally soviet russia
@durron597 or even *nads
@RobertHarvey It seems like the only time SO is correct is when I can't even get my crap solution to work
6:38 PM
That's what SO is nowadays, for better or worse. A crowd-sourced code troubleshooter.
@RobertHarvey eh, I think having a multitude of other sites helps to offset the worse part
@RobertHarvey But often I'll end up with an XY problem in that case; what I needed was to be reminded of lock-wait, not "how do I get this thread polling solution to work"
I find it hard to imagine myself in a situation (anymore) where i'll have the correct algorithm but a broken implementation
I noticed your volatile variable in there. We have the same problems with it in C#. Eric Lippert basically says "Don't use it, unless you really, really know what you're doing, which means don't use it."
@RobertHarvey That assumes you can get your code to work at all without that keyword
I'm pretty sure there's always a synchronization option available that can replace volatile, except in a way that is easier to reason about.
6:42 PM
@durron597 In C#, when would a lock not work but volatile would?
@psr I was referring to programmer competence, not algorithm design
Ah, I see what you did there.
@RobertHarvey Don't use it unless you're Eric Lippert
I got the distinct impression that even Eric Lippert doesn't use it, because others have to be able to read his code and understand clearly how it works.
@RobertHarvey Oh, yeah, that's why I don't use it either.
6:45 PM
actually the problem was insufficient understanding of the JMM
my classes in school were things like "operating systems" and "compilers" and "artificial intelligence" and "algorithms"
there were no classes like "design principles" or "concurrency"
about once every other week i ask my boss to let me just sit in one of the comfy chairs in the lobby and read Java Concurrency in Practice :-P
he prefers that I continue to limp along
This is one of the reasons that coding style guides are so important. Some of them say things like "Don't use volatile", thereby eliminating a whole class of problems by not allowing them to occur in the first place.
There's an aerospace company that has a C coding style guide that forbids things like recursion and some types of memory allocations. Why? Because they code in hard real time systems, and those things are poison pills.
Also, it's funny, but I used to think that those folks who insist on "always using braces" even when there's only one statement, were crazy. Until that bit us in the ass here where I work. Hard.
@RobertHarvey Do you have a good one for Java?
No, not for Java. The guide will change depending on whether you're building, say, one of those large, enterprise applications, or a real-time, high-speed automated trading system like this one. The two problems are vastly different, and require different skill sets.
The C style guide I referred to would only be used in those areas where real-time programming occurs. Nobody else in their right mind would use it; it's too confining and strict for most ordinary applications.
@MichaelT probably knows some good style guides for Java.
00:00 - 19:0019:00 - 23:00

« first day (1504 days earlier)      last day (3559 days later) »