Draft Review of Java 7 "Measures and Units"
Jean-Marie Dautelle writes to inform us that the public review period ends on July 8 for JSR-275, "Measures and Units" Early Draft. The JSR-275 will be a major enhancement for Java 7 by providing "strong" typing (through class parameterization) and easy internationalization of Java programs, preventing conversion errors. The latest version 0.8 is available as a PDF. The reference implementation is provided by the JScience project under a BSD license."
You are an authority on "strong typing in Java and C#" because you work in HR?
Search RapidShare and MegaUpload!
Looks like the death-blow for c#? I realize that there will be a lot of c# projects in MS shops, but Java has been around so long and continues to grow.
Dice.com results:
'java' - 16799
'c#' - 7305
'.NET' - 12042 (inclusive of c#)
Website Hosting
Take it from me, I work in HR at a Fortune 500 company, so I know a thing or two.
This AC is totally right. Every time I need a decision on which language I should use to implement a product, I always go straight to HR; preferably HR in fortune 500 company. Those folks really know their stuff!
As if what companies use has anything whatsoever to do with this paper... I agree Java sucks, but this has nothing to do with whether or not someone is "employable" after reading this paper - it has to do with a fairly smart group of folks trying to make Java a bit better for numerical work. (i.e. for the public sector, more often than not)
This sig used to be really funny...
I think everything should be done as derived units from Planck Units.
No folly is more costly than the folly of intolerant idealism. - Winston Churchill
Additions of features like this are useful for applications that need unit of measure conversion. I can think of a number of situations where using a mechanism like this rather than writing my own conversion could be useful. Also adding the ability to extend it yourself with custom unit's could be very helpful in some cases.
How much do additions such as this add to the overall footprint of the language? I understand that this project may not be very large but how many parallel projects such as this are being added to the codebase. I'm not sure what the benefit of adding this directly over having it available as a library. In many cases we need to keep several java instances on the same server(app specific, multi versions) this means that this footprint growth get's multiplied across the multiple instances.
This signature would be better if I was creative.
I lack a degree and my experience is to all over the map for me fit nicely into one of your fortune 500 peg holes. I'll have to continue working for one of the smaller companies that your company outsources its work to.
BTW, I do happen to user C# in my current job. However, that does not mean that there are no jobs in Java available. There is merit in learning Cobol, and trade schools that still teach it. Someone has to maintain the old code.
--- Justin Dearing http://www.justaprogrammer.net/ We're just programmers.
My car gets 40 rods to the hogshead and that's the way i like it.
Badass Resumes
This looks rather similar to the units and dimensions handling and checking available in Fortress, Sun's effort to build a new numerical/scientific computing language. In general it seems like a sensible idea -- having the option of adding extra annotation that allows for more exacting static checking and greater assurance is generally always a good thing. The only downside is that, at least in the java implementation, it is a little cumbersome and clumsy (though maybe that's just par for the course for new java versions). Now if only java could get statically checkable optional contracts as in Spec# we might actually be getting somewhere. At the very least it would be nice if they had runtime checkable contracts, properties and tests as in Fortress. Or perhaps I should just wait for Fortress to finally mature; it seems that will happen faster than java getting the features I'm after.
Craft Beer Programming T-shirts
I've spent most of the last 10 years building desktop and web applications with Java: AWT, Swing, JSP, Struts, J2EE, EJBs, and on and on.
Through all those years I've had to fight perceptions of Java being hard to distribute, slow, difficult, insecure, and over-engineered. I've done pretty well in the battle, and produced some pretty nice products.
Maybe I'm having a bit of a mid-life crisis, and I'm wondering where to go from here. I'm looking at alternatives for development: AJAX, Ruby, PHP, and Adobe AIR. But nothing out there (outside of the Microsoft world) does everything that Java does as well -- but Java just doesn't do GUI too well. Although GWT is pretty cool. And I've always thought Applets were underrated and under-utilized.
The point of this rant? Java 7 doesn't excite me in the least. Me and everyone I know are firmly planted in Java 5 (or is it 1.5? I always forget) and we don't appear to be moving to Java 6 (1.6?) -- so why should we care about Java 7 (1.7?).
Anyway, that's my rant. Any suggestions are greatly appreciated!
Rule #2 - When making a point, do not discredit yourself
Website Hosting
It sounds like this stuff comes from Sun's work on Fortress, which is a language designed to replace FORTRAN in scientific computing (and HPC). The nice thing about having units in the language is that you can use the compiler's type checking way beyond its normal boundaries. You can do this already with classes, but it's messy. You could have a distance and a time class, for example, and constructors that would take scalars and units and create them, then a speed class that would construct a speed from a distance and a time, but it would be a lot of code and very hard to read, so most people just use integers (or floats) and rely on their brains to catch conversion errors. If you add some syntactic sugar then you make it much more attractive, and reduce the errors in the program.
I am TheRaven on Soylent News
Its a one of the several neat ideas being lifted from the Fortress language.
;)
For the unitiated, Guy Steele (of Scheme fame) is building a new language for scientific computing called Fortress. It has some nice ideas that really should have been there by now. The language would have saved countless headaches in not just scientific but probably all mainstream software development projects.
Of course, its just one of the pet projects in SUN Labs
- mritunjai
I'll be flamed for sure (espec. by the usual Ruby suspects), BUT... I was once where you are now, and I ain't lookin back. ;)
My 2 cents anyhow, for what they're worth (...wait...2 cents?)
Disclaimer: I'm too lazy to RTFA
I thought we were getting the source code this year, I know we're only halfway through but...
Summation 2
Well at least it's 2 whole cents. Too many people say stuff like "just wanted to add my .02 cents" which IMO deals a severe blow to their credibility.
I like basketball!!1!
Lets see what jobs are actually out there:
-
Dice
- C#: 7303 (or 5054 if you take out all the incorrect matches on C)
- Java: 16803
-
Monster (last 10 days since it limits to 5k)
- C#: 1911
- Java: 3760
That is without comparing salaries which are on average higher for Java developers.Just goes to show how out of touch HR really is.
Which has got to be a good thing. British Imperial units are obsolete even in Britain, but still see some use. While they have the same _names_ as american units, they are different sizes. It's quite annoying to deal with code using imperial or u.s. units, but much more annoying if you don't even know which, or if the programmer didn't understand there is a difference, and used physical constants from a british textbook in america or vice-versa.
It's a common troll. You'll see the whole "I worked at micrsoft..." or "I worked in field X" at lot, followed by some stupid ass comments. Actually, the HR thing is quite common for it. Don't feed the troll people, just mod him down.
As has already been pointed out, the only thing this is going to add "bloat" to is the hard drive. This addition will take up a little extra disk space, that's it. The compiled code will still be the same, and if you don't import it the libraries won't be loaded into memory.
It's there for people who want it, and not there for everyone else.
"Bloat" as in language "bloat" -- keeping a language streamlined and powerful or bolting on endless libraries for every little thing possible.
You want the honest answer or the sugarcoated one?
Sugar: JScience is getting attention now because Sun is standardizing it through the JCP.
Honest: Because you've been living in Microsoft la-la land? JScience has been around in the form of the J.A.D.E. library for at least 5 or 6 years; probably longer. Jean-Marie has worked diligently over the years to make sure that Java has had top-notch support for scientific programming. The fact that he's getting recognition by the JCP members is nothing short of splendid. He deserves every bit of it.
Javascript + Nintendo DSi = DSiCade
That is without comparing salaries which are on average higher for Java developers.
So hiring C# developers is cheaper, which makes HR look good for keeping salaries down.
Just goes to show how out of touch HR really is.
No, it shows that HR is in touch with its goals.
Yeah, these days I am really enjoying python programming, java doesn't do it for me.
Python already has a fantastic module (Unum) to do units stuff - I think it covers everything this Java work does.
if you like making nice GUIs, check out WxPython.
Yep, still there.
Perhaps you are a perfect programmer who never makes mistakes. Some of us, despite our best efforts, do make mistakes occasionally; perhaps we simply weren't thinking about how this code would interact with someone elses code at the time; perhaps we just made a typo; perhaps we hadn't quite had our coffee yet; who knows, but mistakes happen to everyone (except, apparently, yourself). In the case that mistakes creep in, it is nice to be able to catch and fix them as early as possible, rather than having a complex and expensive bug hunt somewhere down the line. Spending a moment to actually document requirements and intentions in a form that can be checked (be it statically, or automatically at runtime if you leave checks on) efficiently and regularly is a good thing. Most of us do that already in the form of static types which are checked at compile time. Adding some expressivity to that (via a more powerful type system, contract annotations on methods and objects, an automated unit testing system, or just extra static checks on units) isn't a bad thing, especially if it is optional (as it often is).
I can have some sympathy for the complaint that adding bits and pieces in this rather piecemeal (and in the case of this particular implementation, somewhat clumsy and verbose) fashion is poor. Ideally adding means to decently document and express requirements and intentions should be something added to the language as a whole, with an overriding vision of how it should work. For that see Eiffel, Spec#, Fortress, or languages with more expressive type systems like the ML family and Haskell. Still, with something as simple and encapsulable as dimension and unit checking, why not just throw it in as a convenient optional extra? If you don't like it, don't import the library that implements it.
Craft Beer Programming T-shirts
It might be possible to do something like this with Linq, although I haven't looked at that much yet.
My question is, when will Sun rip off formal property definitions? Or did they already and I missed it?
> Take it from me, I work in HR at a Fortune 500 company, so I know a thing or two.
HR? I'd be surprised if you know what color database has the most RAM.
It's a natural extension of templates.
My chemistry teacher in high school taught us to think this way, you got no credit for your math unless you carried the units around.
- There doesn't have to be a big performance degradation, most of the work can be done at compile time.
.
- Like templates, you are free to ignore all of this if you want to, keep coding the way you have been, and maybe dabble with it where it's convenient.
- It's okay to accept some overhead in the name of helping to ensure program correctness. If you disagree with this statement, then you'd better be prepared to show me the blisters on your fingers from entering code via the front-panel switches.
- If there's a real concern for performance, there can be a run-time switch to turn off the checking, which you can enable after you've run the code through all your testing.
Just because it's easier, more beautiful, compact, and enjoyable doesn't make it a two-seater miata! /and when i thought programming really wasn't fun, and there was just too much toil-per-feature, i found it myself. and at least programming is fun again! //Python3000 will have interfaces
CS majors know the time/space tradeoff, but they never get taught the 3rd, crucial, tradeoff of the set: comprehension!
inches i = 10;
// 1.453^10 volts
kilograms j = 40;
dollars k = 70;
print(i+j+k);
"Perhaps you are a perfect programmer who never makes mistakes. "
I never claimed as such. All I am saying is that you can never remove the poor programmers and mistakes by wrapper libraries alone and sometimes giving them a crutch is worse than forcing them to think more about what they are doing.
"Most of us do that already in the form of static types which are checked at compile time. Adding some expressivity to that (via a more powerful type system, contract annotations on methods and objects, an automated unit testing system, or just extra static checks on units) isn't a bad thing, especially if it is optional (as it often is)."
Automatic checks only go so far, and if it's optional then it's even worse -- failure through ommission.
Relying on the things you list alone will result in abject failure, not only in the system itself but the philosophy of the developers -- "I did xyz, I'm safe, there will be no errors." There's only so much you can do within the base language itself before you start catering to the stupid and putting the system in a nice, safe, less-useful box.
"I can have some sympathy for the complaint that adding bits and pieces in this rather piecemeal (and in the case of this particular implementation, somewhat clumsy and verbose) fashion is poor."
Yes, that's what I was getting at, IMHO a lot of things were just bolted on. As one example, there is double, Double and BigDecimal -- you can understand the reasons for each of them, but in the end the implementation is clumsy at best.
But I guess that's just a philisophical argument that languages themselves should be as streamlined as possible.
This can only lead to one thing. Or rather, many confusing things.
1. "Measures and Units" version 1.0. 2. "Measures and Units" Enterprise Edition. 3. "Measures and Units" on struts. 4. "Measures and Units" version 1.1. 5. "Measures and Units" version 1.2. Compatible with code written in 1.0, but not 1.1 nor EE. 6. "Measures and Units" for mobile devices 1.0. (Compatible with 1.1, but not 1.2, 1.0 nor EE.) 7. "Measures and Units" 1.3 for SunOS. (Requires a patch to the OS to make it work)
This will make our unit conversions so much easier.
I've spent most of the last 10 years building desktop and web applications with Java: AWT, Swing, JSP, Struts, J2EE, EJBs, and on and on.
If have done a fair amount of that too and my biggest gripe: having to write user interfaces in source code or UI builder generating source code! The problem with this approach is that you are tied into some builder and the code generated is ugly. Compare this it to Visual Studio (on MS-Windows) or Interface Builder (on MacOS X) which both generate binary resource files indicating how things should be laid out. With Interface Builder you design your GUI and then tell which are the handlers in the source code for handling the UI even. For me this is the one thing that needs to be sorted out in Java if it is going to be taken seriously for desktop applications.
Jumpstart the tartan drive.
LOL when I want advice on an applet....I'll ask one of you. When I want advice on my chances of being hired....I think I'll go with HR. After all one of you even said:
This AC is totally right. Every time I need a decision on which language I should use to implement a product, I always go straight to HR; preferably HR in fortune 500 company. Those folks really know their stuff!So let's be fair accross the board and use that as an example.
When I want advice on job marketability I'm going straight to someone with Java experience, preferably and underpaid person, those folds know their stuff.ROFL
This is Slashdot! Give me the latest gadget, bug, or OS project! This ain't english class so don't confuse the two!
The idea is based on the philosophy that numbers do not exist in isolation. It is possible to speak of, e.g., the number 5 as an abstract entity unto its own, but that should be rare. Most of the time, "5" refers to the ratio "5:1", where the "1" refers to something tangible. In science, the "1" is denoted with units. The problem is, starting with tabulating machines, then onto electronic calculators, and even multi-gigabyte computers, numbers are almost universally represented (erroneously) as the former -- purely abstract numbers. The units are stripped off.
As any struggling physics or chemistry student knows, one can fake one's way through a test by doing "dimensional analysis" on test questions. If the units cancel out properly and agree, you've probably got the right answer.
Compilers should be doing dimensional analysis at compile-time. I had originally hoped to create C++ templates -- which are evaluated at compile-time -- to do this, but I couldn't quite see how to get them to handle all the possible permutations of unit combinations and conversions -- at least not easily. It really needs to be built into the language.
With a compiler enforcing dimensional analysis, it would force programmers to think through every formula and calculation. Novel unit combinations would arise as a result of creating database reports. E.g. a payroll report might have $/2-week pay period. A conversion somewhere to $/year would be another unit, and the conversion between $/2-week pay period and $/year would be clearly definied in one place rather than sprinkled throughout the code.
Putting conversions in one place is the first thing I did when I cleaned up some pre-existing source code that I took over. I explicitly created three coordinate systems (device, world, and screen) and created two two-way conversions to go between the levels. Before that, there were conversions all over the place, each a little different, each with different handling of roundoffs and some even with hidden fudge factors. ("Conversions in one place" can be done without developing a units system, as it has its own benefits.)
I blame a lack of education on the philosophy of numbers for programming languages relying upon naked numbers for so many decades. Rote algorithms for addition, subtraction, multiplication, and division taught in elementary school are the foundation of this vacuous philosophy.
It could even be responsible for the public's acceptance of no gold standard for the dollar. They're not demanding to know what the reference point of "one dollar" is.
And of course it's the Federal Reserve that can print endless money for the war in Iraq, thank to the lack of a gold standard.
So there you have it -- lack of units in programming languages and the war in Iraq have a common cause: the lack of correct philosophy on numbers taught in schools.
Relying on the things you list alone will result in abject failure, not only in the system itself but the philosophy of the developers -- "I did xyz, I'm safe, there will be no errors." There's only so much you can do within the base language itself before you start catering to the stupid and putting the system in a nice, safe, less-useful box. Are you then implying that we should remove the ability for checks because lazy and poor programmers will abuse them? You seem to be suggesting that if we provide any checking then developers will "use it as a crutch" and not write good code. At that rate why bother with type checking, since that's just an extra crutch that makes developers lazy and expect that things will work. While we're at it why not remove syntax checking altogether; surely giving developers hints about syntax errors just makes them lazy instead of carefully inspecting everything they write. Let's just have the compiler take a best run at compiling the code, and if there is any syntax it can't parse it can just fail silently and let the developer work out where it is. Just because some people are stupid enough to think that auotmated checking makes their code error free doesn't mean it isn't good to provide automated checking for the rest of us for whom it is useful. There will always be idiots, and you won't magically make them better programmers by failing to catch obvious mistakes.
Craft Beer Programming T-shirts
People who work at Verizon have as much right to post as anyone else.
Such that if a.qty = 1 and a.unit = foot
and b.qty = 12 and b.unit = inch,
c
Confucius say, "Find worm in apple - bad. Find half a worm - worse."
Although still in it's infancy, JavaFX kinda sounds interesting. I've played around with it a little bit, and it's definitely fun. There are several examples out there showing you how it's done and they get the point across pretty well. It's supposed to be an alternative to Flash and Silverlight and although showing promise, it definitely falls short in it's multimedia capabilities(sound and video). Multimedia would perhaps be the killer feature to add to Java 7. Anyway, they're supposedly optimizing Java 7 to handle JavaFX and JavaFX Script and this is perhaps one of the features that "might" encourage people to upgrade.
https://openjfx.dev.java.net/
Btw, JavaFX was previously known as F3 (Form Follows Function?) for those that may be looking up more details and examples of it.
Not sure about where you work, but at the fortune 500 I work at the HR department doesn't know the difference between a C# developer and a Java Developer, on their papers it just says "Jr./Sr. Software Developer." I never once spoke to an HR representative before being hired so I am pretty sure they have no clue what I do. This is made even more obvious when I read job postings looking fro 5 years of experience in a technology that has only existed for 3 years. Heck the only thing HR cares about is how you score on their Personality Index, not if you have any applicable skills.
I'm not trying to knock the work HR does, I mean I like getting paid, but taking their opinion as a measure of marketability is a joke. Hiring Managers are not in HR, at least not any where that I have ever worked or interviewed. The people that make the decision on who to hire and what technology to use are low or mid level managers in the technology department.
...what the programming language of the future will look like but I know it will be called "Java"!!!
Case in point: As if EJB3 has anything to do with EJB2 other than sharing the same name.
[signature]
We have been using the JScience package to record a variety of internal data about a (we hope!) large scale statistics intensive website we've been building. It is actually a breath of fresh air not to have to worry about accidentally confusing impressions per minute with unique visitors per hour, but rather letting the compiler do the worrying for you. This will be a great addition to Java, but you don't need to wait, JScience's implementation is robust and we've been using it in production for months.
Hiring Managers are not in HR, at least not any where that I have ever worked or interviewed.
Hmmm then maybe you work in one of those special career paths or I do, because EVERY job I've had I've been hired AND fired by HR; well except the one I'm at now, but thats only because they haven't gotten around to firing me yet.This is Slashdot! Give me the latest gadget, bug, or OS project! This ain't english class so don't confuse the two!
All hiring and firing decisions I have experienced have always been by technology managers, the one I was too, or did, actually work for, and they just needed rubber stamping from HR. (with the one exception being the CEO that let personal feelings affect work decisions, and he wonders why I thought he was an idiot) I wouldn't take a job if it was HR that made those kind of decisions. There is no way I would be caught dead working for a manager that didn't decided their own staff.
What aspect of C$ is poorly designed compared to Java?
I didn't know Verizon posted around here.
Please answer the same question for C#.
Actually I find this JSR very interesting. However I wish it also covered Money. Money is very complex as well and used in most business software. It has problems that are similar to that of units and measures.
rm -rf java.measures.imperial_units.*; // fuck you England with your mummy, the Queen.
:P .\n");
import java.measures.international_metric_system.*;
class MeTeR_MeaSuRiNG_THe_LiGHT {
public static void main(String args[]) {
System.out.println("Light's speed = 300'000 Km/s more or less
}
}
Umm... I hate to point this out, but it tends to be the US which are clinging on to imperial measures. We're quite happy over here with kilograms, metres and litres. Sure the road signs haven't changed (More's the pity), but we're getting there.
Incidentally, why put speed of light in that stupid form? 3.00*10^8 is a much nicer way, and deals with significant figures to boot!
How many people can read hex if only you and dead people can read hex?
Python is fucking retarded.
Whoever thought it was a good idea to use TABS instead of BRACKETS needs to be shot in the face for being a retard.
"It could even be responsible for the public's acceptance of no gold standard for the dollar. They're not demanding to know what the reference point of "one dollar" is."
I really don't understand this obsession with the Gold Standard. A gram of gold has no intrinsic value either, any more than one US dollar does. (Other than for making connectors on circuit boards). Its value, like the dollar, lies purely in what other people are willing to exchange for it - and like a paper currency, that 'value' can fluctuate wildly. Gold is simply a fiat currency on a global scale, and its arbitrarily assigned market value bears no relation to any true wealth. The same for every single other investment or speculation commodity, be it diamonds, yen, shares, futures, tulips or bets on horses down at the local track. If its value derives entirely or mostly from *other people's subjective valuation of it* then it's an illusion, a Ponzi scheme that just hasn't collapsed yet - but drop someone in a desert with the choice between a gold bar and a bottle of water, it will.
Gold's main value as a currency was because 1) it didn't corrode, 2) it wasn't useful for anything else, and 3) it was produced at a slow but mostly constant rate (but not at a rate usefully matching the actual growth of economies, leading to huge abberations like Spain's inflationary spiral after gaining South America's goldfields, and the gold rushes of the 1800s)
Basically gold was just a crude mechanical approximation of a cryptographic reputation protocol implemented in ore. Its failings as an estimator of personal and social worth are legendary. We can do a lot, lot better.
Now: if you pegged a currency to a basket of useful commodities or social indexes: water, food, housing, textiles, domesticated wildlife, access to healthcare - the things that a person or society can actually *use* as primary units of biological energy and production - then you'd have a currency with *real* intrinsic value, and you could start talking about having a philosophy behind your money.
You are not a brain: http://books.google.com/books?id=2oV61CeDx-YC
"Mi camión que tiene una potencia de 400 cerdos bate a este LandsRover con una aceleración punta de 666 patas de cerdo por latido del corazón de cerdo al cuadrado".
Es que "We've using the new Marranos's system" to be the new proposal for the "camioneros's idiot people".
The camioneros's leader is Homer Simpson.
Too cryptic? It's lesser cryptic than the imperial feet!!!
It's a bit of joke when we encounter MS .NET competitors in the mid-large size arena.
Firstly they die on price as they have endless expensive requirements for MS product.
Secondly the die on portability. Our stuff scales to Z-series mainframes down to laptops, Linux, BSD, OSX *unix and MS Windows are all supported. Our competitors: Works on all kinds of OS - XP _And Vista.
Thirdly they uniformly offer MS SQL Server as _the database. We support 19 database targets including that one.
It makes me laugh. Monolithic vs choice. Most businesses will go choice in my experience.
Really?
I'm assuming that you were only interviewed by an HR person? That they talked to you, decided you were the right person for the job, and hired you? I imagine they liked your go-getting style. Maybe they believed you were a self-starter, with good prospects to become a valuable member of the organisation?
And when you got to your team and they asked you to get to work with your 5 years experience in PL/1, you shat yourself as you only ever learnt Java at university? HR took you away, got you cleaned up, then fired you for ruining company furniture? That's pretty much the only way I can see "HR hired me, HR fired me" working in a real sense.
HR search for people, do the personality bit, the background check and administer any tests. The team you're going to go into's manager decides whether you're a good fit and whether your CV is bullshit or at best 50% true. If HR tried to hire anyone to work for me without me having done the groundwork I'd refuse to have that person in my team. But that wouldn't happen, simple because you're talking utter nonsense.
--- Band: Joey Ultra
Speaking as one of the dev guys for my company's custom IDE written in Python: "Hell No".
Swing is loads better than WxPython for... for... just about everything.
I mean, good god! Take a ListCtrl control. Now put something in it. What's that, lassie? You say you want to associate an object in memory with the item in the list? Too bad! You can only attach a long integer to it, not an object reference. So you need to maintain your own lookup table between those objects and the GUI row items at all times! Doesn't that sound like fun?
Almost as fun as needing to practically hardcode a block of integer IDs to make events that link button clicks to function calls. What fun!
Too many people say stuff like "just wanted to add my .02 cents" which IMO deals a severe blow to their credibility.
Coincidentally those are the people who work for Verizon.
this nation, under God, shall have a new birth of freedom. -- Lincoln, Gettysburg Address
or you could try some more realistic figures. many refer to developers as .NET Developers. Language is irrelevant.
.NET 12135
.NET 2559
now of course the Java numbers are actually inflated as they also pick up the javascript jobs when you search. Realistically they are both about 50-50 for market share on jobs at the moment.
Dice.
Monster
Now, Sun, if you would just fix the damn date, time, and calendar arithmetic class library! Or is 12 years not enough time?
Obviously, the fact that Java has been around 3 or 4 times longer than .NET is going to mean it has more depth. Being newer isn't a design flaw.
.NET, not so much, so you made the best decision given your skill set.
As far as your personal project is concerned, you shouldn't count the time you screwed up as time you spent on C#. It also sounds like you know Java well and
Yes, as in "strong and promotes growth."
Unit conversions are invertible functions. It simply doesn't matter which units you use as the low-level representation.
You're missing something more basic: magnitudes form the basis of an algebra that's isomorphic to algebra on the real numbers. That's the whole reason that it's possible to use operations on numbers as a surrogate for operations with magnitudes: e.g., you can find out how long two pieces of wood placed end-to-end would be by adding numbers that stand in the correct relation to the magnitude of their lengths.
The number 1 doesn't have any special properties in this connection. It's just another real number. (0 is another story, of course, because it's the identity.)
This is really a static type analysis problem. It's possible to do some of this in languages with really powerful type systems, like Haskell; here is a link to a Haskell library that performs compile-time dimensional checking.
Are you adequate?
Funny! I think the imperial system will need more than that. . . like a virus.
Ada is back.
You can defy gravity... for a short time
I'd really like to see "fuzzy" values next. Particularly fuzzy values for dates.
Almost every application out there stores absolute times. But very often you don't know the exact date and time and you'd like the computer to be able to still record, display (in localised form) and sort it according to what precision you do have - sorting "January 6, 2007" before "Some time in summer 2007". Free text fields and ad-hoc date notations suck.
I read the PDF, looks very interesting. I don't feel qualified to comment on the scientific suitability, but I have one suggestion with regards to naming:
:)
SystemOfUnits - would it be possible to rename it to UnitSystem? Easier to write, and especially easier to say in a conversation, which one sounds better if you are talking to colleagues during a code review? For instance -
"Here I've used the SI UnitSystem, but perhaps another UnitSystem would be preferable?"
vs
"Here I've used the SI SystemOfUnits, but perhaps another SystemOfUnits would be preferable?
On the other hand, to avoid confusion the SystemUnit class would then have to be renamed to something else - USUnit maybe, which looks ugly, or UnitSystemUnit which is both ugly and awkward. Hmm, difficult choice. Maybe SystemOfUnits isn't that bad after all.
Cheers,
Lars
Being bitter is drinking poison and hoping someone else will die
The reason the road signs haven't changed is more one of practicality than anything else.
Items in shops are in the supply/usage chain for a few months (at most). Cars are in the supply chain for many years.
Some speedos on cars would need a new decal, which wouldn't come cheap (removing the glass panel, applying, calibrating). This is less of a problem on cars with digital speed displays, all that takes is a firmware change to the european version.
More problematic is that every single speed limit sign, distance sign and mile marker would need to be changed at a cost of many many millions of pounds (when I saw the number I couldn't quite believe it). You couldn't even phase it over a few years as you'd just end up confusing people (maybe distance signs, but not speed signs).
Personally I'd rather that money go on improving public transport and the NHS than a pointless exercise to realign our distances with the rest of the world, it's not as if it's a big problem any more - we use metric for all of the important things these days already as you pointed out.
I am NaN
I know upgrading is not always desired or possible with 3rd party app-servers etc, but in the case of 1.6 you seriously need to consider the move. 1.6 will boost your performance considerably, while you need to change virtually nothing. It also brings along some bugfixes (which, granted, also can result in behavior changes that need to be re-tested, but you have test suites, right?) and platform improvements.
Seriously.
With great power comes great electricity bills.
To use the units of measurement easily it would be helpful if
...
Java had user definable operators or at least operator overloading.
That way a more "natural" notation of formulas would be possible.
Abstract data types would also help with measurement units
Greetings Thomas Mertes
Seed7 Homepage: http://seed7.sourceforge.net/
User defined statements and operators, abstract
data types, templates without special syntax,
OO with interfaces and multiple dispatch.
I was actually trying to create a parody of a riduculously-strongly-typed language, which I was going to call "Rosie" (something else you can have a cup of, see
reset h
h/feet = 3
h/feet/inch=3.370007
leaves h/inch equal to 39.370007 and h equal to 1. I never finished coding up the interpreter, though
Je fume. Tu fumes. Nous fûmes!
Shut up! ;)
PS: My sig is a Verizon-related pun
My 0.02 cents
Not using templates - templates weren't even reliable in G++ in those days. I did try using them, but it quickly became unmaintainable.
I used an Emacs Lisp program to generate C++ classes for every dimensional combination in our programs, and operator overloading to combine them.
For example, we had "Velocity", "Speed", "Time_Interval", "Absolute_Time", "Position", "Acceleration" and several other classes, which could only be combined in certain ways. We had different types for different numbers of dimensions, too - 1d, 2d, 3d.
When compiled it all came down to simple arithmetic - nicely optimised. But any mismatch in dimensions showed up as a reasonably clear compile error. It worked really well. And it was reasonably maintainable with the Lisp code generator.