Better HN
topnewbestaskshowjobs
Log inSign up

makecheck

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

Submissions

comment 14y ago · link · parent

If you can't think of your users, think of your code then.

There's probably lots of CSS that has old -webkit/-moz/whatever tags because it "still works" and there hasn't been time to maintain it properly. A tool like this would make the code smaller, clearer and more future-proof without affecting any of your favorite users. It would just so happen to help fringe-browser users as well. I'd say that's a win-win, especially if you value attracting new customers and making money.

Right now, if I reach a web site that browser-sniffs or doesn't "support" me I go away and never come back. Generally not a useful way to treat visitors.

comment 14y ago · link · parent

In a world that has platforms other than the PC, there is no reason to assume browsers available on PC platforms are the only ones that matter.

Opera Mini works very well on mobile phones for example.

You're also on a web site with a lot of people working at startups: pretty much the epitome of not accepting the status quo and creating new things. If we all said "screw it" when big projects took over, the world would be a lot less interesting.

comment 14y ago · link · parent

If laziness got browsers into the vendor prefix mess, laziness could get them out; the way to do that is to build good developer tools.

For example, a tool could scan CSS files and compare usage of vendor prefixes against the current state of cross-browser support for "better" alternatives. Perhaps you see warnings like "property 'webkit-xyz' can be replaced by 'xyz', which has been supported by the top 4 browsers since 2006".

comment 14y ago · link · parent

Enumerations or other constants are helpful but generally only if the type has any other use besides a single function call (e.g. is it a type that you'd want to store as a field in a structure somewhere, or would it be useful in 2 or 3 other routines?). They should also be absolutely unique types (using whatever scheme in the language would guarantee that) to avoid bugs.

An approach that is usually better is to rename the entire function, creating two functions. To extend the article's example, this would mean having both "widget->repaintImmediately()" and "widget->repaintLater()" (or whatever). This can even be implemented by having both of the public routines call a single internal routine that is still parameterized.

When the function names are different, everything you need is in one place; you don't have to waste time figuring out where the corresponding list of allowed values is defined. Unique functions may also require less error-handling if only some values are allowed; e.g. if the type would include "A, B, C" and a parameterized function wouldn't accept "C", it's easier to define only funcA() and funcB() and just not have funcC(). Conversely, if you some day realize you actually have more cases than you originally thought, adding a funcD() is trivial and that decision doesn't affect anything else.

An example of constant-parameter bugs: it's common to see someone define several unrelated values that are effectively all "const int" or strings, which allows values to be misused without warning (especially if they're named similarly). In Cocoa, NSFontAttributeName and NSFontNameAttribute have the same type but different uses; while this isn't a true/false case it shows how easy it is for something to be wrong and how important a unique type can be for debugging.

comment 14y ago · link · parent

The "do not track" concept relies on 3rd party decency and you don't have to look much further than the spam in your Inbox to see how well that works. A do-not-track request is like saying "please don't take my lunch money"; that request would be honored by almost everyone but do you think it would change what a bully does? If you put something valuable in your front yard with a sign that says "property of Joe Smith", sure it might stay there a few hours...but eventually someone will come along and take your property anyway.

In the real world you might be able to find witnesses and involve the police to deal with a theft. On the Internet there's nobody to report a "do not track" violation to and no reliable way to punish anyone who simply ignores what you say. The 3rd party doing the tracking can be anyone in the world.

comment 14y ago · link · parent

I downgraded (and therefore "upgraded") back to Skype 2.8.0.866 on the Mac a long time ago. That version actually has a sensible UI compared to Skype 5.

If you search for "Skype 2.8.0.866" you'll find sites that host the original version.

comment 14y ago · link · parent

This isn't just in mobile apps, it happens on the desktop too; and it's a tricky problem. In general one has to blow up the size of an app to preserve a good user experience in other areas.

Consider download complexity. How many "versions" of your app would you need to have to give each user the optimal installation size? How often do you want to deal with people downloading the wrong one and having a bad experience? What about 3rd party distribution...any number of other sites may choose to offer download links and you have basically no control if they screw something up.

Another is problematic upgrades. Suppose you optimize a download for a user's current machine. Then they buy a new machine. They won't really try to understand why your app is now looking strange or misbehaving; they'll just think your app sucks.

On the Mac side I've chosen to go the oversized route. There's no doubt that my app bundle is 2-3 times as big as it ought to be (and unfortunately two thirds of the binary bloat goes towards supporting systems that few users are likely to care about at this point). But then downloads are simple: just "click here for the new version" and whatever your system you see something that works.

comment 14y ago · link · parent

Generally a useful thing to suggest, though it has some holes.

The proposal to give selectors namespace awareness seems to be overlooking a pretty fundamental truth about selectors: they don't have context, they don't even belong to a particular class. There is therefore no ambiguity to be resolved; the selector "performAction:withArg:" is already isolated. Now, if you were to call something like "respondsToSelector:@selector(performAction:withArg:)" then you need a particular class or instance but again this should be clear from the context: in a new namespace-supporting Objective-C the object that you call this on should be clear and the selector expression itself should need no namespace at all.

This namespace style may also be clinging a bit too much to the C++ approach. In particular the tendency to double-@end everything due to the namespace suggests a cleaner syntax is needed. Oddly this isn't consistent as sometimes "MyNS.MyClass" is used and in other cases @namespace/@end is used.

comment 14y ago · link · parent

The HTML/CSS that's generated by Docutils is very basic; you'd want to customize it (which is fairly straightforward) to have a more interesting layout or custom fonts, etc.

An example of RST-generated HTML is Docutils' own documentation: http://docutils.sourceforge.net/README.html

Original source markup (also a suitable plain-text version): http://docutils.sourceforge.net/README.txt

Unfortunately I don't see a good example of PDF output online, but it basically generates LaTeX and PDF from that.

The nice thing is having the flexibility to produce all these formats with one edit.

comment 14y ago · link · parent

Most languages and file formats don't enforce an inherently "undiffable" layout, so it's really an issue of programming style. People tend to lazily do what's easiest to write instead of thinking about what will be easiest to read later (in "diff" or otherwise).

A common example I see is something like a one-line list of files to build in a makefile. It is certainly possible to put every file on its own line and backslash-escape each line ending, and doing so produces a very readable "diff": if someone adds a file you see "+ xyz.c" (or whatever) and that's it instead of a mangled mess of file lists repeated with one word that's different.

comment 14y ago · link · parent

I definitely agree with doing formatting/nonfunctional changes independently from other changes. In general all commits should be as focused as possible: have one purpose, don't just change whatever else you happened to think of while editing the same file.

A "diff" is also incredibly useful prior to a commit to make sure that you changed only what you thought you did. Programmers should go to great lengths to adopt a style that is "diff compatible" so they aren't likely to miss anything important.

comment 14y ago · link · parent

Have you looked at docutils?

A few years ago I rewrote my résumé in reStructuredText where you can use rst2html.py, rst2latex.py, etc. to generate various formats from one text source. And the source file is so free of obvious markup that it serves as a "plain text" version.

comment 14y ago · link · parent

What's interesting is how different their Mac product division's site is:

http://www.microsoft.com/mac/outlook

If only that group could share more of its expertise with the rest of the company. :)

comment 14y ago · link · parent

Thanks for pointing it out. I wish they used that in their "hello, world" example because 'println("hello, world")' leaves a much better first impression of simplicity.

I generally like to see things kept simple. But formatting is a common need and they've actually made things less simple by providing both fmt.Println() and println(). It means the same program will inevitably contain both, depending on who did the editing. There are times when a feature is so basic that it really should have exactly one way to do it, and I think printing is in that category.

comment 14y ago · link · parent

I had an Android phone for roughly a year, after having a not-smart flip-phone for about 7 years! And even though I found real value in my old phone for 7 years, I tossed the Android for an iPhone 4S almost as soon as the new iPhone came out.

When I first bought the Android phone (HTC Hero) I thought it was amazing. It really had some neat features, and there were things the iPhone couldn't do (like totally change the home screen manager).

But it was never updated. Not once. It took just months to start seeing apps in the Android Market that only worked with newer OS versions.

I'd also discovered battery issues; it was abundantly clear that the carrier, Sprint, had the phone pre-loaded with apps (in the ROM so they could not be removed). Not only did ALL of these stupid things auto-start when the phone was powered on, but they were apparently set up to start themselves every hour or so because even with an app-killer I'd still see this junk back in memory sooner or later.

Say what you will about Apple, but they keep the crap off your phone. Carriers can't put a damn thing on there that you don't want. I've also already received 2 OS updates from Apple, which is 2 more updates than I ever received with Android.

I also realized that even though Apple doesn't let you customize as much, their UI is also not broken the way Android's is. For instance, some of the default HTC Sense UI did really stupid things in my opinion. Sure I was able to "fix" problems by downloading replacement keyboards, etc. but with iOS I don't even feel the need for that because Apple's UI is by default more sensible.

comment 14y ago · link · parent

I'm disappointed that after starting from scratch they created a "modern" language that requires a module import just to print (and corresponding extra syntax for that namespace when making the call).

How could this not have seemed incredibly clunky after using it for just a little while? It's the same frustration one feels when simple print-outs fail in C++ because you forgot to "#include <iostream>". Sometimes you just want to print stuff no matter what file you're in. Languages should make it almost impossible to fail at extremely common tasks. It's these little things that make Python and Perl enjoyable to program in, and these little things that every new language should begin with!

comment 14y ago · link · parent

What bugs me is that they chose a character right next to "Return" on the keyboard. For some reason no PC keyboard has moved it.

I've had embarrassing MS-DOS moments in the past where I was typing out something like a recursive-delete on a path. If you accidentally hit RETURN instead of a backslash then you can do things like blow away entire parent directories unintentionally. This didn't exactly improve my already-critical view of PCs. :)

comment 14y ago · link · parent

It is never as simple as throwing it over the wall. It's one thing to make code available for review, and another to release a package that recreates a functional product.

Companies may have elaborate infrastructures and sets of dependencies, and it may take a lot of time to come up with something that even builds correctly in isolation.

Open-source basically has to be planned early on: use freely-available tools, use common platforms, etc. and then open-sourcing it later may not be too difficult.

comment 14y ago · link · parent

Something about that start screen feels like you're watching every TV in the TV store at the same time, with about the same inability to focus. Also seems ripe for abuse by 3rd parties, but we'll see.

comment 14y ago · link · parent

Less than 1% of their profit this quarter, and even less than that when spread over the ~4 years they've been in the phone business. Sounds like a relatively small investment if it helps them to keep a competitive edge.

1881.

SOPA Blackout UI Option for NFS-Hosted Sites(blog.nearlyfreespeech.net ↗)

1 points · by makecheck · 14y ago · 1 comment

comment 14y ago · link · parent

I can see how this works but it still looks unmaintainable.

I avoid all goto, continue, early-return and similar statements though successive nesting. This solves problems:

- Code quickly shows when it has become too complex and needs to be split up.

- Code is naturally arranged in a way that makes it easier to split into functions.

- Code is naturally arranged to clean up a resource only if it has been allocated (no extra labels) and as soon as it is no longer needed.

comment 14y ago · link · parent

Got ahead of myself. :) Thanks.

comment 14y ago · link · parent

Well, they publicly released file system plans for Longhorn back in the day too, and it went nowhere.

I regularly take about a tablespoon of salt with any "plans" I hear from Microsoft.

comment 14y ago · link · parent

Customers should not see walls or spam. Intentions are irrelevant if the outcome annoys people.

What part of the verb "Like" would make the customer think "oh please make me part of a conversation"? I would go as far as to say it is obvious they wouldn't expect that outcome.

If you put any roadblock at all between your customer and the acquisition of your product, you will lose some customers. And you will never know how many because they will silently think "to hell with that" and never return.

If you subsequently spam customers with updates, they will start regretting the purchase and make a mental note to never buy from you again. Once I bought a pair of sunglasses and began receiving spams once a week from the store (seriously, how often could I possibly be interested in sunglasses, especially since I just bought a pair?).

It may be a hard pill to swallow, but there is no reason for a customer to give a damn about a company on a regular basis unless it's a product that can be consumed really often (like maybe going to a restaurant every few weeks). If it's something that people may buy only every few years, they don't care about you and they don't want to hear from you.

Facebook pages and other sites already have ways to request updates, e.g. the "Get Updates via RSS" link. Unlike abuse of "Like", the updates link is clearly labeled and it does tell the user what will happen when it's clicked. It is also correctly off to the side where it's available for those who need it and not in the way for those who don't.

comment 14y ago · link · parent

The terminology in the article is a bit confusing but if "backgrounded" is intended to mean "apps that are hidden by the Hide command", there is a way to represent that with a hidden preference:

  defaults write com.apple.dock showhidden -bool true
  killall Dock
When an application has been hidden its Dock icon is then given a semi-transparent, faded appearance.

Also, although Mac OS X Lion changed the Dock so that by default there is no difference between running and not running, using System Preferences (Dock pane) the "Show indicator lights for open applications" setting can be turned back on.

comment 14y ago · link · parent

That's not necessarily an open and shut case. People have their reasons for being unable to upgrade software; while the developer can certainly start by pointing out the new version, it is sometimes reasonable to resolve the issue by releasing a patch of an older version.

comment 14y ago · link · parent

"Like-gating" is a behavior that I find pathetic; it dilutes what little value there might have been to tracking "likes" to begin with.

If you actually care how valuable your brand is, you won't give anyone a damned thing for "liking" you and you won't make it a condition of doing anything else. What good is a disingenuous opinion about your brand? You should only want a "like" if someone gave it to you without being asked.

comment 14y ago · link · parent

If the bugs are new it shouldn't matter how quickly they are filed.

Do be sure to search existing bugs before adding more however. A unique bug report is helpful but a duplicate can be a nuisance. Sometimes the duplicate will be a closed bug too, e.g, "we found this and decided not to fix it for the following reason:".

comment 14y ago · link · parent

While the working hours are ridiculous, a couple things to keep perspective:

- It's sensational to focus on an absolute value of 70 cents while ignoring the buying power of 70 cents in China. This still isn't a very good wage, but the cost of living differences are huge; 70 cents should probably be likened to the minimum wage in the U.S. (i.e. think "equivalent to a few dollars an hour" not "pennies" as the article might have you believe). You can Google several cost-of-living comparisons between China and the U.S.

- A huge number of tech companies rely on Foxconn; this is not unique to iPhones nor is it new. So mention of the iPhone is, again, sensational; this manufacturing issue is pervasive.

1
626364
98