Slashdot Mirror


User: readin

readin's activity in the archive.

Stories
0
Comments
1,546
First seen
Last seen
Profile
(view on slashdot.org)

Comments · 1,546

  1. Re:Easier to Analyze or Change == More Maintainabl on Study: Refactoring Doesn't Improve Code Quality · · Score: 1

    Ever since then I have always maintained that coders should never ever copy and paste code.

    If you're just copying and pasting and leaving it unchanged then you're probably right. But I've certainly had cases where I needed to copy and paste a few lines of code maybe even 100 times and then tweak each instance to put in the data values or validations I want. Making a loop or making it somehow generic would have made the code unreadable and I would have had to put in a lot of extra code to handle a few special cases. That said, I'm only talking about a few lines of code beint repeated. If 15 or more lines are being copied then that does suggest a need for reusing the code.

  2. Re:Easier to Analyze or Change == More Maintainabl on Study: Refactoring Doesn't Improve Code Quality · · Score: 1

    I would describe refactoring as increasing the level of abstraction involved in the code.

    I would say that refactoring can also be decreasing the level of abstraction. The goal isn't to create the highest level of abstraction, the goal is to create the right level of abstraction.

  3. Re:Easier to Analyze or Change == More Maintainabl on Study: Refactoring Doesn't Improve Code Quality · · Score: 2

    This is the "golden time" to refactor code, because it's just now become apparent where the structural flaws are in the architecture, but it's still early enough to refactor without causing a significant amount of pain.

    It can also be the golden time because the original writers are still around and know why certain things were done a certain way, and know what dependencies need to be addressed.

    Interestingly, in my experience, poorly structured code seems to come about often less often because of "rushed code" but instead a lack of foresight in the original structure of a system to deal with continuously evolving features...

    In my opinion poorly structured code too often comes from individual developers who just don't care. They show up to do a job and get paid; they got into CS because it was a way to make money; they don't really care about doing things elegantly. Or perhaps they care about quality but just don't understand the benefits of refactoring.

  4. Re:Refactoring done right happens as you go on Study: Refactoring Doesn't Improve Code Quality · · Score: 1

    When you code, the most important thing to do is get your memory architecture built right, then methods just write themselves. Come back later and want to make a better method, you can use your old code as a partial refactor. It is an agile sort of run and gun approach and it works. Refactoring for the sake of refactoring is often wasted time for the original author for there is ways of understanding code past just nice variable names and indentation. Sometimes even badly formatted code stands out and reminds you what it did to remind you of how it works. But when you code in a group, this doesn't hold true and a refactor can help.

    But I never write badly formatted code.

    Of course part of the reason is that I refactor as I write. Like battle plans never surviving contact with the enemy, software designs rarely survive contact with the code. As I'm writing the code I find holes in requirements that force a new plan. I refine method signatures to reduce dependencies. In short, I'm learn more about what I'm writing as I write it. It only makes sense refactor as I go. And sometimes I have to finish writing something before I can do certain refactorings.

  5. Re:Well DUH... on Study: Refactoring Doesn't Improve Code Quality · · Score: 3, Insightful

    The compiler is what makes the final decision on the code, not the programmer.

    Just refactoring a poor algorithm will still result in a poor performance, though the code might look better.

    The whole point of refactoring in most cases is to make the code look better, not to improve performance. Very rarely do people change an algorithm as part of refactoring. The goal is instead to make the code easy to understand, easy to change, and easy to debug. Creating consistent names and API patterns, re-ordering statements to group them based on the task they're performing, finding code that is the same in many different methods and moving it into its own method, reducing dependencies between classes.... these are common refactoring techniques and have almost nothing to do with performance.

  6. You can lead a horse to water. on Why We Should Stop Hiding File-Name Extensions · · Score: 1

    this article argues that it might be time to admit that users need to understand, embrace and responsibly use the only plain-text, obvious indicator of what a file actually is.

    "You can lead a horse to water but you can't make it drink."

    The Microsoft horse already knows where the watering hole is; the problem is getting the horse to drink. They don't want to drink. To them making something appear user friendly is far more important than actually making it user friendly.

    I remember decades ago when email was safe so long as you didn't open the attachments. Email was just plain text that got displayed, not interpreted, so it was pretty hard for email to do harm. Then one day my dad sent me an a lot of his friends an email warning about a new virus that you could get just by opening an email (you didn't have to open the attachment). I emailed him and his friends back telling them that that wasn't how email worked. Just don't open the attachments and you'll be fine, etc. Then I saw on the news that there was in fact such a virus because Microsoft had decided that it would be a great idea to interpret and execute code in email automatically. It still amazes me today that they did such a thing.

    Anyway, yes it is SOP for me to enable showing extensions on any computer I use or have the opportunity to modify. Hiding extensions is like refusing to look at or smell any food you're given before eating it.

  7. Re:Good grief... on Bill Nye Disses "Regular" Software Writers' Science Knowledge · · Score: 2

    He did answer the question with what I think is a reasonable answer. The only problem I have with his answer is that a guy whose claim to fame isn't science but being a TV star is presuming himself capable of giving grades to the rest of us.

    A good CS program usually requires a good STEM course load. You have to take classes like Physics, Chemistry, Numerical Analysis, etc.. So a CS educated developer should have some understanding of science, but of course in day to day life he probably won't be doing any real science. But then neither does the star of a child's TV program.

    The fact that he's willing to grade the whole country based on what they believe about a topic that most of the country can't possibly have researched in detail and that they read conflicting accounts about on the news and other media about indicates that Mr. Nye isn't really all that good at logic and philosophy himself.

    Whether or not I, as a non-climatologist who hasn't devoted weeks of study to the question, believe all the hype about global-warming has little to do with what I know about science and a lot to do with who I trust to tell me the truth. Do I trust they guys at MIT and Harvard because I think they're all good guys who have no ambition beyond seeking and publishing the truth, or do suspect that they are like other humans and have weaknesses that may cause them to do things like preferring to interpret data in a way that will get them more funding and saying they agree with things in order to fit in with the crowd? Do I trust Al Gore? Do I trust Republicans? Do I trust Democrats? Do I trust the UN?

    Personally I don't trust any of them. That and the fact that I haven't done the research myself and don't have enough time to evaluate the competing claims are why I don't take a strong position on global warning. In Bill Nye's eyes apparently that means I don't know anything about science.

  8. Re:It is not about technology on Ask Slashdot: How Can Technology Improve the Judicial System? · · Score: 1

    Having them randomly selected, like the jury pool, might not be a bad idea. Or at least have the people who appoint the judges be randomly selected.

  9. Re:Actually on Stephen Hawking: Biggest Human Failing Is Aggression · · Score: 1

    But what if we could get rid of the desire for polygamy and adultery? Keep the desire for sex, of course; it's necessary. But if everyone were monogamous that would reduce the desire for conquest and excessive amounts of wealth. There would still be desire to succeed and make money, but at some point you would have enough.

  10. Re:You hit the nail on the head... on Cubans Allowed To Export Software and Software Services To the US · · Score: 1

    Sure, but India had two things going for it that Cuba doesn't: they speak English...

    Cuba is 90 miles from Miami. Many Cubans have relatives in the US. You don't think they have English speakers?

    The relatives in America speak English, but how would that cause the Cubans to learn it when their relatives in America can still speak Spanish?

  11. Re:There is no engineering. on Ask Slashdot: Are General Engineering Skills Undervalued In Web Development? · · Score: 1

    I usually say "software developer" because my duties aren't limited to just engineering. Yes, I have to apply technology to solve the problem. But I also have to build the product. I'm not just a designer. I'm not just a requirements gatherer. I'm not just a construction guy. I'm all those things. An engineer creates the plans but lets someone else put those plans into practice. I create the plans and I put them into practice. I do all the things it takes to develop the product. I'm a developer.

  12. Re:There is no engineering. on Ask Slashdot: Are General Engineering Skills Undervalued In Web Development? · · Score: 1

    The difference is that electrical, mechanical, civil engineers, et al, all have governing bodies and licensing requirements. What drives us engineers insane is that some people are allowed to call themselves engineers, when they are not. They don't have the training, oversight, etc. It's not just professional hubris or exclusionism, it's about diluting the respect and reliability of our profession -- and in some cases, even public safety.

    Try being a nurse, nutritionist, radiological technician, etc, and calling yourself a doctor. It won't fly.

    Good point. Those types of engineering change so slowly that a governing body can say what is permitted and what is not. They can say what is required to be competent and what is not. They can lay down those rules and expect them to last for a while.

    Software engineering is much harder to keep up with. Other engineers get to keep using the same solutions. We have to keep inventing new ones. Perhaps when software engineering becomes as stale as other fields we'll have a governing board.

  13. Every student should learn to code on Should We Really Try To Teach Everyone To Code? · · Score: 1

    Every student should learn to code, just as every student learns biology, physics, and chemistry. It's not that every student will use that knowledge on the job, it's biology, physics, chemistry, and now computers surround us in everyday life. Learning to code provides the basics of what a computer does and how it operates. Throw in a chapters on binary numbers, concepts like input, output, different chips or processing units, what a network is, turing equivalency, etc, and you have an intro to computer science class that every student should take.

  14. Re:Never used recursion on AP Test's Recursion Examples: An Exercise In Awkwardness · · Score: 1

    That's the real world and real jobs in most cases. Unless you are doing something really high end most jobs are boring straightforward imperative programming. Something like "Scrape a web form on click, put objects into a container, contact the database via a library, do a transaction, get a response, manipulate the response, present the response to the user. Most programmers do not do parallel processing, high end graphics, tool smithing, or predictive analytics.

    Most programmers do not use functional languages either.

    I would love to escape that kind of career.

  15. Re:Never used recursion on AP Test's Recursion Examples: An Exercise In Awkwardness · · Score: 1

    I don't use it often, but when I do it usually doesn't feel like recursion because it recursive step works on a different object. I recall a need to model a network and a coworker trying to use some strange tool and getting very frustrated because it wouldn't do recursion. I whipped up a network model in Java in a few minutes. He asked me if I used recursion and I said "no". I apologized the next day because I realized had in fact used recursion, but hadn't realized it because even though the code I was calling was the same I was calling it on a different object (a different node in the network). In my mind each object had it's own instance of the code so instead of the flow looping back into the top of my method it was entering code on a different object.

    It was kind of neat when I realized that. It made recursion seem a lot simpler than it had before.

  16. Re:Too bad about WWII on Does Showing a Horrific Video Serve a Legitimate Journalistic Purpose? · · Score: 1

    It's too bad the Allies released those photos of the concentration camps. They were literally working for the Nazis and their SS arm.

    Excellent point. Especially compare the reaction most people have to "Nazi" vs their reaction to "Commie" or "Communist". I even see people on Slashdot joke about it. The Communists killed a lot of people too. Whether it was more or less than the Nazis is the subject of some debate, but they certainly killed millions and millions. But we have the pictures of the Nazi camps. How many pictures have you seen of corpses or sick prisoners in the Gulags? How many pictures have you seen of the corpses in the killing fields of Cambodia? The pictures of the Nazi atrocities make us want to say "never again". But communism? Too many people think we just haven't done it right yet and should keep trying.

  17. Re:"Support" != actually sacrifice for on Most Americans Support Government Action On Climate Change · · Score: 1

    What's the sacrifice though? Having cars that either get really excellent fuel economy or run on battery power? Forcing electrical utilities to switch to separate billing for grid-tie and power consumption, so that customers that want to put solar panels on their roofs aren't shafted in order to have overnight electrical service from base-load power? Mandating emissions inspections based on original standards at the time of manufacture on all vehicles newer than 30 years, so that gross-polluting vehicles that are not running right are either fixed or taken off the road? Most of these things don't have all that much cost, and for some of them, they're a cost that the individual should have borne anyway.

    How about rationing international air travel because of the huge carbon footprint it creates?

  18. Re:Yes, of *course* on Ask Slashdot: When and How Did Europe Leapfrog the US For Internet Access? · · Score: 1

    Corporations are owned by stockholders. Stockholders have a responsibility to take an interest in what they own make sure it is well-managed. If they don't and the corporation fails, they get punished in a free market. If the CEO makes off with a bundle, then the stockholders are to blame for giving him the contract. If the CEO makes off with a bundle with the result that creditors don't get paid then the creditors have some responsibility for failing to consider the health of the corporation and its governing structure before lowing it money. No one gets punished? Ask an Enron stockholder or creditor. Then ask the shareholder how much time he put into voting in the shareholder elections that happen periodically. No one put a gun to that shareholder's head and forced him to buy Enron. He could have bought shares in any corporation or put the money in a CD. The creditor likewise made a choice.

    But when it is the government, no one has a choice.

    By the way, if a corporation does bad things and then goes out of business you can still go after the owners who made their corporation do those bad things. Oh wait, no you can't, because a corporation is a GOVERNMENT created fictional person who is assigned blamed for the things the owners do.

  19. Re:Government Intervention on Ask Slashdot: When and How Did Europe Leapfrog the US For Internet Access? · · Score: 1

    Anti-monopoly regulation is one of the few types of market intervention I support. Another one is truth-in-labeling and other laws designed to make sure people have access to the information they need to make decisions.

  20. Safe at last! on Former NATO Nuclear Bunker Now an 'Airless' Unmanned Data Center · · Score: 1

    the refurbished bunker has walls 11 feet thick and the central complex is buried twenty feet under the earth.

    Finally my World of Warcraft characters will be safe!

  21. Re:Government Intervention on Ask Slashdot: When and How Did Europe Leapfrog the US For Internet Access? · · Score: 2

    Exactly. While Europe usually seem willing to commit fully to the second best choice - a government controlled industry, Americans seem to get stuck in the worst choice - an industry so heavily regulated that the virtues of the free market are extinguished but not heavily regulated enough for the government to take responsibility for the consequences of government actions.

    So now we have a bunch of government created monopolies and government regulations wreaking havoc across the landscape, and when the problems become apparent they are blamed, as you humorously allude, on the "free" market. The big businesses gain because lack of a free market protects them from upstarts, and the government people gain by having increased power and greater access to campaign funds and post-government lobbying jobs.

  22. Re:Tony Blair quoting Churchill quoting Verne on Winston Churchill's Scientists · · Score: 1

    Churchill is a huge hero for both Republicans and conservatives.

  23. Re:For the sake of discussion... on Eric Holder Severely Limits Civil Forfeiture · · Score: 1

    I do not think anybody particularly cares about cash found next to the evidence of an overtly prosecutable crime. The problem is when the cash itself seems to be the target, in the absence of any apparent crime. The examples the made the news were things like driving 64 mph in a 55 mph zone with $5000 cash on hand -- here is your speeding ticket and the police keep the $5000 cash.

    I care about the cash found next to the evidence. If the guy isn't found guilty the government shouldn't keep his cash no matter how bad the crime was. Keeping the money as evidence until the trial is ok (so long as it isn't being done just to keep the suspect from being able to afford to defend himself). But keeping it permanently when he doesn't get charged or after he is aquitted violates the 5th and 6th amendment just as keeping him permanently imprisoned in similar circumstances would.

  24. Re:WTF? Yes it is illegal! on Eric Holder Severely Limits Civil Forfeiture · · Score: 1

    Fifth amendment guarantees that no one will be deprived of life, liberty, or property without due process of law. Sixth amendment guarantees a jury trial. Now if life liberty and property can be deprived willy nilly so long as some minor paperwork is done and we call it "due process", then what is the point of the sixth amendment? It is clear that due process means a trial.
    I.e., property and liberty are both protected by the same amendment and given the same level of protection in that amendment. If your property can be taken simply because someone used it in a crime, then your body can be locked up as well. You may have been taken hostage by a bank robber, they can put you in prison for the rest of your life without trial for that.

  25. It's about time on Eric Holder Severely Limits Civil Forfeiture · · Score: 1

    Wow. When Holder finally decided to do something right he really did the right thing in a big way. This is amazing wonderful news. I hope his 'constitutional scholar' president follows through and explains to SCOTUS why such seizures needed to stop because they're unconstitutional.
    This doesn't entirely make up for Holder's racism or failure to enthusiastically investigate crimes by the IRS (in its harassing political opponents), but it is still a, to quote Biden, "big fuckin deal". Good job on this one Holder.