Slashdot Mirror


User: goose-incarnated

goose-incarnated's activity in the archive.

Stories
0
Comments
3,308
First seen
Last seen
Profile
(view on slashdot.org)

Comments · 3,308

  1. Re:Breaking out of the middle of a loop on Bad Programming Habits We Secretly Love (infoworld.com) · · Score: 1

    That is a perfect example of what I said earlier about such things pointing to a deeper problem. In this case, its taht xstr_cat() is allocating memory then returning a pointer to it, so expecting/requiring the caller to know to clean up after, but only if the function worked.

    It's actually a perfectly well-known idiom; look at the freebsd functions that do this. That you think it is a problem when the interface contract specifically mentions that it is the callers responsibility to free is indicative of a lack of experience with many unix systems on your part. It also means that you have never seen strdup() before.

    A much better approach is for xstr_cat to require the user to pass in memory for the function to fill.

    Regardless, we're talking about the idiom here - if it was not malloc(), it would be fopen() or similar. Either way, you have failed to provide a clean way to exit early while running all the cleanup handlers.

    Apart from the classical arguments about not breaking encapsulation and avoiding situations with implied responsibility, it would also make the cleanup in the calling code less conditional, so would simplify that code too.

    There is no implied responsibility - it's a function with a clearly defined and documented contract - the caller frees. You, personally, are unable to rewrite that particular function without goto's unless you greatly complicate the execution logic and repeat the cleanup statements. That's my point actually - most things are cleaner without goto, but handling exceptional conditions requires a jump out of the logic into specific error handling code. If you don't do the jump then you are going to sprinkle your cleanup code all over a function instead of having it all in one place.

  2. Re:The freedom of not having a car on Nearly One-third of Consumers Would Give Up Their Car Before Their Smartphone (computerworld.com) · · Score: 1

    ???

    Not really sure how you misunderstood that.

    Public transport goes to almost all of the places I want to go to. It's very rare that I want to go somewhere and find that public transport is not a good option.

    In general people only explore the options they have - if your destinations are all limited to a public transport route, then those are the places you'll go the most. However, that said, I do believe that your place (London) is comprehensively covered by public transport routes. Most high-density places are.

    And that's why I don't own a care. Those incidents are sufficiently rare that it's better to rent a car for those rare cases than it is to own a car.

    The point is with a good public transport network there's less incentive to own a car.

    IME public transport is only good enough in high-density areas. I like living in a 700sqm house on a 2000sqm plot with neighbours far off. I did the townhouse and/or apartment thing when I was young and I don't miss it. I cannot get this sort of lifestyle in an area near the trains, and using a bus to the train, then the train, then another bus to work takes around 45-mins to an hour. By car, to work takes about 20 minutes. The high-density areas have barely 100sqm apartments, maybe 200sqm houses on 500sqm plots. I like living in luxury.

    My car, a modest ford, was purchased for (at the time) $10k second-hand with 50000km on the odo, it now has +300000km and has had only two non-service repairs. As I completed apprenticeship and training in my twenties as a mechanic, all the servicing and repairs over the years (plus fuel) cost me a great deal less than using public transport would have cost. Of course, cost of car+running costs probably puts the total cost over the cost of using public transport, but only by very little. I consider that cost to be well worth it by saving me more than an hour each day.

    Public transport works very well when you live in or near a CBD. It's prohibitively costly however when you don't and/or your spouse also uses it - my wife and I travel together to work. With no car our public transport costs would be double (one for each person).

  3. I can work quite happily using public transport and good ol' fashioned leg-power. I can probably telework and wouldn't need a car in the first place.

    Not having a phone would be quite catastrophic. The unconnected world of yesteryear is deprecated, all of the old methods no longer function, and you can't really achieve much without a cellphone. For the most part it would be exceedingly difficult to even get a job without a cellphone. An employer looking at a candidate with no phone is inconvenient to them so they'll just skip that one.

    Although I would say without a car you won't get laid, but sex isn't everything y'know...

    Who said you couldn't have a phone? My old featurephone is no smartphone but at least you can still send and receive email on it (nokia something or the other).

  4. Re:The freedom of not having a car on Nearly One-third of Consumers Would Give Up Their Car Before Their Smartphone (computerworld.com) · · Score: 0

    Public transport goes almost everywhere I need, and the supermarkets will deliver large heavy loads to my door within a 2 hour slot very reliably (even evenings and weekends). Every so often I need t rent a van to move something around---something I would have to do anyway even if I had a car.

    I have occasionally rented cars to go places not well served by public transport, for example on holiday. But day to day, I just don't need one.

    So... if you mostly only go everywhere the train goes, you'll usually only go everywhere the train goes? I'm not sure why you consider that a point worth making - it's a tautology after all.

  5. Re:The freedom of not having a car on Nearly One-third of Consumers Would Give Up Their Car Before Their Smartphone (computerworld.com) · · Score: 1, Insightful

    But you can read, write, watch TV, do crosswords, code, do research, etc on the bus or train. You can't do any of that while driving. I spend 2 hours per day commuting in London, and the biggest pain is the cost (though parking near work is £30 per day, plus £10 congestion charge, so could be worse) and having to change transport as that breaks concentration.

    So, you're saying spending two hours a day doing some solo activity is better than spending 1 hour per day driving and 1 hour with my family? No wonder the world is so fucked. You're actually numb to the idea that maximising ones time with ones family is a good thing, and you'd rather maximise your "productive" time which really isn't.

    I don't want quicker commutes so that I can spend more time at work - I want quicker commutes so that I can spend more time at home, with my family.

  6. Re:The freedom of not having a car on Nearly One-third of Consumers Would Give Up Their Car Before Their Smartphone (computerworld.com) · · Score: 1

    Driving is not only wasting time, but squandering money. If you live in a area well served with affordable public transportation, you save thousands by the year. And actually is one less shackle enslaving you. If you can afford to at least go without a car until you have children, you will save thousands. Depending on the country, the kind of car you drive, the downpayment, the maintenance and the depreciation, the taxes, a car might translate very well into an expense of 300-1,000 Euros per month.

    Let me try:

    Having a smartphone is not only a waste of time, but squandering money. If you live in an area well-served by... well, anything actually, you save thousands by the year. And the smartphone is actually one less shackle enslaving you. If you can afford to go without a smartphone until you have children you will save thousands. Depending on the country, the kind of smartphone, the purchase price, the monthly data bill, the OOB charges, the apps you purchase, a phone can very easily translate into an expense of 30 - 100 Euros per month.

    Face it - the smartphone with all its apps is as much a luxury and unnecessary item as a car - it may cost less, but it's still just a luxury item. You don't *really* need a computer in your pocket, but its nice to have. Likewise, many people don't really need a car, but its nice to have.

    Your particular waste of money is not "better" than some other persons choice of wasting money.

  7. Re:Breaking out of the middle of a loop on Bad Programming Habits We Secretly Love (infoworld.com) · · Score: 1

    You may consider them clean but I don't. Their use is analogous to the "friend" keyword in C++, in that the fact you are doing it at all shows there's a deeper problem with your logic/system design. I've been a professional software developer for 35 years and

    Whatever. I'm in 2 decades experience range myself.

    In all that time I've never seen an example of code that breaks out of a loop early that was justifiable for either efficiency or readability, and where I couldn't easily write a much cleaner version that didn't.

    Here, make this more readable two failure points in loop.

    Sorry, in that link, the code I mean is in the function from line 86 onwards.

  8. Re:Breaking out of the middle of a loop on Bad Programming Habits We Secretly Love (infoworld.com) · · Score: 1

    You may consider them clean but I don't. Their use is analogous to the "friend" keyword in C++, in that the fact you are doing it at all shows there's a deeper problem with your logic/system design. I've been a professional software developer for 35 years and

    Whatever. I'm in 2 decades experience range myself.

    In all that time I've never seen an example of code that breaks out of a loop early that was justifiable for either efficiency or readability, and where I couldn't easily write a much cleaner version that didn't.

    Here, make this more readable two failure points in loop. Now trying making it more readable with 15 failure points within the loop.

    If you think that goto, continue, break and return cannot solve problems with readability then you haven't seen enough problems.

  9. Re:GOTOs in C on Bad Programming Habits We Secretly Love (infoworld.com) · · Score: 1

    This only works well for trivial examples - show us what the function looks like when it has 20 or checks to do, all of which need every function already executed to be cleaned up if the current one fails?

  10. Re:My 93 Escort squeaks and rattles a lot on Consumer Reports Withdraws Its Tesla Model S Recommendation (consumerreports.org) · · Score: 1

    Hearing those noises is reassuring - it tells me the part making the noise hasn't fallen off yet.

    Ah, but the part stopping the noise might have fallen off :-) FTFA:

    "The car is so very silent when driving that minor squeaks and rattles that you wouldn't be able to hear in a gasoline engine car become very annoying."

    This bit is pure BS - once my car gets to 60km/h and above the engine is undetectable above the sound of road, wind and tyre noise. Most ICE cars don't have engine noise in the cabin at a level sufficient to drown out squeaks and rattles.

  11. InB4 on Guy Creates Handheld Railgun With a 3D-Printer (engadget.com) · · Score: 1

    The anti-liberty Libertarians :-)

  12. Re:Is he helping? on Interviews: John McAfee Answers Your Questions About His Presidential Bid · · Score: 1

    I have traveled extensively, and no traveler is hated more than the American traveler. We are arrogant and expect the entire world to speak our language

    McAffee is a creepy old sex tourist, using his money to sleep with women 40 years younger than him.

    "Someone, somewhere, is having fun" - you just broke my PuritanAlert detector.

  13. Re:Depends on Maybe You Don't Need 8 Hours of Sleep After All (theatlantic.com) · · Score: 1

    This is not science, this is anecdotal.

    You're quite correct that it is not science: they found that those tribes get $FOO amount of hours sleep per night, they're ignoring that those tribes nap for a large part of each day due to the intense heat. Sleep 7.1 hours/night, sleep 4 hours per day.

    Idiot scientists doing the equivalent of "How 'bout them magnets, eh?"...

  14. Turn about is fair play. If you used your power and influence to spy on citizens do not be surprised when you are spied on.

  15. Re:Gun Control... on US Toddlers Involved In Shootings On a Weekly Basis (washingtonpost.com) · · Score: 1

    Gun bans work just fine in many countries,

    And they fail miserably in others. There is no correlation (neither positive nor negative) that I am aware of that shows gun ownership being linked to population safety. If the population owning guns has no measurable effect on how safe the population is, why the hell would you want to ban it? As I pointed out in a previous post, a residential swimming pool will on average kill around 4 to 5 *times* the number of people that a single gun will. Seriously, the effect of taking away guns from the population will be negligible.

  16. Re:Guns are the problem. on US Toddlers Involved In Shootings On a Weekly Basis (washingtonpost.com) · · Score: 1

    Less guns means less gun violence.

    There are places in the world where there is very little gun violence.

    Those places all have one thing in common: Less guns.

    How does your premise explain those parts of the world with very few guns but much more deaths?

  17. Re:Slashdot? on US Toddlers Involved In Shootings On a Weekly Basis (washingtonpost.com) · · Score: 1

    Nevertheless, it's relevant to solving a small part of our massive gun problem.

    If by "massive gun problem" you mean "a problem that kills fewer people than residential swimming pools", then yeah.

  18. Re:Thats gun holders on Court: Lawsuit Over NYPD Surveillance of Muslims Can Proceed (washingtonpost.com) · · Score: 0, Troll

    Actually, in the USA the biggest source of terrorism is from gun holders. You're far more likely to be killed from a nutter with a gun on a rampage than any foreign terrorist threat.

    And you're far far more likely to accidentally drown your swimming pool than be killed by a gun; do you advocate that swimming pools are the biggest source of terrorism?

  19. Re:Hipsters fight over limited supplies of juice on Charge Rage: Electric Cars Are Making People Meaner In California · · Score: 1

    That would be a weird and backwards thing to do. One of the main advantages of EVs is that you don't need to take 10 minutes out of your day to park and wait for hydrocarbons to flow into a tank.

    If you spend ten minutes of *every* *day* filling fuel then EV's aren't going to work for your range anyway.

    FWIW, I spend around 0 minutes per week filling fuel. I pull into the forecourt, tell the attendant "fill 'er up" and buy bread/smokes/whatever at the shop. The car is filled before I exit the shop. Even I am not filling fuel, there's always something to get at the shop so I generally stop there twice a week or so.

  20. Re:CVS or Subversion on Ask Slashdot: Selecting a Version Control System For an Inexperienced Team · · Score: 1

    Bullshit. I have used SVN. People who think it works don't know what they are talking about. Watch the frigging Google Tech Talk and get back to me in a couple of hours after it has all sunk in.

    You're off to a poor start if the only way to present your argument is via TV. I view very little TV and have even less time to view 60 seconds of material stretched over 10 minutes.

  21. Re:How I would handle getting laid as a professor on How Academia Still Struggles With Sexual Harassment (buzzfeed.com) · · Score: 1

    - Never date an undergraduate student, even if theyâ(TM)re nontraditional.

    I disagree, a very good friend of mine, a 35 year old divorcee who was a mature undergrad student dated and eventually married a young professor from another department who was 3 years younger than her. Are you suggesting she's incapable of approaching this relationship of her own free will? Does she suddenly become mentally incompetent by virtue of her gender?

    I agree with you, but in a slightly different way - just because a relationship lasts into a long marriage doesn't mean that there's anything wrong with short relationships. A week after my first divorce filing [1], I was 35 years old and banging a 19 year old biochemistry student at a university I sometimes visited friends at (I lectured at a different university but networked properly). We only spent a few weeks dating before happily parting ways, but that doesn't mean there was anything dysfunctional in the relationship.

    Of course it helps when they aren't *your* student and especially when they aren't in your university, but my point still stands - nothing wrong with a short relationship.

    [1] I view marriage like I view git commits - do it early, do it often :-)

  22. Re:We should not protect them on How Academia Still Struggles With Sexual Harassment (buzzfeed.com) · · Score: 1

    If the university sides with the instructor and the instructor is found guilty, it will be said that the university encourages sexual harassment. If the university sides with the instructor and the instructor is found innocent, it will be said that the university covered it up.

    This is the only sane response: the university should hand off (with whatever evidence may exist) to LEO and abide by a courts ruling in terms of who is telling the truth and who is not. The university is usually neither equipped nor experienced in running a trial.

  23. Re:Academia is willing to protect total dicks on How Academia Still Struggles With Sexual Harassment (buzzfeed.com) · · Score: 1

    Yep, holding a door open for someone, a.k.a. "common courtesy", was labelled as a form of rape when it was a man holding the door for a woman.

    Smells like bullshit to me.

    One would hope so, but FTFA Feynman was misogynistic because:

    "Feynman documented various strategies he adopted for trying to get women in bars to sleep with him"

    "Feynman used to pretend to be a student so he could ask undergraduate women out"

    "[Feynman had] documented affairs with two married women, "

    "the propensity to lie on the beach and watch girls"

    The sexism-is-everywhere brigade is insane if they think that lying to pick up women, or looking at them on the beach, or hitting on them in bars, or adultery... is sexist.

  24. Re:Um... then don't go to sites on Mozilla Sets Out Its Proposed Principles For Content Blocking (mozilla.org) · · Score: 1

    I see your point, but don't see why we can't have both. Usenet is still going, anyone can set up a free site and ad driven popular sites have pushed costs down for everyone.

    Actually we *can* have both, but not if the advertisers get their way. Usenet fell by the wayside due to the wall of spam that came about, so chalk that up to advertisers killing a perfectly usable medium. The web is going to go the same way if site owners insist on intersitials(sp?) and other such tomfoolery. If the advertisers don't want lose eyeballs they'd better start behaving better - the market has spoken and it has almost universally spoken *against* advertisers.

  25. Re:Um... then don't go to sites on Mozilla Sets Out Its Proposed Principles For Content Blocking (mozilla.org) · · Score: 1

    Consider what you are arguing for. Get rid of free news sites with paid journalists, except for those funded some other way like the BBC or other state agencies. Many people will have to go back to getting news from ad supported TV channels or ad supported newspapers, so won't escape the ads anyway.

    One of the reasons why newspapers are declining is the democratization of news. I think that's a good thing, it makes it harder to end up getting most of your news from a single (biased) source.

    I hear what you're saying and I have considered it: the internet was just as useful to me back when ads were not everywhere as it is now. I *prefer* having sites where people who share a common interest gather and share the cost.

    The difference between what I'm saying and what you're hearing is this: I see the internet as a fount of useful information and a place to gather with other like-minded people. You see the internet as a place to read the latest news.

    With no ads and only user-supported sites/forums I can still learn all that I want to learn. I get my news on the radio anyway. The majority of stuff I do on the internet is linked to non-news, non-facebook, non-twitter, non-social-media, non-cat-videos, non-youtube stuff and non-buzzfeed crap.

    The stuff I *do* use the internet for are related to forums around auto repair, guitar playing, metalwork, carpentry, building/construction, fiction-reading/writing, watercolor painting, electronic circuits, software-writing (OSS contributions), pencil/charcoal sketching, cooking, exercise, mechanical design (building a mill in my garage)... and a lot more that I probably will only remember at some later time when I don't need to.

    (I have a lot of hobbies - very busy usually)

    So you see, *my* internet will remain - those forums are mostly ad-free (and the people running them usually reveal how much they make off ads). If ads go away, it only takes a few tens of members chipping in a few cents a year to keep it going. Most forums have hundreds or thousands of members.

    Like I said before, the internet was all fine and pretty useful before ads - it will be all fine and still pretty damn useful if ads were to go away :-)