49 ms·
Insidious Bug or Comedy of Errors?
- DanielBMarkham 15y ago...Don't have hanging conditionals... One of the nice things about F#'s pattern-matching is that it will not allow you to do this. It's amazing the number of bugs you can avoid like this.
- chc 15y agoFrom what I've seen, F# seems like a really nice language. It looks like the best of the MLs. If only it weren't so tied to the Microsoft stack and seemingly relegated to a supporting role for C#.
- mmavnn 15y agoIt has active Mono support as well (even from inside MS). The Monodevelop support is pretty good too. I code in F# on Ubuntu regularly.
- shanselman 15y agoThe whole of F# is open source AFAIK. Used on Linux and in schools a lot.
- oconnor0 15y agoWhat are you pattern-matching on? At least in OCaml you can do "if (test) then a else b", and I assume that holds for F#. Are you talking about "if (test) then a" without the "else b" clause? Because, while I agree that using only "if-then" introduces the potential for many bugs, the error talked about wasn't caused by that.
- AndrewWarner 15y agoGlad you're blogging again.
- smallegan 15y agoThis is a huge argument for shared data libraries where you can enforce the rules of your data in a single place. Not always possible (business-wise) to implement but it is nearly always worth pushing for.
- SomeOtherGuy 15y ago>where you can enforce the rules of your data in a single place That's called a database. That entire post could be summarized as "look, some dumbass didn't put a foreign key constraint on the currency column".
- smallegan 15y agoYour suggesting that all data is stored in the same database. In most large environments this is not the case, in many cases data is coming to and from many 3rd party systems and it is the job of the developer to make these systems work together.
- SomeOtherGuy 15y agoNo, I am suggesting that we already have a solution for "I need a single authoritative source of rules about this data". And it is called a database. Treating your database like it is just dumb storage is what creates these problems in the first place.
- Domenic_S 15y ago> It is called a database. Nice. I'm going to spoil the surprise and just tell you: in enterprise environments there are tens or hundreds of databases talking to one another through all kinds of different layers of orchestration, and the One Person In Charge of database #24 is never the One Person In Charge of databas #81. What you're talking about is a "Single Source of Truth", and for most large companies it's a pipe dream. Very large technology companies try to -- and somewhat do -- solve some permutations of this problem (see: IBM Initiate), but enterprise environments are by and large held together with bubble gum and duct tape. Don't even get me started on data sets that have to join living in different timezones when timestamp is critical. There are rules for this sort of thing, but chances are nobody who's on the project knows what they are.
- jaryd 15y agoOblig: http://globalnerdy.com/wordpress/wp-content/uploads/2007/12/bug_vs_feature.gif http://globalnerdy.com/wordpress/wp-content/uploads/2007/12/...
- eitally 15y agoThis kind of thing is the bread & butter of enterprise developers. 80% of time is spent either debugging funky problems caused by undocumented or unsupported integrations, or in creating new undocumented and unsupported integrations. Data dictionaries in the form Ed describes almost never exist, and are never maintained. Not to sound too much like an apologist -- and ymmv wildly across business sectors and profitability ranges -- but if software isn't your product you probably just don't care too much about it as long as it mostly works. Having just come from the "MS is finally auto-updating IE" thread, let me just say that the best thing for repressed developers in the enterprise has been the browser wars. So much crap has broken over the last year, with re-architecting & re-writing being the only viable options, that companies are finally starting to be forced into listening to their engineers. I love it. Big opportunities for consultants, I imagine, not to mention the "good guys" in the internal IT departments.
- FuzzyDunlop 15y agoThe first thing I naïvely thought is: currency codes are an ISO standard, and are always three characters long. Why would the relevant database field not have been created with that in mind? Of course, maybe it was, and it certainly wouldn't fix the bug itself if the database simply truncated the inserted string to fit (like some do).