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:Code signing discriminates against unmanaged co on What Programming Language For Linux Development? · · Score: 1

    You can get phones that were never locked (just not from your local phone company, who subsidizes your phone purchase by "locking you in") or by paying someone $25 to $40 to unlock your current phone. Or you can search certain places on the web and find the programs ...

    As for web servers, you don't need the same architecture - just a cross-compiler, and there are lots of free ones out there.

    Local machines? Last week I saw 16-gig usb keys for $50. Just boot a copy of your OS off that (okay, not really much of an option for Windows users, but that's a FEATURE, not a bug :-). Or boot off a dvd and use a usb key as your data store.

  2. Re:This is all true however... on What Programming Language For Linux Development? · · Score: 1

    Have you ever ported a C app from a big-endian architecture to a little-endian one? It works on all platforms until you have to move it off of an Intel box...

    If you're writing networked apps, you already write things like htonl(), and should be aware of byte-order issues.

  3. Re:Platforms where C does not work on What Programming Language For Linux Development? · · Score: 1

    And what do you think the runtimes on all those platforms are written in? c/c++.

    C doesn't work for the server side of web applications installed on shared hosting; generally, interpreted languages whose names start with P work for that.

    Since when? Last time I checked (showed my boss how much quicker a c binary can be executed than a long php script by running both on my hosts' web servers) my hosting provider supported cgi binaries written in c ...

    My guess is it depends on your hosting provider, but in the early days of the net, c code frequently ran on web servers, which is where the "bin" in cgi-bin came from :-)

  4. Re:Learn C and Python on What Programming Language For Linux Development? · · Score: 1

    I agree with putting a default statement in your switches. I stick mine just below the last case statement, and let it "fall through'. This way, it not only marks the last case as also being the default case, but it gives a place to cleanly add new cases w/o breaking code.

  5. Re:Learn C and Python on What Programming Language For Linux Development? · · Score: 1

    Use the comma operator to make it a single statement? In nearly a decade of professional development and well over in hobby work, I've never seen that done. I'd bounce the code review if they did. Just put in some damn parenthesis.

    You'll see this all the time in for-loop code. for (i=0, total=0; i ... so, are you going to bounce code that does this style of initialization, which is actually easier to debug, since you don't have to worry about total having gotten clobbered by someone adding new code after your original write-up?

    > It's in the language spec, so why not use it? This is perfectly legit, and legible, code. Just like this: if (x) y += tmp=a, a=b, b=tmp, a;

    Its safer than using a SWAP(a, b) macro, and if you're familiar with this particular use of the comma idiom, you only need to look at the last variable in the comma-separated list to know that the code does a y+= a, and you'll quickly learn to recognize that the comma-separated code is a simple swap.

  6. Re:Learn C and Python on What Programming Language For Linux Development? · · Score: 1

    put a break after the last statement in a switch

    That's actually a very wise thing to do, as a defense against the time in the future when some bozo adds another case to the end of the switch statement, and forgets to add a break statement above it. Voila, he's accidentally created an unintended fall-through condition where two cases get executed instead of just one... and a hard-to-find logic error that will be a bitch to debug. Better to just put in the (harmless) extra break statement up front and save debugging time later.

    Smarter to just put a "default:" label right after your last case label. It not only makes it obvious that the last case is now the default case as well (so order your case statements accordingly), but it also avoids the superfluous break statement. Conveys more information with less noise.

    Of course, you also have times when you want case statements to "fall through" to the next one as well - and it's not just for the semi-contrived example of "workday/weekend". I've seen code where it's obvious that the coder didn't know you're allowed to "fall through" to the next statement - lots of code duplication in several cases ...

  7. Re:Learn C and Python on What Programming Language For Linux Development? · · Score: 1

    We're in the days of 1900x1200 widescreen monitors. You can't spare a few lines of text for some extra braces for clean-looking code? You can't scroll your mouse wheel one extra time?

    I use keyboard shortcuts, you ignorant clod :-)

    Seriously, hi tech gives (higher-res monitors) and users take away ... my secondary monitor at work is 1600x1200, coupled with my laptops' 1440x900 I have more screen real estate than you, but why should I waste it on superfluous braces. Read the c language spec - braces are for blocks of code and for enums. NOT for single lines.

    While I was half-joking about the keyboard shortcuts, it's only half-joking. I can't believe how many times I've seen people use the mouse to select code, then select "Edit->Copy", then use the scrollbars to go down a page, then use the mouse to select the insertion point, then select "Edit->>Paste." Over and over and over. Then, since they inevitably copied more or less white space than they wanted, futx arround with the formatting some more (select the extra spaces with a mouse, go to the menu, select Edit->Delete") Do that a couple hundred times a day and you're losing 20 or more hours a month, 240 hours a year. And they're all coders from a Windows background. Heck, even the old Wordstar keyboard shortkuts weren't THAT hard to learn.

  8. Re:Interesting case on The Unforgettable Amnesiac · · Score: 2, Interesting

    There was this one guy a few years ago who, whenever he bumped his head (not a big bump, either), he'd forget what he was doing.

    He sat in a van for 2 days in the middle of winter, engine idling, trying to figure out what to do next. The Montreal police finally found him and called his wife.

    Memory is a strange beast at times.

  9. Re:This is all true however... on What Programming Language For Linux Development? · · Score: 2, Informative

    ...Object-oriented? I hope you mis-typed. You're confusing C and C++

    You know, you can write object-oriented assembler or c if you want to ... do a search and you'll find all sorts of stuff - people have been doing it for decades.

    For example, there's no reason why you can't stick function pointers in an ordinary c struct, and then proceed to use it pretty much as you would any conventional class. You just have to remember to explicitly pass "this" - a pointer to the struct - as one of the parameters, rather than have it implicitly passed (or you can have a macro do it for you behind the scenes).

    Actually, on the current c project, you'll find my code littered with stuff like "this->yadda_yadda_yadda." Works fine.

  10. Re:win32 a first-class citizen? on Free Resources for Windows Perl Development · · Score: -1, Offtopic

    A decade ago, GM was also making money had over fist. GM is celebrating its' 100 year anniversary facing bankruptcy in weeks. Microsoft will probably end up being bought by Apple for chump change long before it hits its' 100 years.

    Also, the government (and most governments world-wide) having adopted the Word .doc format as a "standard" for so long is a HUGE government subsidy, and one that won't lst much longer. Your tax dollars can be better leveraged by using software that doesn't tie your government to one vendor. Single-sourcing is inherently uncompetitive, and risky.

    http://en.wikipedia.org/wiki/Smartphone Both Symbian (46%), Apple (17.3%) RIM (15.2%) beat out Microsoft (13.6%) in the smartphone OS market. Not exactly high-profile, and with Android coming out, linux looks to be the major threat http://code.google.com/android/what-is-android.html

    Android relies on Linux version 2.6 for core system services such as security, memory management, process management, network stack, and driver model. The kernel also acts as an abstraction layer between the hardware and the rest of the software stack.

    Supercomputing? Windows has 5 entries in the top 500, linux and various linux distros have 452. In terms of actual computing power, it's even more lopsided.

    In terms of gaming consoles, the Wii and the DS blow both the xbox and the ps3 out of the water.

    Next you'll be claiming the Zune is a threat to the iPod. Microsoft produces second-rate products. The Win32 API is ancient, cruft-laden, and also second-rate.

  11. Re:win32 a first-class citizen? on Free Resources for Windows Perl Development · · Score: 1

    I'm not sure your car analogy is apropos. You had a chance of wrenching on an old Buick. Also, back in the day, the impact of a frizbee did not trigger $4k in damage. You never get out of a body shop for less than $4k.

    Good point - the old "Windows is like a car with the hood welded shut" strikes again! Darned :-)

    The frisbee cost is another good point. Open up the wrong email, or surf the wrong site, and you'll spend more to fix the damage than the OS cost in the first place - and that's even if you had "protection", since anti-virus software is just an arms race.

  12. Re:win32 a first-class citizen? on Free Resources for Windows Perl Development · · Score: -1, Troll

    Spoken like a true geek: short-sighted, and from the ass.

    Spoken like someone who has drunk so much of the purple kool-ade they can't think of "whatcanpossiblygowrong"? You're the one being short-sighted. Who will be the group that benefits most from a perl Win32 API? Malware authors and their clients. The RBN will be most happy to subscribe to your newsletter.

    Aren't there already enough tools to practice p0wnage on Windows users without adding more?

    Windows is a second-class (or worse) OS. Get used to it, because it's only going to get worse. Or have you forgotten Microsofts' promise that viruses won't run on Windows, so you should switch from DOS. And then the same promise for Windows 95, since it was supposedly a true 32-bit OS?

    Windows can't compete fairly - that was established last century. It's truly second-class.

  13. Re:win32 a first-class citizen? on Free Resources for Windows Perl Development · · Score: -1, Troll

    My point was that Win32 and Windows are not first-class citizens in the computer world. Aside from the desktop, Windows is either late to the party, or trailing badly, or not visible. On the desktop, Windows is also second-class - the Mac has it beat hands down. There's a lot of truth to "Once you go Mac, you never go back" - and part of that is because the Win32 API is a piece of crap, and has been for over a decade. It's been extended since the original add-in that you could download for Win311 to give it 32-bit support, and it shows its' heritage.

    The people who will really get a kick out of a perl Win32 API are the malware writers. I say "Go for it!" The more malware out there, the more likely people are to switch to a real operating system, and not some dog-and-pony-show tarted-up with a ton of lipstick.

  14. Re:win32 a first-class citizen? on Free Resources for Windows Perl Development · · Score: 0, Flamebait

    Haven't used Win32 in over a decade. Never used MFC because it was total crap - like a lot of people, I ended up having to write my own abstraction classes since OWL wasn't much better.

    Windows is dying. It's like GM. Bloated, pointless, only continuing to exist because "it's too big to fail" - in other words, on its' past momentum. Microsoft either has to break completely with the past (and in so doing, break Win32 compatibility), or continue to be the worlds' most popular malware enabler.

  15. Re:win32 a first-class citizen? on Free Resources for Windows Perl Development · · Score: 0, Redundant

    I know what Win32 is. I also know, having written my own abstraction layer for it, that it's a real POS. Thankfully, I haven't had to use it in over a decade, and have no plans to in the future, just like I don't see myself switching back to Windows either at work or at home.

    KDE 4.1 makes Vista look like an old Buick.

  16. Re:This is all true however... on What Programming Language For Linux Development? · · Score: 2, Interesting

    Not sure about the perl one (I've managed to get along fine with sed and grep so far), but a good working knowledge of shell scripting and available tools is essential. `man' or `info' can help with that. ;)

    WRT "man" - actual conversation from work last week with regard to "man 2 send" - the c function for sending via a socket:

    Me: "Look, instead of asking me all the time, just look it up."

    Co-worker: "What website?"

    Me: Use "man". It's already in the man pages on your machine.

    Co-worker: "How do I do that?"

    Me: "Try man man. Read the result."

    Two weeks ago, it was "ps" and "kill" (though not "kill -9" :-). Next week, I introduce "apropos", and grep to filter out yucky results. ... kids nowadays ... they think "mc" is a "low-level" tool. I shudder at the thought of teaching them how to make a commit to svn from a terminal .... it's like they can't read ... I have to "white-board" every explanation, or threaten to lart them. Or make them drink the coffee.

    Like naming conventions. "I know what UPPERCASE and lowercase are, but what's TitleCase? What's camelCase?" At least they grokked type_name_t for types, UPPER_CASE_IS_FOR_MACROS_AND_CONSTANTS, lower_case_for_functions(), TitleCaseForClasses,camelCaseForMethods() - AFTER I drew a picture of a camel and pointed out the hump (my camel book stays at home). Then gave some more shit over misusing leading underscores (short version - don't).

    Then we got into the whole history of "do you precede a class name with a "C" for "Class" or "T" for "Type", and how Microsoft used "CClass" to avoid naming conflicts with their competitor, who was using "TClass", and it doesn't really matter - use your initials for all I care - just be consistent (also lets us know who to blame, if they're too cowardly to include a \blame comment :-)

  17. Re:Learn C and Python on What Programming Language For Linux Development? · · Score: 3, Insightful

    That's a bad reason for not blockifying single line ifs. You could just put { } around the statement on the single line, ie write if ( ) { } all on one line, or even if ( ) { }; in case your editor has trouble with indentation. You'll get the same benefits, the compiler will do the right thing, and if later some idiot decides to expand the conditional statement, they won't forget to add the braces.

    I like my code clean and concise. If some idiot (your term for them) is stupid enough not to either add braces to blockify the statements or use the comma operator to keep it as a single statement, they'll learn quickly enough. In a modern editor, if you cut-n-paste the code, it will adjust the indent accordingly, and it will be painfully obvious where they went wrong.

    ... and those extra semi-colons "just in case" are also ugly.

    I belong to the school of thought that holds that if it looks ugly, it probably isn't done right. At the office, I'm not ashamed to have others review my code - it's cleaner, more of it fits one one screen at a time, so you can get a quicker grasp of it, etc. Those benefits outweigh the risk of an incompetent coder having a brain fart.

    Remember, the purpose of source code is to communicate intent - first, to the compiler, second, to you and anyone else reviewing it. The compiler doesn't care, but people aren't compilers.

    Heck, I've seen people who are so unsure of how the language works that they blockify the contents of their case statements, put a break after the last statement in a switch, and braces around every one-line else clause because they're not *sure* as to which "if" the compiler will think it belongs to. These same people always end up being the ones who have code that is indented so much that most of the action takes place in the right-hand margin, and they also indent every parameter that far as well, rather than let it word-wrap, or clean up their code. And they've done so much drag-n-drop of code that it's a mishmash of spaces and tabs.

    They inevitably learned on Windows. They feel they need an IDE with auto-suggest, templates for almost every type of project, and built-in "project management" because they can't write a make file to save their lives ... when deprived of Visual Studio, they fall back on compiler shell scripts rather than ask for the nickel tour of "make", or *gasp* buy a book and read it!

    Clean, concise code - it's not just good looking, it's cheaper to debug and maintain.

  18. win32 a first-class citizen? on Free Resources for Windows Perl Development · · Score: -1, Troll

    developed Strawberry Perl to "make Win32 a truly first class citizen of the Perl platform world

    Just one question. Why? Can you even BUY a computer with a 32-bit cpu any more?

    What next - ports for the C64 and Tandy Color Computer?

  19. Re:How much do you want to learn? on What Programming Language For Linux Development? · · Score: 1

    ever heard of this mono thing?

    Yes. If you've got mono, see a doctor.

    As for memory management, valgrind now works great even for threaded programs, so there's no excuse for needing the hand-holding and performance hit of a "managed language" that has patent issues.

  20. Re:Learn C and Python on What Programming Language For Linux Development? · · Score: 1

    just forget to put { } around a multi-line if statement (some lazy bums don't put them around single-line if ;),

    No, we just understand that in c, the proper use of {} is to convert a multi-statement line syntactically into a single statement.

    blockifying every single-line statement is childish, and makes for less code on the screen, so more scrolling, and less chance to catch a bug. Ditto for putting the opening parenthesis of a function call on a new line - it's a waste of screen real estate, and with todays' wide screend totally inexcusable. Semantically, it's just another statement, and should follow the same rules.

  21. Re:I like Python on What Programming Language For Linux Development? · · Score: 1

    In contrast, one of the things I love about Python is it's use of whitespace.

    ... so no brainfuck for YOU!

  22. Re:This is all true however... on What Programming Language For Linux Development? · · Score: 4, Insightful

    C - absolutely. C isn't going away any time soon, and it works on ALL platforms, not just linux (and in many cases porting to bsd is just a recompile and a few extra headers). You'll also have to learn to write your own make files - not a hard job.

    And you'll find you'll need perl and bash scripts.

    Everything else is just "for this type of app, these are what most people use ... pick whatever you feel most comfortable with."

  23. Re:Death March on Avoiding Mistakes Can Be a Huge Mistake · · Score: 2, Insightful

    A good coder should enjoy their work enough that they can help bring others up to speed. Everyone benefits. The good coders benefit from better communications with their co-workers, as well as knowing what can and can't be handed off to others, and how much supervision they'll need.

    Projects don't fail because of bad coders. They fail because of mismanagement, poor resource allocation (the biggest problem being time constraints), lousy communications, lack of trust, and a willingness to take shortcusts "just this once."

    Besides, it's a real ego boost when a former co-worker tells you that they really learned a lot working with you. Makes you feel good having done some good in the world. Sure beats the usual "pissing contests" that go on all too often.

    Good. Fast. Cheap. Pick ONE. The person who said "Pick two" was an optimist.

  24. A better idea ... on Avoiding Mistakes Can Be a Huge Mistake · · Score: 1

    I'd be willing to put up with more checks provided that there are checks put on:

    1. Non-coders, people with only a superficial knowledge of the project, and code wannabes;
    2. Stupid ideas that have to be coded RSN, without any analysis of either the market or the impediments involved;
    3. Requirements to implement an idea in the stupidest fashion possible;
    4. Feature creep, and the creeps who push them;
    5. "Don't take the time to do it right" mentality
  25. Better to make a video on Avoiding Mistakes Can Be a Huge Mistake · · Score: 1

    A lot of people who are bored stiff with writing documentation are good with white-boards and q&a sessions.

    Make a video of the dev explaining the whys and wherefores (stuff that usually gets omitted anyway - youknow - "wtf did they do it like THAT?"), explaining how it's to be used/deployed, and answering questions from the other coders/reviewers/testers.