13 KiB
created_at | title | url | author | points | story_text | comment_text | num_comments | story_id | story_title | story_url | parent_id | created_at_i | _tags | objectID | year | |||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
2014-12-21T19:25:17.000Z | Is_computer_on_fire() (2000) | http://everything2.com/title/is_computer_on_fire%2528%2529 | adamnemecek | 117 | 56 | 1419189917 |
|
8780606 | 2000 |
is_computer_on_fire() - Everything2.com
__
Near Matches Ignore Exact
is_computer_on_fire()
| ----- | | (thing) | by **beek** | Fri Aug 18 2000 at 16:51:09 |
double **is_computer_on_fire(** void **)**
- BeOS kernel function, returns the temperature of the motherboard if the computer is currently on fire. Smoldering doesn't count. If the computer isn't on fire, the function returns some other value. (Be Book)
see also: is_computer_on()
to be consistent with the naming conventions used in the rest of the BeOS API, this function should really be
static bool BComputer::isOnFire();
and should return false if the computer is not on fire. I guess it's okay to return an undefined value when the computer is on fire.
| -----|
|
| I like it! | 1 C! |
| ----- | | (idea) | by **ariels** | Thu Sep 14 2000 at 11:34:11 |
This definitely lowers my opinion of BeOS. The coding style used is terrible! You should never name your predicates is_
something. A predicate is not _asking_ a question, it is _answering_ it. Consider this code fragment:
if (is_computer_on_fire()) { dump_halon(computer_room); }
You cannot read it out loud, because it doesn't sound like English.
Much better alternatives would be [computer][8]_is_on[_fire][29]()
, computer_on_fire()
or the Lisp-like computer_on_fire_p()
(using the -P convention). All of these let you read your code.
| -----|
|
| I like it! | |
| ----- | | (idea) | by **SlightlyMadman** | Thu Sep 14 2000 at 13:34:22 |
Actually, ariels, I'd say your suggestions are just as flawed. The big problem I see with this function, is that it looks, by its name, to be returning a boolean value, where it actually returns a double. I say it would more properly be named something along the lines of getFlamingMotherboardTemperature, or something like that.
Of course, I was greatly amused by this, and is_computer_on(), and immediately included them in the function library I'm currently using in a production system, to replace the random number generators.
| -----|
|
| I like it! | 1 C! |
| ----- |
| is_computer_on() | The -P convention | lpt on fire | New UNIX filesystem permissions based on Everything2 behavior |
| Be Book | BeOS | Products that shoot flames | Response.IsClientConnected |
| Smoldering | Homeward Bound: The Incredible Journey | Predicate | Basic |
| Fire | Geeks | halon | double |
| Splinter | temperature | strfry | LISP |
| computer | | | |
Log in or register to write something here or to contact authors.
Sign in
| ----- |
| Login | |
| Password | |
remember me
Lost password
Need help? accounthelp@everything2.com
Recommended Reading
About Everything2
User Picks
- So, You Bought a Child Sex Doll.
- Saxophone
- Honeybee Language and Wittgenstein
- Ludwig van Beethoven
- Tempo in chess
- Etan Patz
Editor Picks
- Thermopylae
- Don't Leave Before the Miracle
- George W. Bush's address to the UN General Assembly: September 12, 2002
- Why eat imitation food?
- closed captioning
- Spontaneous human combustion
New Writeups
- Justin Trudeau's Whacky Indian Adventure (person) by TheAnglican
- transposing instrument (thing) by TheAnglican
- icky (fiction) by lostcauser
- It has been claimed that some or all of this article or section is incoherent and not understandable, and should possibly be reworded if the intended meaning can be determined (log) by gate
- I'm going to have to ask you to leave (thing) by Bethaven
- Saxophone (thing) by TheAnglican
- Office Romance (poetry) by syntaxfree
- February 22, 2018 (log) by Stasik
- zoot (person) by TheAnglican
- The Muppet Show (review) by TheAnglican
(more)
Everything2 ™ is brought to you by Everything2 Media, LLC. All content copyright © original author unless stated otherwise.
Let sleeping demons lie.