Re:Why is "plus " more readable than "+"?
on
Java Gets Templates
·
· Score: 2
Why is the assignmed to c inherently more readable than the assignment to d?
Example: Foo is a type where for c=0, the plus operation results in infinity (convoluted example, I know). How does plus() handle that case? Does it throw an Exception? Does it return a NaN? Does it return Infinity? Can you have all three choices available? How do you distinguish them?
With +, you can't verbosely specify the behaviour and implement all three cases -- see my other post in the thread. With the method notation, you can have:
Foo.naturalPlus()
Foo.integerPlus()
Foo.bigNumberPlus()
Note that I don't assume that method notation is the best for all cases. I'm stating that 95% of the uses of operator overloading, to use operator notation for user-defined types, fall into this kind of traps, and make code terribly difficult to read.
The language should not be expected to prevent you from defining functions named toString() just because they don't perform the function you think they should. Why should it be any different with operators?
Operators, to be usable, should be very terse. Three characters maximum is a good recommendation. Most operators are one or two characters.
With that short a definition, the operator's meaning must be inferred by the reader's culture. + is the arithmetic sum operator. We know what it does after working with it for years.
Methods, on the other hand, can have extremely verbose names. That is one of the good things on the Java coding guidelines. Names are verbose. There's no strcmp. There's String.compareTo. If the compare is case insensitive, there's String.compareToIgnoreCase.
Objectively, you are right. There's no guarantee a function performs what its name implies. However, if a function's name is incorrect, I can smack the developer on the head. If an operator's name is incorrect, the developer may have done it right, since having an operator named multiplyTransposeAndNormalize is awkward. It's the whole concept of operator overloading that is wrong.
Please don't. Operator overloading is one of those cool features that tend to create write-only software. I don't want the meaning of '+' to be different every time I look at it in someone else's code. And please, don't come up with the string concatenation example.
<irony>
1+1=3 for large enough values of 1 is the most I can concede in operator deviant behaviour.
</irony>
Please site your references for this "fact" (actually, I suppose that you're not far off but I'm not interested in what you or I "feel", I need real references).
I can't. Its a purely speculative number, which I believe is highly conservative. Lowering it to 70% or 60% wouldn't invalidate the conclusion, however.
This has some truth, but the bottom line is it's MY software, not yours to decide what's best for society.
I was not defending that people should be *forced* to release s/w in open-source. Not by any chance!!! I was discussing what "Is the big deal with OSS". My conclusion was: The big deal is that it's the most globaly efficient means of producing goods (generically). I don't even defend it's the most efficient means of living off software. It likely is, but time still has to come and prove that.
Oh, and go ask any civil engineering company for even some details on the physics modeling software used for the last major bridge that they built.
The civil engineering example was not accidental. Unlike software, bridges are there for anyone to inspect. Case study:
Back in the end of XIX century, Gustavo Eiffel built a record arch bridge in my home city, the D. Maria Pia bridge. Back then, naturally, the design method was a secret, and Eiffel was known for rigid safekeeping of those secrets.
How long did it take for the record to be beaten, with the same construction type, the same construction methods, and a different engineer? Eight years. The time to build the D. Luís bridge. Did Eiffel lose a lot with the spreading of his construction methods? No! In fact, on the contrary. He was at his time regarded as an innovator, and spawned an era of iron and steel constructions of epic proportions.
Fact #1: 90% of code -- or better yet, coding time -- is used in app customization and internal app development. This is conservative. There are zillions of smallish apps that boxed software doesn't cover.
Fact #2: Comercial distribution methods existing prior to OSS were unable to get software and software libraries on the hands of developers in a timely and costly fashion. I won't dwelve on the reasons for this, but it is a fact that if you worked in a company ten years ago and asked for a license of the XYZ library, 5/10 times it'd get refused, and 3/10 it'd take so long to purchase it'd be useless.
Consequence: Software developers working with closed code only, are destined to reinvent the wheel countless times. Creating the same XML parser as their competitor down the corner, reimplementing quick-sort for a smalish processor, etc...
OSS solves this problem. Granted, it solves it, costing a lot to the sellers of the 10% mass production code. Accidentally, these are also monopoly owners and own a much larger share of the software market income, by grabbing the specific software value, and selling it at mass production rates -- which would bring prices down in any other industry.
Overall, the whole economy is much more productive with OSS. Today, this is a fact. There are no signs that the rate at which software is produced is decaying because of OSS. If it is not, and if software is costing less, efficiency is rising. If efficiency is rising, I couldn't care less for the Microsofts and Oracles of this world.
Some of this could be transposed to other professions. But then again, I don't suppose civil engineers hide the algorithms for calculating suspension bridges. Not now, and not when those were invented.
If you still didn't buy your servers, IBM's xSeries servers come with a watchdog integrated in the motherboard. They call it Automatic Server Restart, and works like any other watchdog. Set it up, call it every x seconds. Fail for n times, and the machine reboots on its own.
If the xSeries has it, I'd imagine the pSeries does too -- but, alas, I have none of those:-P
No, you're wrong. It's correct installing binaries into/opt. From the FHS. On/opt:
/opt is reserved for the installation of add-on application software packages.
A package to be installed in/opt must locate its static files in a separate/opt/ directory tree, where is a name that describes the software package.
On/usr/bin:
This is the primary directory of executable commands on the system.
So, something like ls or grep goes in the/usr tree, Something like apache, should go into/opt/apache. It's a damn shame most distros miss this. It makes up for a mess, putting httpd.conf in odd places, like/etc/apache2/httpd.conf (Gentoo), or/etc/httpd/httpd.conf (Redhat), or/etc/httpd.conf (SuSE 6.*), or/usr/lib/apache (I don't remember the distro). And php.ini, when PHP is installed is placed in even stranger locations.
True. But off the top of my head, I remember at least three recent updates that affected ssh: one for glibc, which allowed privilege escalation, one for libzip for buffer overruns, and one for openssh itself -- which never was clear if it would allow remote compromise.
Few services == lower maintenance != no maintenance.
You'll want your security advisories delivered to your doorset, with quick and easy updates. If yor time is worth a dime, go for a commercial distro. I'd use SuSE:
That's about a month/month-and-a-half. Don't you think they deserve a good solid two months before posting the exploit?
Nope. If the bug allows someone to have complete access to my computer, for two months, I'd expect MS to release a patch that disables enough features for the bug to be also disabled.
They're just about the same as taking the hands of the wheel in a bike. It just goes forward.
The problem with sleds is that it is very common for the driver to jump off. Without the auto turning feature, one would have to fetch the sled at the bottom of the slope. Not to mention the sled would get there uncontrolled.
If I can't do crap about fixing it, what should I do, stop using the www?
YES!!! Let me repeat that if you didn't get it: If the software you are using has a security flaw with grave enough consequences, you should stop using the software.
Now, who can better evaluate whether a security breach is serious enough to stop me from using the software? Microsoft, or my organization??? Isn't this obvious?
And I don't come whining with the "users don't care" crapshit. I care. That's enough reason for Microsoft to release advisories when the flaws are found, not when they're patched.
c) This same thing can be said about virtually any other MS program. I run Microsoft SQL Server because it's a very powerful, cost effective database system. I use Visual Studio.NET because it's a fantastic development environment that I've never used a rival to.
You almost had me, up to this point. MSSQL server is good database, but its not an excellent database. Oracle is an excellent RDBMS. MSSQL is more at the level of postgresql, which is open source, and thus much more cost effective.
I didnt get my hands on VS.NET, but for the other Visual Studios, I must say they can't hold a candle to the likes of VisualAge (link is for Java version, but there are others) from IBM. They dont have decent repository built-in, no automatic error detection, and very very poor source code navigation.
1) Whoever gets to the market first, and has more zealots is best (where best=more credibility, more freedom, more quality)
2) Linux should never approach companies, and capitalist markets, under the risk of losing freedom.
3) Linux distribution quality is measured largely by the ability to run in older hardware. Conversely, ability to adapt to new hardware features is irrelevant because no one measured it.
Answering point by point:
1) You should be running a *BSD. It has been around since the late 70s. Its zealots are by far the most fanatic among the OSS crowd. Security and stability are unbeatable by Linux. Its harder to run. Harder than Debian, now that I come to think of it that way.
2) Some companies are likely to see linux as a strategic advantage. In fact, IBM, the main supporter behind Gentoo, is one of them. It'd be stupid to forfeit this help. See this article for some insight on IBM's (and others') motivations on OSS.
3) I totally refuse this "old hardware" vision. And it's not that you can't install older software on a Gentoo distribution. Just emerge older ebuilds. The fact that you *can* emerge recent software doesn't mean you *have to*. And to think you have to measure the gain in performance from i386 asm to P4 asm is unclassifiable.
I was inclined to moderate you as a troll. However, curiosity beat me:
Apart from birth times, how the heck is Debian at the center of the "revolution" and Gentoo isn't, or why do you think Debian is free and Gentoo isn't?
If you are not going to give an informed answer, and will just repeat distribution zealotry, please refrain from answering.
If you can get your hands on a 50hp electric car, you'll be amazed. Electric motors can (and have) flat power/rpm curves. This means that you get engine response right from 0rpm. It's a huge difference. Maybe not for a sports car, but immense for a city car.
Combine this with the ability to lose the gearbox; and with the fact that americans love those incredibly inneficient automatic gearboxes, and real on-wheel output from electric cars will suprise a lot of people.
Your car is a machine that transforms energy. It's quite inefficient at that, largely because of the weight constraint. Adding more weight for the parts to make the engine more efficient causes loss of efficiency in it's primary use: transportation.
An energy conversion central, even if petroleum based, will be MUCH more efficient. Losses by heat dissipation are smaller because of the scale of the central, and the technology that can be used is entirely different, because the constraints are entirely different.
You'd still have to account for losses in transportation and in the electric engines. Electric energy transportation is extremely efficient. You have losses of about 2% for distances of thousands of kilometers. Fuel lorries spend a lot more that 2% of their load to move for thousands of kilometers. And electric motors are the most efficient motors known to mankind, with over 95% efficiency.
More than that, a move to Hidrogen fuel cells paves the way for decoupling of car technology and "energy generating" technology. We can start with petroleum based powerplants and move to dams, wind power, solar power, whatever, without losing the investment in vehicles.
if I can't stand having mymenus lagbehind my mouse clicks,
Huh? Menus haven't been lagging for almost a year's worth of Moz releases.
For the record, my home system is an Athlon 1200/512Mb and my laptop a P4 1400/256Mb. Both run Linux -- which isn't Mozilla's primary platform. None have lagging menus.
People I know who're using mozilla -- including some newbies -- say it's faster than IE. This is probably because of the better rendering engine (and not having to close Casinoonnet popups and X10 popunders:-)
You might want to have a look at oeone. It's not a distro, but a user environment specifically designed to be simple and foolproof, with a limited set of functionality. Couple it with some kind of LiveCD such as Gentoo's and you're set.
An F-1 pilot picks a gear and presses a button to launch. If he stalls, they have to run out with a laptop to reset the launch sequence.
No no no. This is not a space-shuttle. It's a gasoline engine, much like what Benz originally created 100yrs ago. If it turns fast enough and has fuel, it starts.
It has nothing to do with the computer. F1 cars don't have an electrical starter. It'd be stupid, since they can use an external one to start the car. It would just be deadweight during the race. Even if nowadays they make the car lighter than regulations, it'd be stupid to add a starter because its a weight which they can't move to balance the car.
No harm done. Slashdot comments tend to be read harsher than they were written.
The last PPC I used was an iPaq. I don't like it. The iPaq seems nice in the outside -- perhaps a bit oversized. The interface, however, just doesn't feel right. Lots of little things. Smallish buttons, crowded interface...
It's just the opposite feeling you get from sitting in front of a Mac interface (I'm not a regular mac user, I use Windowmaker/Linux).
Oh. By the way. Product development since then? Zero, zip, niente, nada de nada.. You are wrong. As simple as that.
I stand corrected. Palm OS 5 looks great. However, you must agree that for the last 5 years, we've seen nothing new. New palms can do the same thing as older ones, and are just heavier/power-hungrier. This is reflected in this quote from the text you referenced:
"This is just the beginning of a very aggressive roadmap -- a new era of innovation for the platform," -- Dave Nagel, CEO of PalmSource
With +, you can't verbosely specify the behaviour and implement all three cases -- see my other post in the thread. With the method notation, you can have:
- Foo.naturalPlus()
- Foo.integerPlus()
- Foo.bigNumberPlus()
Note that I don't assume that method notation is the best for all cases. I'm stating that 95% of the uses of operator overloading, to use operator notation for user-defined types, fall into this kind of traps, and make code terribly difficult to read.With that short a definition, the operator's meaning must be inferred by the reader's culture. + is the arithmetic sum operator. We know what it does after working with it for years.
Methods, on the other hand, can have extremely verbose names. That is one of the good things on the Java coding guidelines. Names are verbose. There's no strcmp. There's String.compareTo. If the compare is case insensitive, there's String.compareToIgnoreCase.
Objectively, you are right. There's no guarantee a function performs what its name implies. However, if a function's name is incorrect, I can smack the developer on the head. If an operator's name is incorrect, the developer may have done it right, since having an operator named multiplyTransposeAndNormalize is awkward. It's the whole concept of operator overloading that is wrong.
<irony> 1+1=3 for large enough values of 1 is the most I can concede in operator deviant behaviour. </irony>
Back in the end of XIX century, Gustavo Eiffel built a record arch bridge in my home city, the D. Maria Pia bridge. Back then, naturally, the design method was a secret, and Eiffel was known for rigid safekeeping of those secrets.
How long did it take for the record to be beaten, with the same construction type, the same construction methods, and a different engineer? Eight years. The time to build the D. Luís bridge. Did Eiffel lose a lot with the spreading of his construction methods? No! In fact, on the contrary. He was at his time regarded as an innovator, and spawned an era of iron and steel constructions of epic proportions.
Fact #1: 90% of code -- or better yet, coding time -- is used in app customization and internal app development. This is conservative. There are zillions of smallish apps that boxed software doesn't cover.
Fact #2: Comercial distribution methods existing prior to OSS were unable to get software and software libraries on the hands of developers in a timely and costly fashion. I won't dwelve on the reasons for this, but it is a fact that if you worked in a company ten years ago and asked for a license of the XYZ library, 5/10 times it'd get refused, and 3/10 it'd take so long to purchase it'd be useless.
Consequence: Software developers working with closed code only, are destined to reinvent the wheel countless times. Creating the same XML parser as their competitor down the corner, reimplementing quick-sort for a smalish processor, etc...
OSS solves this problem. Granted, it solves it, costing a lot to the sellers of the 10% mass production code. Accidentally, these are also monopoly owners and own a much larger share of the software market income, by grabbing the specific software value, and selling it at mass production rates -- which would bring prices down in any other industry.
Overall, the whole economy is much more productive with OSS. Today, this is a fact. There are no signs that the rate at which software is produced is decaying because of OSS. If it is not, and if software is costing less, efficiency is rising. If efficiency is rising, I couldn't care less for the Microsofts and Oracles of this world.
Some of this could be transposed to other professions. But then again, I don't suppose civil engineers hide the algorithms for calculating suspension bridges. Not now, and not when those were invented.
If the xSeries has it, I'd imagine the pSeries does too -- but, alas, I have none of those :-P
tar czvf /mnt/backup/a.tgz `find -name /opt/*/etc -type d`
Few services == lower maintenance != no maintenance.
http://www.suse.com/us/business/products/suse_busi ness/firewall/index.html
here. But you'll only see them comercially in about five years.
Not that it affects me. I'm MS free.
The problem with sleds is that it is very common for the driver to jump off. Without the auto turning feature, one would have to fetch the sled at the bottom of the slope. Not to mention the sled would get there uncontrolled.
If the software you are using has a security flaw with grave enough consequences, you should stop using the software.
Now, who can better evaluate whether a security breach is serious enough to stop me from using the software? Microsoft, or my organization??? Isn't this obvious?
And I don't come whining with the "users don't care" crapshit. I care. That's enough reason for Microsoft to release advisories when the flaws are found, not when they're patched.
I didnt get my hands on VS.NET, but for the other Visual Studios, I must say they can't hold a candle to the likes of VisualAge (link is for Java version, but there are others) from IBM. They dont have decent repository built-in, no automatic error detection, and very very poor source code navigation.
1) Whoever gets to the market first, and has more zealots is best (where best=more credibility, more freedom, more quality)
2) Linux should never approach companies, and capitalist markets, under the risk of losing freedom.
3) Linux distribution quality is measured largely by the ability to run in older hardware. Conversely, ability to adapt to new hardware features is irrelevant because no one measured it.
Answering point by point:
1) You should be running a *BSD. It has been around since the late 70s. Its zealots are by far the most fanatic among the OSS crowd. Security and stability are unbeatable by Linux. Its harder to run. Harder than Debian, now that I come to think of it that way.
2) Some companies are likely to see linux as a strategic advantage. In fact, IBM, the main supporter behind Gentoo, is one of them. It'd be stupid to forfeit this help. See this article for some insight on IBM's (and others') motivations on OSS.
3) I totally refuse this "old hardware" vision. And it's not that you can't install older software on a Gentoo distribution. Just emerge older ebuilds. The fact that you *can* emerge recent software doesn't mean you *have to*. And to think you have to measure the gain in performance from i386 asm to P4 asm is unclassifiable.
Apart from birth times, how the heck is Debian at the center of the "revolution" and Gentoo isn't, or why do you think Debian is free and Gentoo isn't?
If you are not going to give an informed answer, and will just repeat distribution zealotry, please refrain from answering.
http://energy.copper.org/motor-text.html
There are lots more.
Combine this with the ability to lose the gearbox; and with the fact that americans love those incredibly inneficient automatic gearboxes, and real on-wheel output from electric cars will suprise a lot of people.
Your car is a machine that transforms energy. It's quite inefficient at that, largely because of the weight constraint. Adding more weight for the parts to make the engine more efficient causes loss of efficiency in it's primary use: transportation.
An energy conversion central, even if petroleum based, will be MUCH more efficient. Losses by heat dissipation are smaller because of the scale of the central, and the technology that can be used is entirely different, because the constraints are entirely different.
You'd still have to account for losses in transportation and in the electric engines. Electric energy transportation is extremely efficient. You have losses of about 2% for distances of thousands of kilometers. Fuel lorries spend a lot more that 2% of their load to move for thousands of kilometers. And electric motors are the most efficient motors known to mankind, with over 95% efficiency.
More than that, a move to Hidrogen fuel cells paves the way for decoupling of car technology and "energy generating" technology. We can start with petroleum based powerplants and move to dams, wind power, solar power, whatever, without losing the investment in vehicles.
For the record, my home system is an Athlon 1200/512Mb and my laptop a P4 1400/256Mb. Both run Linux -- which isn't Mozilla's primary platform. None have lagging menus.
People I know who're using mozilla -- including some newbies -- say it's faster than IE. This is probably because of the better rendering engine (and not having to close Casinoonnet popups and X10 popunders :-)
You might want to have a look at oeone. It's not a distro, but a user environment specifically designed to be simple and foolproof, with a limited set of functionality. Couple it with some kind of LiveCD such as Gentoo's and you're set.
It has nothing to do with the computer. F1 cars don't have an electrical starter. It'd be stupid, since they can use an external one to start the car. It would just be deadweight during the race. Even if nowadays they make the car lighter than regulations, it'd be stupid to add a starter because its a weight which they can't move to balance the car.
The last PPC I used was an iPaq. I don't like it. The iPaq seems nice in the outside -- perhaps a bit oversized. The interface, however, just doesn't feel right. Lots of little things. Smallish buttons, crowded interface...
It's just the opposite feeling you get from sitting in front of a Mac interface (I'm not a regular mac user, I use Windowmaker/Linux).