Follow Slashdot stories on Twitter

 



Forgot your password?
typodupeerror
×

Comment Re:Easier to Analyze or Change == More Maintainabl (Score 3, Interesting) 247

I once took over 30,000 lines of code that had been written by a subcontractor and trimmed it to around 4000 LOC. And you better believe it ran faster! Not because refactoring is magic, but because once all the mind-numbing almost-repetition was mucked out you could actually see what the code was doing and notice that a lot of it wasn't really necessary. Ever since then I have always maintained that coders should never ever copy and paste code. I've had people disagree, saying that a little bit of copying and pasting won't hurt, but I say if it's really such a little bit then you shouldn't mind re-typing it. Of course if you do that very soon you start putting more effort into devising ways to stop repeating yourself, which is exactly the point. Repeating yourself should be painful.

That's I think a reliable litmus test for whether you should refactor a piece of software. If it's an area of code that's been receiving a lot of maintenance, and you think you can reduce the size significantly (say by 1/3 or more) without loss of features or generality you should do it. If it's an area of code that's not taking up any maintenance time, or if you're adding speculative features nobody is asked for and the code will get larger or remain the same size, then you should leave it alone. It's almost common sense.

I don't see why anyone would think that refactoring for its own sake would necessarily improve anything. If an automotive engineer on a lark decided to redesign a transmission you wouldn't expect it to get magically better just because he fiddled with it. But if he had a specific and reasonable objective in the redesign that's a different situation. If you have a specific and sensible objective for reorganizing a piece of code, then it's reasonable to consider doing it.

Comment Re:Bad idea (Score 1) 671

Snowden does not work for the Russian government, nor is he ever likely to. What he's been doing for a job over there, I'm not sure, but I'm quite sure they're not going to employ him in a job doing the same thing he was doing in the USA. At best, he can just work in private-sector jobs there which have nothing to do with the government.

Yes, if he exposed government corruption in Russia, he wouldn't be treated well. But why would he ever be in a position to see such corruption and expose it?

Comment Re:confused (Score 1) 106

With telephone service, it's fairly simple. In the US, it wasn't a case of the government looking at AT&T and thinking to themselves: "That looks nice, I want it.". AT&T was granted a legal monopoly on telephone service in exchange for being regulated as a public utility, providing universal lifeline service, and all that. Many other nations followed the US's lead and set up similar telephone monopolies.

In the '80s... during the Reagan administration no less... the US government finally realized how stupid a move that was and broke AT&T up into the "Baby Bells". Unfortunately, the government seems to have regressed to 1900's thinking and has been letting AT&T reassemble itself and to allow the other bandwidth companies to follow suit; leading to the sack of crap that our telecom infrastructure is and the reason that net neutrality is even an issue.

That aside, you're right. It is absolutely ludicrous to suggest regulating Google or Facebook as though they were utilities. Will they be granted similar legally-mandated search engine and social network monopolies in exchange for having their destinies essentially stolen from them? Either way, it's be the death of both companies. AT&T may have had Bell labs turning out some neat technologies. But the pace of innovation and upgrades of their network was appallingly lethargic. Any tech company forced to labor under the same conditions would just die the second the monopoly was broken, and no longer legally-mandated, under a more enlightened administration. (To be fair, that may be these particular regulators' goal.)

Comment Re:Bad idea (Score 2) 671

Well, this is the thing about civil disobedience. The classic formula is to keep up awareness of your issue by forcing the government to go through the embarrassing and drawn-out process of prosecuting and punishing you. I'll bet they had to drag Thoreau kicking and screaming out of that Concord jail cell when some joker finally came along and paid his poll tax for him. Holding court for his admirers in the town pokey no doubt suited his purposes nicely.

In that spirit, this announcement is very effective. When was the last headline you read about Edward Snowden? If he comes back for a long and drawn out trial that'll show he's pretty hard core about this civil disobedience thing -- if leaving a cushy, high paying job in Hawaii with his pole-dancing girlfriend to go to fricken' Russia wasn't enough.

It occurs to me, though, that this situation is a lot like what I always say about data management systems: the good ones are easier to replace than the bad ones. Likewise the better governments, the ones with at least some commitment to things like due process, are much easier to face down with civil disobedience than ones where being a political threat gets you a bullet in the head, like Ninoy Aquino or Boris Nemtzov. If Snowden *does* come back, and if he ends up "detained" in limbo somewhere, then it'll be time for everyone to go into the streets and bring the government down.

Comment Re:Brain drain (Score 1) 167

Everyone likes getting paid. And all things being equal, everyone likes getting paid *more*.

But one thing I've noticed is that the people who are most dissatisfied with their current pay also happen to be the most dissatisfied with their working conditions overall, particularly how they feel treated. The feeling seems to be that if they ought to get more pay to put up with this shit.

Now I wouldn't suggest to any employer, particularly in tech, to economize by offering low salaries. You want to attract and retain the best people you can. But this suggests to me that many employers would do themselves a favor by paying a little more attention to worker happiness. If you're paying people approaching (or even more than) $100,000, there's bound to be a lot more cost effective ways to goose worker morale than handing out raises they'll perceive as significant.

But oddly many employers seem to think paying someone's salary is a license for handing out indignities. This doesn't even qualify as penny wise pound foolish.

Comment Re:Good operating systems Dont. (Score 1) 564

Sorry - it doesn't direct delete, if I implied that, my bad. Cmd-Delete sends it to Trash, so you can do a delete every other file entry, or some other non easy pattern, and then clear trash without ever leaving the keyboard.

FYI - some other keyboard short cuts:

  • (Shft)Cmd-Tab (previous)next process
  • (Shft)Cmd-` (back tic above Tab, with the tilda) (previous)next window within the current process

Those 4 combos keep me out of mission control entirely, which I can only recall having opened once or twice, and found it to be largely useless. Note that they are both process based, and it is possible to have multiple process open the same application. I have multiple instances of an IDE open right now, as an example, each in their own process. One or two may have multiple windows within the process. I sometimes have the same issue with mvim (macvim), depending upon how it is launched or the file opened.

Comment Re:Good operating systems Dont. (Score 1) 564

Shift-Cmd-Delete has to be done while a Finder window has focus. Note that you have to have something in Trash, otherwise you get the "error" tone, which really indicates it's empty. It's worked for me ever since I found out about in, circa Tiger? Panther? I don't know, quite a long time ago. I know for a fact it works in Snow Leopard, Mountain Lion, Mavericks, and Yosemite, as I have all of those systems running currently or in the past 6 months Although, now that I think about it, the first thing I do with any mac is install QuickSilver on it. I don't think it affects this though, as I don't recall that ever being a problem on anyone else's mac either. Other than that, I run Caffeine and Fantastical and that's pretty much it for enhancements.

I've tried some other enhancements/replacements such as PathFinder, BusyCal (they have something new out recently) PostBox, and a couple of others, but don't really care for those, at least when I tried them. To be fair, PostBox was only used for a short while, and I am still in the process of getting back to evaluating that one. The drive to replace Mail was removed when I finally debugged my configuration issue with Mail (removing a second Gmail account) although I still have some oddities with it.

Nice on the tests, thanks for posting those. If you try that on a network connected disk in Finder, you'll probably find that the behavior is.... not what you'd like. I do not believe that Finder uses the remote system as a proxy, because if it did, it should be able to delete much faster than it does. Oh well, at least local files work fine.

Comment Re:What is Parody? (Score 1) 255

What is gasoline if not a liquid? And what is liquid but a fluid? Therefore I should be able to run my car on hot air. So not all fair use is parody, nor is everything an author has to put up with fair use.

Fan fiction falls into that last category. Some authors encourage it, which is gracious; others are paranoid about it, which is understandable. But ultimately no matter how they feel about fan fiction they're going to have to put up with it. A successful work of fiction fires peoples' imaginations, and in the Internet era that means they're going to share their imaginings with like-minded people. Trying to police fan-fiction in a world where anyone can set up a blog or social media account to share it is like spitting into a hurricane force wind.

But even though a successful author pretty much has to put up with fan fiction whether he likes it or not, it's ridiculous to think that any author is somehow obligated to promote it. That just a fan-fiction author's fantasy. Authors have lives too, and there is not enough hours in the day for an author to police the stuff, much less to negotiate business deals for the people who write it. It's considered bad manners to even ask an author for the name of his literary agent, because an agent is supposed to work for an author, which he won't be able to do if he's swamped with requests from wannabes.

Comment Re:Good operating systems Dont. (Score 1) 564

We were of the same mind right up until your last sentence. Finder is good for browsing, shit-slow for copying or deleting more than a handful of files, and doesn't actually delete, which adds an extra step (emptying the trash). Because of this, I find that Finder is better utilized for browsing, especially media collections, while the command line is often faster for manipulation. Try deleting a folder with several subfolders, several levels deep, and over 10k files; make a copy first, so you can do it in Finder, then again on the command line. Time them. In fact, make two copies, one from Finder and one from the CLI, and time those, too.

We're still of the same mind-set, I don't solely use it for file manipulation, but when I use it, that's about the only functional thing I do with it. :) BTW, you are aware that Cmd-Delete deletes the file, and Shift-Cmd-Delete empties the trash, right? That helps with the keyboard deletion of files when you're selecting and deleting. As for deleting thousands, every time I wind up with a project directory with 100K files in it that I delete via Finder, I sigh, sit back for a brief second, and browse slashdot while that's going on. Finder has a lot of challenges, one of which is not using the proper UNIX APIs to handle file manipulations. The trashcan is rarely used, I'd rather it dropped it into TimeMachine (TM) if it wasn't already backed up and the directory is a backed up item.

It's even worse on network volumes, since those are much higher latency, and often much slower, to begin with.

For network work, I almost always ssh in. It removes 99.999% of the back and forth crap.

I'll have to admit that I've never once locked Finder (or rm) in deleting files that were accessible. I do have the oddly marked iso in trash that was marked as in use, which a reboot cleared (power outage, same issue, need a new UPS, apparently the battery's dead). That includes directory structures with several GB of data in 100s of thousands of files in probably 50 top level directories (a largish software project). I've done that more than once, because cleaning up multiple related projects when done is easier from Finder, even if it takes a minute or so to complete. (I'm running a 4 disk RAID0 scratch space along with 2 SSDs for the OS and user area, not exactly standard I know, on a hexcore box with 24GB RAM.... which is about to undergo a rather radical reconfiguration since I got some new SSDs in.....) My MBP also has no issues with these activities, and there Finder's horrid delete slowness is almost imperceptible, those PCIExpress SSDs are freaky awesome fast. You barely have time to sip your drink before it's ready, and then only if you're deleting more than 100K entries.

BTW, using scp, there's still a pretty significant pause at the end of the transfer of a largish file set as the system computes the hashes to check that the file(s) were actually transmitted properly. I haven't actually done a side by side test to see if scp is faster than Finder in network transfers. I suspect it is, especially with directory tree structures, but I I can't recall the last time I tried that. I generally just transfer tarballs or media files.

Comment Re:Good operating systems Dont. (Score 1) 564

I wouldn't know, the first thing I do on a Mac is configure it to my tastes and use cases, and after that, it stays out of my way. One of those is that file extensions are always shown. The thing to know is that executables are set by permissions, not extensions, so extensions only give you a hint. The executable permission needs to either be set, or be set within a container that you copy it out of. So in general, you can't execute anything you download as a standalone app.

Comment Re:Good operating systems Dont. (Score 2) 564

That's pretty hugely untrue. You can run any file under OSX by enabling the execute perm, or make then not executable by removing it. Well, that's from the command line anyways, from finder... you use that for anything other than scanning data files in a folder? I will admit that Finder has default apps assigned to various extensions, but that information can be overridden IIRC, on a per file basis. I guess I wouldn't be a typical user, since I almost never use the Dock, LaunchPad, Mission Control, or even spotlight and Finder is only for some minor file manipulation, such as copying things from A to B or deleting things.

Comment Re:Not the right problem (Score 1) 564

I would add #4 -- detect when someone is trying to trick the end user. Multiple file extensions. The combination of a visible file extension that's harmless with one that's executable. Trap these conditions and treat the file with an extra level of harshness.

If one of us would see it as an obvious attempt to abuse the Windows file handler, then make it something that the common rube would not be able to execute even if they wanted to.

Comment Re:That's the problem (Score 2, Insightful) 564

No. A user should be able to trust the name of the file.

If the file isn't really what it says it is, then that should be a BIG RED FLAG for the user shell. At that point the OS should know to treat the file as a threat.

A deceptively named file should immediately go into quarantine.

Instead, the user (assumed to be an idiot) is just left to fend for themselves.

Slashdot Top Deals

The one day you'd sell your soul for something, souls are a glut.

Working...