Better HN
topnewbestaskshowjobs
Log inSign up

makecheck

12,740 karma · joined Feb 17, 2008 (18y ago) · 2,917 submissions

Submissions

comment 17y ago · link · parent

Many programmers confine projects to one language, but this severely limits their potential.

If Python (or anything else) isn't perfect, that doesn't mean there is necessarily a problem with the language, or that you shouldn't use it. For example, once I became familiar with SWIG, I was not at all afraid to use C++ for the things that needed to be fast, while continuing to use Python for a large portion of what I had to maintain. And, I don't automatically write every script in one language, I use whatever is most suitable to the task.

comment 17y ago · link · parent

The iPod could store a person's entire music library, which other players at the time could not do. That was a major selling point. While advertising wouldn't hurt, you can't say that a few commercials were the only reasons anybody wanted one.

comment 17y ago · link · parent

It's a neat idea; but I have to say, I wouldn't use it because I can already set up these kinds of short-cuts in my web browser (OmniWeb) with more flexibility.

To give an example of what OmniWeb can do:

- Define any shortcut pattern with any name.

- Map that to a URL, where the string can be substituted in at any point. This also means you can set key-value pairs for queries, etc.

- Specify GET or POST.

So a useful addition to your site might be user profiles that allow people to define anything they could ever want.

comment 17y ago · link · parent

It seems natural to overdo a new tool until you've found its best uses.

But I think the only drug is perfectionism, and it applies to anything reasonably complicated. The cure is brutal honesty. How much will you really be able to reuse in a sophisticated design? (Not much.) How likely is it to change? (Very likely.) Will an unanticipated new feature completely destroy your formerly-perfect object design? (Often, yes.)

One of the original thoughts behind inheritance was to manage complexity. But since code is read much more than it is written, I think of my eyes and not my fingers. Sure, I may have saved some time writing the code, and even had fun coming up with its unique design. But the next 40 or 50 times I have to go back and understand the code, and read 4 or 5 other files just to figure out what a function does, I see the error of my ways.

That doesn't mean I avoid inheritance, but I strictly limit it to things where it has immediate and obvious value. I may have one parent class, and the class isn't very big. It's also not something I'm likely to share in a public header; I'll inherit from it myself, and not ask others to do the same, which avoids a whole category of hurt. :)

comment 17y ago · link · parent

In addition to doing what I want, I appreciate APIs that make reasonable attempts at backward compatibility and clearly document their plans for changes (e.g. deprecation); this shows that the API providers respect their developers' investments.

I also like canonical/primitive APIs. Functions with side effects drive me crazy, especially if they're poorly documented and there is no other apparent way to achieve a goal.

A lesser consideration is how pretty the API is. While functionality comes first, I grow quickly frustrated with APIs that can't even be consistent within themselves (e.g. function doThis() and do_that() in the SAME CLASS), or APIs that are not really taking advantage of the conventions and capabilities of the language they're in (e.g. a C++ API that decides to write its own string class that does not add anything over the standard class).

comment 17y ago · link · parent

Use a revision control system, force yourself to commit only changes to one feature at a time. This restriction helps you to avoid wandering into other things, as it would take extra work to manage the unrelated changes.

"Release" frequently; if you don't have any customers, just pretend that you need to package something up. For instance, aim for a new build every day, and maintain release notes describing your changes. If you haven't been doing anything worthy of a new build each day, you quickly realize that you're losing focus and not moving the project forward.

comment 17y ago · link · parent

It won't change until a whole new generation of IT managers is promoted. I encounter far too many IT employees who are terrified of change and just want to have a job. And, I see almost complete trust in contracting companies and their "solutions". It will take someone who's grown up with better applications and hardware, to come in and say "WTF?" and wipe it all clean.

comment 17y ago · link · parent

I'm not sure how good an indicator the overall count is. For one thing, you might not even find everyone you know on Facebook.

I figure there are two ways to use these sites. One, you could connect with everyone you've ever known, regardless of how well you know them (and end up with 300 "friends", most of whom are really just "acquaintances"). Or two, judiciously invite the people you actually care about and/or are likely to see anytime soon. I choose the latter, whether it's Facebook or other sites like LinkedIn.

With a short list, it's easier to find the people you're likely to want to talk to in the near future. Plus, you then receive only limited spam about the mundane details of other people's lives. :)

comment 17y ago · link · parent

Heh, I like that article...the description of "i=j*5" in C++ should probably be on the first slide of any C++ programming class. :)

comment 17y ago · link · parent

...the algorithm helps Google “get inside people’s heads even before they know they might leave”...

Sounds like the department of pre-crime. :)

It's fascinating: enough Google employees want to leave, that Google is studying their behavior. Clearly, even amazing perks, challenging work and brilliant colleagues will wear thin on a person? Or maybe it's not that there's anything wrong with Google per se, but that people are regularly trying to branch out and start their own companies, etc. and no amount of pampering will change those ambitions.

comment 17y ago · link · parent

This is nice on some levels, and they document their goals well (basically, to have features in one language that would otherwise require several). But I think they should have started by investing in Python itself.

While they wouldn't have their desired features "today", they'd have been working with a much larger audience. This would have led to more contributions in terms of PEP comments and feasibility testing, and ultimately more programmers benefiting from the new features.

comment 17y ago · link · parent

That's just a random list of features, "I can get" anything too. What you need to do is link to some online stores where you've built machines with an exact set of features and prices (assuming that initial purchase price is the only consideration anyway, which it wouldn't be).

comment 17y ago · link · parent

Ironically, the article's rant on failure helped me to see a few new things I could do with W.A., which made me appreciate it more. :)

I think of Wolfram Alpha as "smarts in, smarts out"; if you want intelligent results from a smart engine, you need an intelligent query, or you see the digital equivalent of a blank stare. Requiring some thought when posing a query isn't necessarily a bad thing.

Wolfram Alpha also has a nice feedback form on the front page. Not that I'm holding my breath, but what the author of the article should do is put all his rants into that feedback form, wait a month, and then comment on any changes made. That type of followup article would be more interesting to me.

comment 17y ago · link · parent

I have used reStructuredText (which both "docutils" and "prest" can use to generate documents). The source text actually is the plain text "output", while it is still possible to automatically generate HTML, etc.

For something as complex as a book, reStructuredText is best; though I often fall back on the simple Textile format for really short documents that still need to be converted to HTML.

comment 17y ago · link · parent

Some of the things I use:

- DragThing; you will never miss Apple's Dock, this is an absolutely essential desktop enhancement, e.g. to create multiple tabbed docks anywhere you want, with themes.

- OmniWeb (now free); I've tried many web browsers, and I like this best. Safari engine.

- MacTelnet (tabbed terminal). It now works for local programs and not just servers, so I use it instead of Terminal.

- SnapzPro X (or alternatives), useful for doing more intelligent screenshots or video captures.

- DesktopCalendar (by Takashi Hamada), a really nice use of space and very configurable. Also has a menu option.

- Growl, for pretty and unobtrusive notification windows. This is actually really well supported by 3rd party applications.

- SCPlugin, if you're a Subversion user; nice Finder integration.

comment 17y ago · link · parent

Leaving the company to work on a competing product will sometimes violate any agreements you may have signed for this employer, so check those first.

Usually the barrier to doing a parallel rewrite is staffing. If the company barely has enough people now, sending people off on something else needs (in the management's view) a very good reason. So you have to show how time will be saved, at least medium-term.

Another potential barrier is testing. If your product has a lousy set of regression tests and unit tests, forget it; until more tests are written, a rewrite is far too risky. Basically, the test suite needs to prove what all the important current behaviors are, so that you can be very confident in replacing code.

Is there something wrong with the code base? Is it hard to maintain? You'll probably have more success proposing changes if this is true. For example, you can pull up the last 20 bugs/enhancements, and explain to your management exactly where all the time was spent on them; then show how your revised design would have made those changes more efficient. If you have access to the time it takes customers to do things, you could have similar analysis; show how awkward or clunky something currently is for them, and how much better it would be if it worked differently.

comment 17y ago · link · parent

Very well done article. One of the best sum up points: "A usable and secure password is then not a complex one. It is one that you can remember - a simple password using 3+ words." I've used that sometimes, and it works well; though I also happen to be someone who can memorize random strings of punctuation and gibberish, which I prefer. :)

comment 17y ago · link · parent

Seems to be summed up by 2(b) in the GPL:

    You must cause any work that you distribute or publish, that in
    whole or in part contains or is derived from the Program or any
    part thereof, to be licensed as a whole at no charge to all third
    parties under the terms of this License.
That suggests you need to GPL your application to use art from a GPL'd game.

comment 17y ago · link · parent

There are two problems with this approach.

One, the default implementation of the error handler is a crash at runtime to "detect" the buffer size difference. Or, a custom handler can be used.

Worst case, this handler is turned off, truncation is silent, and overflow occurs the next time the buffer is used. Best case, the handler detects a problem, requiring new code to find minimum buffer size (that should have been there anyway); at which point, it's perfectly safe to use...the standard memcpy()!!!

Two, Microsoft's compiler warning spam recommends replacing standard calls with its own. The warnings often make legitimate uses of memcpy() look wrong in some way.

I sure hope I'm missing something, but this seems like a big waste of time.

comment 17y ago · link · parent

http://searchyc.com/

comment 17y ago · link · parent

While I've certainly made use of typing random stuff into my web browser, the browser can't compete with a shell until it learns to display results as concisely.

Unix has get-results-and-get-out behavior. There's no "fluff"; some commands won't even display an error string, they just return error status. (This is pretty ideal, to me.)

If I must use a GUI, I find Apple's Spotlight closer to what I want, than a browser's location bar. For example: while I could ask Google to solve 2+2, I still have a web page wrapped around the result (that probably replaces whatever web page I was using); with Spotlight, the answer to 2+2 appears before I even hit Return, and when I hit Esc the entire query box disappears and I can resume what I was doing before. That is how a "super location bar" needs to work.

comment 17y ago · link · parent

I think I was 10, an Apple II+. It wasn't the first thing I used to program (I'd dabbled in LOGO and BASIC before), but it was a surprisingly complete computer. I used it to learn about a lot of different things, such as input from peripherals like a joystick, as well as memory management -- from that damnable "out of memory" error when my overzealous BASIC programs got too big. :)

comment 17y ago · link · parent

I prefer something executable (and therefore automatically verifiable).

I think English is most useful when used to express test cases. Such statements usually convey about the same information as pseudocode, but are a lot easier to follow.

Take one of the pseudocode examples from the article:

  set the default status to "fail"
  look up the message based on the error code
  if the error code is valid
    if doing interactive processing, display the error message interactively and declare success
    if doing command line processing, log the error message to the command line and declare success
  if the error code isn't valid, notify the user that an internal error has been detected
  return status information
All this really means is...

  for interactive and command line uses:
    produce the message for an error code, or raise an internal error
You can still infer a program from this, it's just that a lot of details are implied.

comment 17y ago · link · parent

Even if I try to see their point of view, there are some logical flaws here.

One, "_SRJC" could mean anything, and they can't claim a right to every imaginable use of the acronym.

Two, they seem to think that E-mail is a heck of a lot more secure than it is. They're worried that a sender's address could "look like" something from their University. The reality, apparently not known to them, is that an entire E-mail can be forged, up to the point of appearing to originate from one of their own "legitimate" addresses. So if true E-mail security is their problem, they should first consider not doing important things through E-mail, before filing lawsuits.

comment 17y ago · link · parent

The guy simply bought a lemon. It happens. It says absolutely nothing about the rest of the Mac line (as I've had several Macs). While I have had some frustrating experiences, they've been pretty rare; like 3 in over a decade.

When I did have serious Mac problems, it always ended up being the hardware; something easily replaced, like bad RAM. It says something when you learn to suspect hardware problems because the OS itself is so solid.

comment 17y ago · link · parent

No, I expect my scripts to run for a long time with many users. This doesn't preclude optimization; some of it is automatic (new hardware, interpreter library improvements), some of it is well established (using SWIG and C to replace only a tiny piece of the program that must be faster).

In some respects, having long-lived software with lots of users makes speed the least of my concerns, because they're always asking for new features, and those are relatively easy to add to scripts.

And the relationship between software speed and productivity isn't linear, because people multitask. If a program takes 10 seconds to run, I might sit and wait for it to complete, without doing anything else. Whereas, if the program takes a minute, I may decide to switch to another quick task, and then return to see results. In this case, both tasks needed to be done, one took longer but it ate up the "slow" runtime of the program, and was only parallelized because of that long runtime.

comment 17y ago · link · parent

Always remember that the total time between you having a problem, and you achieving results, includes the coding (and recoding) time, and the run time. There's a tendency for people to ignore "slow" languages because they focus only on the runtime.

I am well aware that there are good reasons to optimize things in languages like C (and I use them), but consider...

If I take several extra weeks to code, debug and test a C solution, and I could have had a script done much sooner, then my results were not faster overall. Why? Well, the script could be slow as dirt, but if it has a few extra weeks to churn through data and produce results, it may be done before the C program is even ready.

It's also important to remember that not all bugs are in software. Suppose I was looking at an entire problem in the wrong way, and this wasn't apparent until I started seeing results? In that case, my earlier start with a "slow" program meant that this mistake was found much sooner, so the script can be thrown out and redone, producing correct results with not much of a time penalty.

comment 17y ago · link · parent

This is a really useful article.

Though I've found it's easier to open folds by moving the cursor, e.g. right-arrow while on a fold line, than futzing with "zo".

comment 17y ago · link · parent

The best way to design an error message is to figure out why you need it in the first place, and eliminate that "need" (i.e. you don't display any message). If the proverbial house isn't burning down, the user doesn't need to know. Most messages can be non-modal, tucked away in a conspicuous spot but not immediately stopping whatever the user is doing. Even those can often close themselves, not requiring acknowledgment, ever.

Somewhere along the line, people forgot that computers are supposed to be tools, and decided it was okay to put up with constant interruptions to their work. I swear, using Windows is like raising a small, needy child.

comment 17y ago · link · parent

Its defaults might not handle it (I don't use "screen", I'm not sure). But there are lots of things you can change; something like line wrap would probably affect a status bar.
1
888990
98