Slashdot Mirror


User: tomhudson

tomhudson's activity in the archive.

Stories
0
Comments
14,724
First seen
Last seen
Profile
(view on slashdot.org)

Comments · 14,724

  1. Re:Why not opt in instead of opt out? on Yahoo Treading Carefully Before Exposing More Private Data · · Score: 0, Flamebait

    It could be worse

    'Jennifer' Usher, and Usher's journal. My own personal cyber-stalker :-)

  2. Why not opt in instead of opt out? on Yahoo Treading Carefully Before Exposing More Private Data · · Score: 4, Insightful

    This is reminiscent of the "negative billing" scams, whee if you don't opt out, you're automatically going to be subscribed for $EXTRA_CRAP_SERVICE_I_DONT_WANT at $X_MORE_PER_MONTH.

    Seriously, Yahoo, sharing is not always a 'Good Thing' Some things are better kept private

  3. Re:Maybe they've grown up a bit on GCC Moving To Use C++ Instead of C · · Score: 1
    Because I can keep track of my memory allocations and frees. I learned long ago, the hard way, to make sure my mallocs match up with my frees, and to make sure I knew who "owns" what.

    And sometimes I just like the idea of being able to take a nice chunk of ram, and sometimes look at it as a series of raw bytes, and sometimes as an array, and sometimes as something else. Back when I was writing assembler, everything was just memory anyways :-)

    In comparison, std::aut_ptr sucks. For me. YMMV, and you're welcome to your opinion. I'm just saying the "textus receptus" that the STL is the greatest thing since sliced bread, has resulted in the dumbing down of a certain species of programmers, who can use the stl but are lost without it.

  4. Re:Maybe they've grown up a bit on GCC Moving To Use C++ Instead of C · · Score: 1

    smart pointers, weak pointers, etc., bring their own problems. Just keep track of it in the first place. Design for it. Account for it. Test for it. You're going to need to anyway, so why not keep the code simple ...

  5. Re:Maybe they've grown up a bit on GCC Moving To Use C++ Instead of C · · Score: 1

    There are plenty of times when the stl simply isn't needed. People will drag the whole thing in because they want to parse out an initialization file. How dumb can you get? If you can't write a simple ini file parser yourself, you should go back to school. This is one of those things that can be done in a few lines of c, never mind c++.

  6. Re:Maybe they've grown up a bit on GCC Moving To Use C++ Instead of C · · Score: 1

    2 years ago, when I argued that we should remove it because it was still a performance hit. Proved it, removed it, converted the code to standard c99, not c++.

    Much faster.

  7. Re:Maybe they've grown up a bit on GCC Moving To Use C++ Instead of C · · Score: 1

    And if, for some strange reason, you want to refer to inexistent indexes, std::map::operator[] will allow you to do that, and create a default value under that index when you first access it.

    ... and having that ability that adds checking overhead on EVERY access. Want to try again?

  8. Re:Seems odd... on GCC Moving To Use C++ Instead of C · · Score: 1

    I used to share this sentiment. And then I met their majority C equivalent, the same people who only know C but cannot program in C either.

    I certainly won't disagree with you there ... the only thing that helps is curiosity. Curious people, with any language, will take the time to see what works, to test it themselves, to break things and find out why it broke, and to challenge presumptions.

    Give two people a compiler and 10 years - the curious person will be the one you want if you need any sort of optimization, because they'll know not only what works but why - and also be ready to try something different because times change since they last hit the text books.

  9. Re:Maybe they've grown up a bit on GCC Moving To Use C++ Instead of C · · Score: 2, Insightful

    Why not test it yourself? I did, but I've come to realize that the only way for people to actually believe it is to get off their behinds and test it for themselves. Otherwise, it's too easy to dismiss.

    It's the same as everyone who claims java is "almost as fast as c" when in a lot of cases it is piss-poor. Test it.

  10. Re:Maybe they've grown up a bit on GCC Moving To Use C++ Instead of C · · Score: 1

    The stl has overhead, plain and simple. I've tested it and seen the difference. Have you? It's why the first thing I do with stl code is replace it.

  11. Re:Maybe they've grown up a bit on GCC Moving To Use C++ Instead of C · · Score: 3, Interesting

    variable-length arrays were a surprise to me too. I had been looking for the quickest way to do an in-memory search to find keys so I could look up the associated pointer, and as we all know, c doesn't have variable-length arrays ... but c99 does. Use -std=c99 on the compiler line.

    What this means is that you can treat your chunk of ram as contiguous, and realloc to grow it, and if you try to do an array access past the "old" bound, you no longer throw an exception. So your initial array allocation (in my case, 1024 elements) could grown (again, in my case, to a million) and still work.

    Doing a bsearch on that is dirt quick. Being able to refer to any element, even those beyond the original length, using standard array notation, is just SO nice.

    http://publib.boulder.ibm.com/infocenter/comphelp/v8v101/index.jsp?topic=/com.ibm.xlcpp8a.doc/language/ref/variable_length_arrays.htm

    A variable length array, which is a C99 feature, is an array of automatic storage duration whose length is determined at run time.

    If the size of the array is indicated by * instead of an expression, the variable length array is considered to be of unspecified size. Such arrays are considered complete types, but can only be used in declarations of function prototype scope.

    A variable length array and a pointer to a variable length array are considered variably modified types. Declarations of variably modified types must be at either block scope or function prototype scope. Array objects declared with the extern storage class specifier cannot be of variable length array type. Array objects declared with the static storage class specifier can be a pointer to a variable length array, but not an actual variable length array. The identifiers declared with a variably modified type must be ordinary identifiers and therefore cannot be members of structures or unions. A variable length array cannot be initialized.

    A variable length array can be the operand of a sizeof expression. In this case, the operand is evaluated at run time, and the size is neither an integer constant nor a constant expression, even though the size of each instance of a variable array does not change during its lifetime.

    A variable length array can be used in a typedef expression. The typedef name will have only block scope. The length of the array is fixed when the typedef name is defined, not each time it is used.

    Now don't tell me that isn't sweet! For some algorithms, it's a real game-changer, making them so much simpler to implement - and explain to others - that you never want to go back.

  12. Re:StoneLion on Clickjacking Worm Exploits Facebook "Like" Feature · · Score: 1

    It's not that simple. Several European countries have followed our lead, and if Facebook doesn't comply, they face sanctions - and as we've seen in the news lately, that includes having their plug pulled in various countries, which certainly will affect both their revenue and their valuation.

    What's Facebook worth if Canada, Europe, and chunks of South America all pull the plug? Way less than half, because the "network effect" cuts both ways.

    It opens the doors for competitors that have better privacy policies, and are available in more countries.

  13. Re:Out of the ashes and into C++ on GCC Moving To Use C++ Instead of C · · Score: 1

    Geek insult - "go template yourself."

    By the time they finish compiling, they'll be dead.

    Templates look ugly for a reason. They are ugly.

    They're a shortcut. Funny thing is, the same people who go all gaga over them go "OMG the pre-processor is the devil!" for those of us who make extensive use of the pre-processor.

  14. Re:C++? on GCC Moving To Use C++ Instead of C · · Score: 1

    We may have gained a lot in the last couple of decades, but those early Borland compilers (Turbo C, Turbo Pascal, Turbo Asm, Borland C++) were just so righteous!

  15. Re:Seems odd... on GCC Moving To Use C++ Instead of C · · Score: 3, Insightful

    C++ programmers are the best, most experience programmers around,

    c++ programmers who don't know c all that well (and there are LOTS of them - maybe even the majority) are not the best.

  16. Re:Maybe they've grown up a bit on GCC Moving To Use C++ Instead of C · · Score: 2, Informative

    Using STL frees you from having to do manual memory management

    Here, let me fix that for you:

    Using c++ might free you from having to do manual memory management - just make sure you type a free for every malloc, and that your free gets called when the object goes out of scope (usually in the destructor). Then as the stack pointer gets unwound, the destructor calls your free.

    Have an explicit contract with any other objects or code that uses data this object has allocated - which you should be doing anyway or your code will be thrown out by the next person who has to maintain it.

  17. Re:Maybe they've grown up a bit on GCC Moving To Use C++ Instead of C · · Score: 3, Interesting

    Quite simply because STL is the embodiment of several decades of algorithms and data structures research work. In many cases, use of STL results in near optimal code. In raw C, you're left to yourself to write your own collections and algorithms. You have to try pretty hard to surpass the performance of STL. Do you want compiler developers to constantly reinventing wheels or actually improving the compiler?

    Since this is Troll Tuesday I'll be blunt - that's absolute horsheshit!

    In testing, performance can be 4x SLOWER with the stl than by using c99. Variable-length arrays combined with bsearch make for one of the fastest look-up "containers" going - way faster than any stl algorithm.

    c++ has its uses. It has nice features. The stl, on the other hand, is visually offensive. I bought the hardcover TR1 spec, read it twice, and consider it a waste of time and money. For what most people need, if they can't write their own classes, there's enough generic code that they can modify to achieve their goals.

    On top of which, object-oriented programming is a paradigm, not a language feature. You can do OOP in c just fine by passing an explicit "this" as the first parameter in any function you want to act like a method call. You can even do OOP in assembler - Borland had some nice material on that.

    Use c++ for encapsulation, for references, for the syntactic sugar - but not because the stl will make it run faster - it won't.

  18. Re:It already exists. on Publishers Campaign For Universal E-Book Format · · Score: 1

    You should have hired someone from 20 years ago. They would have told you the difference in encoding between a soft carriage return and a hard carriage return, and all the other old-time specs that made ASCII so great. and the encoding was simple enough to detect - either 7-bit clean or 8-bit.

  19. Re:Dual screen on New Sony OLED Display Can Roll Into Cylinder · · Score: 2, Funny

    Really? I can't think of many. The length of the screen would prohibit the use of simple rails that slide out of the body of the phone... they'd be much longer than the phone's width

    Three off the top of my head:

    1. something like a telescoping radio or tv antenna
    2. something like a folding ruler or cane?
    3. something like a tazer AGGGGHHHHHHHHH!!!!
  20. Re:Now I wanna know which ones are implemented... on Sony Unveils Flexible OLED Thinner Than a Hair · · Score: 1

    There is a list of defined character entities for HTML here: http://www.w3.org/TR/REC-html40/sgml/entities.html [w3.org] Unfortunately, Slashdot does not seem to accommodate them very well

    The problem may also be with perl. Unicode support is not always as advertized. I've had to write code in c to remove some of the more exotic unicode characters that perl choked on.

  21. Re:It already exists. on Publishers Campaign For Universal E-Book Format · · Score: 1

    Personally I'd buy an ebook reader if it was 8.5x11 inches at readable DPI and did PDFs,

    Turn your laptop sideways and rotate the on-screen display. Today's wide-screen laptops have to be better at something!

  22. Re:It already exists. on Publishers Campaign For Universal E-Book Format · · Score: 1

    It's called ASCII. And it's great!

    Combine it with an expanded ansi screen driver (more color range) for nice color "text graphics", and the ability to switch the color palette to something that gets rid of that ugly cyan and magenta, and you're good to go.

    But of course once you do that, it's "too" universal - there's no reason that people would prefer your version over anyone else's.

  23. Re:It just proves today's Apple customers are chea on Why Apple Is So Sticky · · Score: 1

    Of course it also works the other way around - once bitten, twice shy. People who haven't bought an iPhone have other options that are just as good, but less iApple-y, and people who found that most of the $100 of downloaded content is either crap, or something they can do without, there's a better version on the "other" platforms, or that it's just obsolete, will realize that their $100 "investment" is really only $20.

    If you're relying on people not junking an "investment" that's worth less than $100 as the way to keep them tied to you, you're doomed to competitors offering something better for free.

  24. Re:Everything but the power supply ... on New Sony OLED Display Can Roll Into Cylinder · · Score: 1
    ... and if you make it round, you can wrap the screen around it ... Quick, patent round batteries! Oh, wait a sec ...

    What the heck, do it anyway - the USPTO doesn't give a **** about prior art - they're like Mikey, they'll eat anything you stick in front of them! After all, they patented the comb-over., the cry-no-more that gags a baby, human car wash, pet petter, boob tube and insect balls

  25. Re:And they thought "iPad" was bad on Asus Joins Tablet PC Race · · Score: 1

    No, but in Canada they can call it the "eh pad", eh?