Slashdot Mirror


User: Joce640k

Joce640k's activity in the archive.

Stories
0
Comments
11,688
First seen
Last seen
Profile
(view on slashdot.org)

Comments · 11,688

  1. It's all down to effort... on Grad Student Looking To Contribute To Open Source · · Score: 1

    In linus' view, it does not matter if something requires more effort or oversight in regards to code so long as architecturally it is better

    Of course C can be made perfect ... but so can assembly language so why not use that? (Ignoring portability for a moment...)

    I hope you'll agree that writing (eg.) Linux in assembly language would need an order of magnitude more effort than writing it in C. I see the C vs. C++ argument in exactly the same way.

    Linus is *wrong*, there's no downside to using C++ instead of C. If a bad program results from using C++ then it's the fault of the programmer, not the language.

  2. Re:C++ is hard or easy based on knowlege and skill on Grad Student Looking To Contribute To Open Source · · Score: 2, Informative

    e.g. humans just aren't good at always getting tedious details right.

    This is where C++ really towers above C - all those tedious details can be handed to the compiler and the compiler never forgets them.

  3. Re:C++ is convoluted and hard on Grad Student Looking To Contribute To Open Source · · Score: 1

    Passing objects by value would be bad, yes, but passing around a reference to an object is just as efficient as passing a raw pointer (simple logic: references are really just pointers in disguise).

    You can use a raw pointer in the middle of tight loop if you want, I'm fine with that, often do it myself in fact, but keep raw pointers *local*, ie. they die at the end of the function. Don't pass raw pointers around and don't store them long-term.

    PS: I'm the sort of person who regularly looks at the assembly output of my compiler, just to be sure...

  4. Re:C++ is hard or easy based on knowlege and skill on Grad Student Looking To Contribute To Open Source · · Score: 2, Informative

    OK, you had me until there. If you are using multiple inheritance you have a flaw at the architectural level.

    That's just a knee-jerk reaction.

    You could make a coding rule that forbids multiple inheritance of classes other than base classes, I'll accept that, but multiple inheritance is needed.

    nb. Java tries to enforce that rule by only allowing "one base class plus interfaces". That's OK as far as it goes but it forces you to copy/paste the default implementations of interface classes all over the place which is stupid (and can lead to some major editing sessions if the design ever changes). Much better to let the programmer decide for himself - he's the one with knowledge of the job at hand, not the compiler.

  5. Re:All good languages are "unsafe" on Grad Student Looking To Contribute To Open Source · · Score: 1

    I'm aware of the Linux kernel, I also think it could be a lot better/safer if a bit of C++ was allowed into it. The only reason it's 100% C is because Linus doesn't really grok C++ (he's demonstrated this quite clearly in his anti-C++ rants).

    The reason I say C is unsafe is because there's no way to enforce safety in C. It's all down to the programmer to get it 100% perfect, every time.

    eg. If you're using a smart pointer in C++ there's no way you can forget to initialize it to null, the compiler does it for you (and the compiler never has a bad day and forgets to do it...)

  6. Re:C++ is convoluted and hard on Grad Student Looking To Contribute To Open Source · · Score: 4, Insightful

    Did I really type RIAA instead of RAII? Oh, dear...

  7. Re:C++ is convoluted and hard on Grad Student Looking To Contribute To Open Source · · Score: 5, Insightful

    The end result is quite powerful, but not something I'd ever dare to call "safe".

    C++ is as safe as you want to make it.

    eg. Did you know that Visual C++ operator[] does range checking in all standard container classes/strings?

    If you do stuff like that and ban raw pointers (ie. all pointers have to be objects and thus subject to RIAA) then most of your traditional C++ problems disappear. It just takes a bit of practice and getting over the C mentality.

    In return you get multiple inheritance, timely freeing of resources, operator overloading and much more expressive power than Java.

    A good portion of Java code is just copy/paste because you can't inherit implementation and try/finally blocks to get your files closed at the end of functions, not just when the garbage collector feels like it (which might be 'never'). In C++ you write code once in a library and it stays written.

  8. Re:C++ is convoluted and hard on Grad Student Looking To Contribute To Open Source · · Score: 2, Informative

    everything that was "unsafe" about good old C is still there.

    So, um, don't use those bits...use std::vector and std::string instead.

    This is where 'learning' C++ comes into play, as opposed to just hacking around and copying/pasting C source code until it works.

    If you're doing it right the only problems you should have in C++ are null pointer exceptions - just like Java.

    Any real safety still needs to come from the experience of the programmer

    That, and having a teacher who smacked you down every time you tried to use a C-style array or didn't do RIAA.

  9. Re:Sustainable energy? on Economy Puts US Nuclear Reactors Back In Doubt · · Score: 2, Informative

    A major cost of nuclear reactors is the bickering of the NIMBYs. Construction can take fifteen years (ten for bickering, five for construction). An investor could be investing in something else which makes money during that time so to convince him to invest in your plant you have to garantee massive returns in the future.

    Wikipedia has a page on the economics: http://en.wikipedia.org/wiki/Economics_of_new_nuclear_power_plants

  10. Re:It looks like it'd take an economic meltdown to on Economy Puts US Nuclear Reactors Back In Doubt · · Score: 4, Interesting

    Seriously though, this delay could be a good thing. They were going to build the wrong sort of reactors and perpetuate all the problems of the 1950s atom bomb production plants.

    Thorium reactors, pebble beds..? Not on the shortlist. I'm guessing Westinghouse has plenty of lobbyists.

  11. Re:Loan from government? on Economy Puts US Nuclear Reactors Back In Doubt · · Score: 1

    It's a long-term loan. The interest rate of a bank over long terms is crippling. Governments can do special low-interest rates if they want to.

  12. After one hour where will it be...? on Grad Student Looking To Contribute To Open Source · · Score: 1

    You haven't solved those problems yet?? I thought they would have been solved 20 years ago.

    I'm flying next week and suddenly I'm nervous.

  13. Re:C++ is convoluted and hard on Grad Student Looking To Contribute To Open Source · · Score: 3, Funny

    C++ doesn't teach you anything, you study it.

    From the summary it sounds like he learned C, not C++. There's a huge, grand-canyon-sized difference between the two.

    C++ is a safe, expressive, modern language - like Java but without all the horrible limitations. Yes it takes a bit of study and it's not for casual programmers, but the results are worth it.

    C is much lower level, unsafe language. Good for what it does but dangerous and a very bad choice for large projects.

  14. Re:Mod parent up. on Indian Military Organization To Develop Its Own OS · · Score: 1

    Seriously? Security wasn't a key part of Linux/Unix?

  15. Re:Fair market price on Apple Pays Couple $1.7m For 1 Acre Plot · · Score: 1, Troll

    It's the only place in California where the iPhone can get a decent signal...?

  16. Re:A solution to a problem that doesn't exist on DC Internet Voting Trial Attacked 2 Different Ways · · Score: 1

    the voter's registration card has a public encryption key...yada yada

    ...and their swiss-cheese-security PC has a specially released vote changing virus on it.

    Oh, dear. All your maths and cryptographic theory was just defeated by a $5 wrench.

  17. Re:Facts don't matter on DC Internet Voting Trial Attacked 2 Different Ways · · Score: 3, Insightful

    We're talking about internet voting, not voting machines. ie. People voting from their botnet-ridden home PCs.

    What's to stop a party from releasing a virus which triggers once on election day then deletes itself from disk? Such a virus could subvert the entire process, regardless of public keys, SSL, whatever.

  18. That's the biggest problem you can think of...? on DC Internet Voting Trial Attacked 2 Different Ways · · Score: 2, Interesting

    What about all those "botnets" you see in the news?

    Strength of cryptographic algorithms, etc., is completely irrelevant when people vote by visiting a web page using their home PC.

  19. Re:stunning ... on DC Internet Voting Trial Attacked 2 Different Ways · · Score: 1

    You know all those machines which are affected by things called "botnets" you see in the news...?

    Basically there's millions and millions of people who aren't really in control of their home computers.

    Strength of cryptographic algorithms would be irrelevant if the balance of power was decided by people visiting a web page using those computers.

  20. Kids can't buy pot on the streets...? on Facebook Billionaire Gives Money To Legalize Marijuana · · Score: 4, Informative

    Boy, are you out of touch.... your chidren can buy pot any time they choose. Today.

  21. Re:Mixed messages on Facebook Billionaire Gives Money To Legalize Marijuana · · Score: 1

    If you're been told your entire life that pot turns people into total stoners and losers then seeing some normal people smoking pot could dispel that.

    OTOH, correlation isn't causation. Smoking pot definitely won't make you any smarter.

  22. Must be nice being a senator... on DMCA Takedown Notice Leveled Against Ohio Congressional Race Ad · · Score: 3, Insightful

    One quick phone call and your web site is back up again. I bet if it was joe sixpack it'd still be down.

  23. Re:First post! on Against Apple, Ballmer Floats Microsoft Merger With Adobe · · Score: 1

    So ... what software will replace Photoshop on Mac?

  24. Re:I miss some of those old games on Game Prices — a Historical Perspective · · Score: 1

    Nintendo/SEGA prices were much higher because Nintendo/SEGA took a big cut of the profits for the privilege of writing games for their console.

    On top of that, only they could manufacture the cartridges and they charged a lot for that as well.

    Plus ... development was very risky because they only accepted a fixed quota of games per year to keep the market from saturating. If they didn't like yours it wouldn't get published (and you only got *one* shot at acceptance ... you showed them the game and if they didn't like it you were dismissed, no second chance)

    So yeah, comparing the price of NES games to Speccy games is pointless. Development costs for Japanese consoles were orders of magnitude more than for Speccy/C64.

  25. Re:War in Russia Atari 800 on Game Prices — a Historical Perspective · · Score: 1

    I think he's talking about the Neo Geo - a programmable arcade machine for the home (with prices to match).