Beta
×

Welcome to the Slashdot Beta site -- learn more here. Use the link in the footer or click here to return to the Classic version of Slashdot.

Thank you!

Before you choose to head back to the Classic look of the site, we'd appreciate it if you share your thoughts on the Beta; your feedback is what drives our ongoing development.

Beta is different and we value you taking the time to try it out. Please take a look at the changes we've made in Beta and  learn more about it. Thanks for reading, and for making the site better!

Comments

top

TrueCrypt Gets a New Life, New Name

Marginal Coward Re:FOSS names (237 comments)

Not all FOSS project names are as crappy as possible. But one is. Have you heard about the new "Crappy" project: "Crappy's really a praiseworthy project, yutz".

yesterday
top

TrueCrypt Gets a New Life, New Name

Marginal Coward Re:Does the TrueCrypt License (237 comments)

I think you're onto something. Perhaps *that's* why the secret formula for Coke has never been open-sourced, but remains locked in a vault in Atlanta to this very day. Likewise for the secret Krabby-patty formuler. Just think what havoc Pepsi and Plankton could wreak with the TrueCrypt code...

yesterday
top

U2 and Apple Collaborate On 'Non-Piratable, Interactive Format For Music'

Marginal Coward Re:Expert. (329 comments)

If DRM and copy prevention mechanisms worked, how do you explain the fact that each and every one has been bypassed?

Oh, and also voluntarily abandoned by Apple - at least in the case of music. In fact, as I understand it, Steve Jobs himself eventually succeeded in badgering the record industry into allowing the removal of DRM from music distributed by iTunes. Evidently, he thought he could sell more music that way.

yesterday
top

Cuba Calculates Cost of 54yr US Embargo At $1.1 Trillion

Marginal Coward Re:$1.1 Trillion over 54 years... (534 comments)

Which means most independent observers have long concluded the Castros like the embargo, because it allows them to claim everything that is wrong with the country is Evil Foreign Gringo's fault.

Indeed. I believe Br'er Rabbit used a similar tactic to retain control over the briar patch.

about two weeks ago
top

3 Short Walking Breaks Can Reverse Harm From 3 Hours of Sitting

Marginal Coward Re:What's "Easy" About This? (161 comments)

Righteo. It's long been my habit to never use an elevator when stairs will do - which is always the case where I go. And I've recently adopted the habit at work of going to the restroom in an adjacent building once or twice a day rather than just always using one just down the hall. These things may seem like a hardship at first but they soon become easy, and - if the need isn't too urgent - relaxing.

A related form of exerlaxation is running up the down escalator at a shopping mall. Oh, and don't worry about the dirty looks from old ladies - they somehow always manage to get back up before the end of the escalator, so long as you start when they're somewhere near the top.

about two weeks ago
top

Taking the Ice Bucket Challenge With Liquid Nitrogen

Marginal Coward Re:it tingles (182 comments)

Anyone who has worked extensively with the stuff will tell you it is NOT safe unless you are careful.

Right. As someone who has had several skin issues successfully medically treated by having them burned off with liquid nitrogen, dumping it on your head seems like a *very* bad idea - even for somebody who knows what they're doing. In my case, small drops of it on a Q-tip, held in place for a few seconds (no Leidenfrost effect here), were powerful enough to freeze and ultimately destroy the skin underneath, as intended.

about two weeks ago
top

Ask Slashdot: What Are the Best Games To Have In Your Collection?

Marginal Coward Chip's Challenge (382 comments)

Many years ago, in the old DOS days, I loved a nice little game that most folks probably have never heard of called Chip's Challenge. Anybody remember that?

Evidently, a modern imitation of it called "Tile World" is available. Maybe I'll have to try that sometime.

about three weeks ago
top

Time Warner Cable Experiences Nationwide Internet Outage

Marginal Coward Overwhelming call volume (133 comments)

TWC's customer service reps are reportedly a bit overwhelmed by call volume at the moment

Hopefully, their remaining customers, who evidently are willing to wait on hold for at least two hours under normal circumstances, will understand and will patiently wait on hold for ten hours for the privilege of being told "We're looking into it but there's nothing we can do right now."

Luckily, TWC has competition in my area. Every time I see an ad from them that seems cheaper than what I'm paying to their competitor, I remember the horrifying customer service, and the urge to save money goes away.

about three weeks ago
top

Ask Slashdot: What Do You Wish You'd Known Starting Out As a Programmer?

Marginal Coward Just a few little things (548 comments)

1) You'll spend as much or more time fixing code than you do writing it. Therefore, anything you can do early in the process to reduce those is time well spent, even though it may seem like a waste of time:
- Single-step through every line of newly written code
- Do a little personal code review of all code you write
- Develop module tests as you write code
- Test every line of code in some way, either informally or formally.
- Write comments and documentation, even if just for your own benefit. Your future self may not understand what you've done as well as your present self does.
- Make changes to working code sparingly, and take steps to make sure that every change is for the better. (See above.)
2) Write code in small pieces, get the pieces working well, and stitch them together. Don't write something giant all at once that may never work.
3) Approach debugging on a data-driven basis. Most problems can be solved best by instrumenting what's happening in some way, e.g., via a debugger or a simulation. Though the trial-and-error method often is appealing for instant gratification, it's usually inefficient.
4) Read a few very good books: "Writing Solid Code", "Code Complete", "The Mythical Man Month", "The C Programming Language".
5) Learn several languages, including Python. Every language you learn makes you better at the other languages you already know.

about a month ago
top

Interviews: Ask Bjarne Stroustrup About Programming and C++

Marginal Coward Re:Templates all over again (427 comments)

Thanks for your comment. FWIW, here's what really happened. The function took a std:string as a parameter. The nominal use of it was to put in a char * literal which would get automatically converted to a string, so the parameter couldn't be passed by reference. While trying to step into the function, I stepped through the string constructor, which made several small function calls. When I replaced the parameter declaration with "char *", all that went away, and I was able to step directly into the function.

To be fair, the actual runtime overhead of the std:string constructor might be minimal, and could potentially be avoided by using a reference in many cases - though not this one. So, my concern about bloat when using template classes was anecdotal and might be overblown. As with any tool, you should use the right one for the job, and the string class does have some advantages, notably the ability to magically grow as needed. In this case, though, a char * would have worked just fine, so I contend that the original programmer didn't choose the right tool for this job.

I've used STL classes over the years, primarily vector and string, but I've had many experiences like this where something that C provided was a better fit for what I was trying to do. For example, a file name parameter probably doesn't need to magically grow, so a char * works just fine for that. That sort of experience, combined with having to repeatedly consult the documentation about STL functions because they aren't very intuitively named, has led me to prefer C constructs when I could potentially use either. That's what I meant in my original post when I said "many programmers minimize their use of templates".

Then again, I'm from the "less is more" school of programming. Some folks like to impress themselves and/or their friends by using as many fancy constructs as possible, in order to be judged a "*good* programmer" - as another commenter in this thread evidently does.

Though my original post was perhaps a bit overstated (for your entertainment), I actually do use the STL, but only at a very basic level, and only where it explicitly solves a problem. I think I would be a lot warmer to it if C++ templates and the STL itself were better designed. For example, I much prefer Python's string functions and MFC's "CString" class to std:string.

But even if templates and the STL were better, good-old-fashioned C still can meet most such needs very nicely. And as Tim Peters said, "Beautiful is better than ugly." (BTW, I wonder if Dr. Stroustroup thinks his template baby is beautiful? - maybe he'll tell us. ;-)

about a month ago
top

Interviews: Ask Bjarne Stroustrup About Programming and C++

Marginal Coward Re:Templates all over again (427 comments)

...but I do at least make an effort to understand the language that I'm using.

Unlike us "bad" programmers...

My basic point in the original point was that C++ templates are so complex as to be nearly impossible for most of us to *fully* understand. Don't you think that implies at least some sort of effort to understand them? In retrospect, though, my failure to fully understand them can only be attributed to my own abilities, not to the design of templates themselves. My bad...

about a month ago
top

Interviews: Ask Bjarne Stroustrup About Programming and C++

Marginal Coward Re:Templates all over again (427 comments)

"I'm not bad. I'm just drawn that way." --Jessica Rabbit

Gee, Wally, if I use as many templates and template libraries as possible, do ya figure I can become a *good* programmer like you? ;-)

about a month ago
top

Interviews: Ask Bjarne Stroustrup About Programming and C++

Marginal Coward Re:Templates all over again (427 comments)

Thanks. Please forgive my idocy. I think I got fooled the other day when I stepped through several std:string functions that were involved in passing a std:string parameter into a function. Then I replaced the parameter with a char *, and there was nothing to step through anymore. Apparently, though, all that std::string stuff would magically disappear in the release version. I forget whether the string parameter was passed by reference or not - somebody else wrote that part.

about a month ago
top

Interviews: Ask Bjarne Stroustrup About Programming and C++

Marginal Coward Re:Templates all over again (427 comments)

To be fair, my complaint about portability was due to a very bad experience I had over 10 years ago. Maybe it's gotten better since then. ;-)

about a month ago
top

Interviews: Ask Bjarne Stroustrup About Programming and C++

Marginal Coward Re:Templates all over again (427 comments)

So what if you used a set of powerful templates to create a complex layered system rather than writing a simple one by hand? For an example, compare the STL string class to C's string library. It's not about the use of templates, per se, it's about the design of the systemthat the use of templates may lead you to. In effect, the major benefit of templates - their ability to create large, reusable systems - is a major drawback if you're looking for something fast and small.

about a month ago
top

Interviews: Ask Bjarne Stroustrup About Programming and C++

Marginal Coward Re:Given that (427 comments)

Likely true, but the benefit of C that I'm highlighting is that it gives you very little rope to hang yourself with in terms of creating a system composed of layer-upon-layer of classes. In contrast, I once worked with someone who loved to create class-upon-inherited-class for the simplest things in C++. Everyone who looked at his code wondered "where's the beef?", that is, the part that did something useful. The code worked, so the useful part must have been in there somewhere. But it sure wasn't easy to locate. I think he had tiny bits of useful stuff cleverly hidden in most of his classes. As best I could tell, though, some did nothing at all.

Basically, I regard C's inability to create a large complex hierarchy of objects, together with its ability to support objects in a basic way via pointers to structures, as a primary selling point that explains its persistence in a world where a "better" superset has long been available. That's not to say that the C++ approach of layering inherited classes is bad or wrong, just that its lack in C can prevent a certain category of problems.

about a month ago
top

Interviews: Ask Bjarne Stroustrup About Programming and C++

Marginal Coward Re:C++ is an over bloated monster (427 comments)

Back in the old days, when there used to be book stores, I used to marvel at the girth of the C++ books on the shelf. After having programmed C++ for many years, did I really know all the stuff in one of those fat books? Probably not...

about a month ago
top

Interviews: Ask Bjarne Stroustrup About Programming and C++

Marginal Coward Re:Given that (427 comments)

Having used both extensively, I can tell you that it is much more difficult to write slow, bloated, overly complex code in C than in C++. It keeps you honest in that way. Also, most of the good things of C++ such as object-oriented programming and templating can be done at a basic level in C. For example, in C++, a class function is just an ordinary function with a hidden pointer to a (class) structure. Why not just pass in a pointer to a class structure in C? And class member privacy can easily be a matter of naming convention rather than something the compiler enforces.

C++ has its value, and may be better suited for building large, complex, systems such as GUI frameworks, but C is a great choice for cases where speed and minimal size are paramount, such as most embedded code as well as the Linux kernel. In principle, it's possible to write fast, small code in C++ by using its features selectively. However, if you do that, you're left with mostly just the features you could have emulated in C anyway.

Oh, and did I mention that in its current form C is the "perfect" programming language? Other languages have their own goals, but judged in terms of its own goals, C does what it's trying to do better than just about any other language - far better than C++ meets its goals. There's a reason that changes to C over its many years have been very minimal, and virtually always for the better.

about a month ago
top

Interviews: Ask Bjarne Stroustrup About Programming and C++

Marginal Coward Templates all over again (427 comments)

I'm a fan of C++ overall, but it seems to me that C++ templates are a bit of a disaster. They're so complex that I doubt that anybody but you and P. J. Plauger *fully* understands them. Also, when they're actually used, they often result in bloated, slow code - as I recently experienced when stepping through some STL string functions. Further, they bring on a lot of portability issues, evidently due to the difficulty that even the compiler folks have had in understanding and implementing them. Therefore, many programmers minimize their use of templates, both in their own code and in their use of templated library code.

Compared to the complexity of C++ templates, the C macro preprocessor provides a rudimentary form of templating via its very simple and powerful paradigm of text substitution. I've had some success implementing a limited form of generic (type independent) programming in C using just the C preprocessor. I've had much less success doing generic programming via C++ templates.

If you had templates to do all over again, what would you do differently? Was all the complexity of C++ templates (e.g. "partial specialization") really necessary to achieve its goals? Were the goals maybe too ambitious?

about a month ago
top

Interviews: Ask Bjarne Stroustrup About Programming and C++

Marginal Coward Re:AI writing code? (427 comments)

Do you think AI will start replacing junior programmers in the foreseeable future, similar to car drivers and call center operators?

Why ask Dr. Stroustrup and wait for an answer? Siri could tell you now...

about a month ago

Submissions

Marginal Coward hasn't submitted any stories.

Journals

Marginal Coward has no journal entries.

Slashdot Login

Need an Account?

Forgot your password?

Submission Text Formatting Tips

We support a small subset of HTML, namely these tags:

  • b
  • i
  • p
  • br
  • a
  • ol
  • ul
  • li
  • dl
  • dt
  • dd
  • em
  • strong
  • tt
  • blockquote
  • div
  • quote
  • ecode

"ecode" can be used for code snippets, for example:

<ecode>    while(1) { do_something(); } </ecode>