Want to read Slashdot from your mobile device? Point it at m.slashdot.org and keep reading!

 



Forgot your password?
typodupeerror
×

Comment Re:Hungarian Notation (Score 1) 731

The user is a developer, and the code will crash if they do, so that's their own fault. The point is to make sure damn well they know what they are doing if they do.

When programming, the language should take care of the type checking, and the programmer should take care of ensuring the data that was input to the function was valid within that domain.
This can be achieved by defining a new type if it's a new type of data (for example an class for an IP). Then the user won't be able to pass the wrong type of data. This is part of the reason why OOP is powerful, it adds type checking to the compiler.
PHPs OOP support added the ability to restrict the type of a variable, with non freely converted types (int, string, etc), with once exception.

It's a flaw in PHP that you can't force a user to pass an array, even though PHP doesn't automatically convert between it and primitives.

As this is not a domain validation check, leave it to the compiler to find the flaw.

It's a waste to add checking like that to code as it doesn't offer any benefit for the end user of the code. The person who is visiting a website or whatever doesn't care that that parameter passed is an array or an int (they do however care that the value of that array or int is within the correct domain)

Comment Re:Hungarian Notation (Score 1) 731

You can tell from the function definition what the inputs should be.

The same affect can be achieved by documentation (I do also stick a bit of PHPDoc with it in too) but not every ones IDE supports PHPDoc. Most everyone's IDE supports getting the function with variables.

This save a little bit of time faffing about figuring out what the inputs should be.

Comment Re:Hungarian Notation (Score 1) 731

I use Hungarian notation in PHP.

This may seem redundant in a weakly typed language like PHP. However, things get messy when you start writing Object Orientated PHP, and you can't force a user to pass you an array, or an int. You could code in checks for it, but that's simply more code that could have a bug in it.

Comment My Favourite Place To Code. (Score 1) 508

In the office, with my boss at the other side of the office. I do get more done in a more formal environment.

However, my boss recently switched seats to be behind me, and I'm just not as productive any more..

The optimum position seems to be, boss close enough to be able to be friendly with him, but far enough away that I don't feel pressured by his presence

Comment Re:Five minutes too long (Score 1) 852

Wow, managed to fuck that up even though I'm sure it looked alright in the preview.

It should read:

"Any sufficiently advanced technology is indistinguishable from magic". However you can differentiate based on the assumptions each argument makes.

The difference I can see in the two is one assumes that a race after a large period of time developed technology that we see as impossible. A fair assumption, as we can see this in our own recorded chronology.

The Supreme being makes a much larger assumption, the supreme being must somehow exist outside of the rules that all the other characters live by, and be able to affect those who are constrained by those rules. We cannot see this from our own chronology, or anywhere that has not later been re-explained, and re-attributed to something living within the rules of the system, through investigation using the scientific method.

This is what I see as the difference between the two, and why for me, any explanation that amounts to "God did it", or "It was all a virtual reality" will be a cop-out (both situations where something exists outside the set rules of that reality). Especially in fiction, when you can make up any plethora of more exciting endings, which fit.

However, you could argue that this ending does fit the series, as it is constantly mirroring western theology, and implying someone knows what's going on.

Comment Re:Five minutes too long (Score 1) 852

"Any sufficiently advanced technology is indistinguishable from magic". However you can differentiate based on the assumptions each argument makes.

The difference I can see in the two is one assumes that a race after a large period of time developed technology that we see as impossible. A fair assumption, as we can see this in our own recorded chronology.

However, you could argue that this ending does fit the series, as it is constantly mirroring western theology, and implying someone knows what's going on.
The Supreme being makes a much larger assumption, the supreme being must somehow exist outside of the rules that all the other characters live by, and be able to affect those who are constrained by those rules. We cannot see this from our own chronology, or anywhere that has not later been re-explained, and re-attributed to something living within the rules of the system, through investigation using the scientific method.

This is what I see as the difference between the two, and why for me, any explanation that amounts to "God did it", or "It was all a virtual reality" will be a cop-out (both situations where something exists outside the set rules of that reality). Especially in fiction, when you can make up any plethora of more exciting endings, which fit.

Comment Re:Just got hit by a .exe with adblock+ on (Score 2, Funny) 285

What a poorly designed Malware site.

I was attempting to download the file to have a fiddle with it, and the JavaScript prevented me from clicking the download link by being too persistent in poping up JavaScript Cancel/Ok boxes.

They should do usability testing before releasing a product onto a production site like that.

Comment Re:That would imply that non spam tweets were usef (Score 1) 301

I agree strongly with this opinion. If you want to chat with your friends, they are much more fully featured ways of doing it via other social networks. Most of these have mobile application for them too. For example Facebook, which is (or was) based around a shared photo album, as well as your twitter like statuses, and walls for public messaging.

Twitter also doesn't work well for notifications, as you only have 160 characters, and it's pretty hard to get a full title + URL in there, let alone a summary. RSS, Atom do this much better, offering no limits on the article size. As well as this feeds are much better integrated with your browser, phone, as almost everything has a feed reader now.

Comment Re:Yes, and yes. (Score 1) 1100

That is because HP (Compaq), and Dell are big fans of the BCM43xx chipset which has long been a problem for Linux due to Broadcoms hostility to it.
But this has been solved in the kernel after the current one (.25) because the B43 driver now supports Rev 01 and Rev 02 chipsets without being buggy.
All you have to do is paste the firmware into the firmware folder, I presume for the next release Ubuntu will have a GUI clicky thing for this.
Unfortunately Hardy is the .24 kernel, but full support isn't far away :)

Written from a laptop with a BCM4312 Rev 02 on the .25 kernel

Not sure if Toshiba are a fan of Broadcom, but they probably are.
Privacy

Submission + - 700mb of Media Defender e-mails leaked (torrentfreak.com)

Lonin writes: "It appears Media Defender, the company behind the supposed honeypot trap video sharing website MiiVi.com, and friend to the MPAA, is going to have a very bad week. Some 700mb of e-mails, some as recent as September '07, were leaked onto the net and are being uploaded to various torrent sites as we speak. The e-mails have only been skimmed so far, but it appears to show the inner workings of a company dedicated to lying and entrapping people in the name of copyright. This should be interesting."

Slashdot Top Deals

Math is like love -- a simple idea but it can get complicated. -- R. Drabek

Working...