HNHacker News
TopNewBestAskShowJobs

Rust

281 karma · joined March 13, 2010

Starting up, what else :)

http://www.hackernewsers.com/users/Rust.html

submissionscomments
Rust··on A plea for a simple webhost
I wonder if GitHub Pages behind a CNAME record would work...
Rust··on Ask HN: How many years of programming experience do you have?
Started with Applesoft BASIC and IntegerBASIC about 28 years ago personally, started getting paid professionally 21 years ago.
Rust··on Ask HN : An open source News.YCombinator-like
You could look at Noostr (http://noostr.com/). It's been stalled for a while now, but will eventually see a 1.0 release :)

Big missing feature is paging...

Edit: It's a PHP app that uses MySQL.

Rust··on PHP, Perl, Haskell?
PHP is easy to learn and the documentation is extensive. But it is very easy to do things wrong in PHP, mostly because people learning PHP do a lot of copy/paste coding without really understanding the domain they're coding for (in this case, a web browser over the internet).

There are a lot of sites that give information on working with PHP correctly (including http://appwithphp.com/ and http://planet-php.net/), but expect to do a lot of reading and experimenting before getting it right.

I personally didn't care much for Perl as a web language, although it's great for system-level scripting.

I'd add Python to your list of potential languages too. I've been having a lot of fun with it lately :)

Rust··on Ask HN: Business tax software for Mac?
PostBooks (http://www.xtuple.org/) is a fairly capable replacement for Quickbooks on OSX (and Win/*NIX), and has both OSS and Commercial versions.

GnuCash (http://www.gnucash.org/) is another I've used in the past and had good results with. It's more of a Quicken replacement than QuickBooks though.

Rust··on 3 caculators = 3 different answers to one math problem
Update: after reading the article at http://www.matthewcompher.com/posts/trouble-with-semantics-t... , the writer used the ÷ as a line operator, not a natural division operation.

I would maintain that since this is not taught in any school I've ever attended, it is at least questionable. I've never seen a math textbook use the / symbol for natural division either.

Rust··on 3 caculators = 3 different answers to one math problem
I might be remembering incorrectly, but 2x and 2(x) are totally different things in algebra.

2x would be expanded as (2 * x), whereas 2(x) expands as 2 * x.

In this case, since the equation is 2(1+2) which results in 2(3), it's final DMAS form is 6 ÷ 2 * 3 = 9, instead of 6 ÷ ( 2 * 3 ) = 1

Rust··on 3 caculators = 3 different answers to one math problem
I enjoyed the bit at the end where the writer managed to use the wrong (IMO) formula to arrive at the correct answer.

Using BEDMAS as I was taught, so many moons ago:

6 ÷ 2 ( 1 + 2 )

6 ÷ 2 ( 3 )

6 ÷ 2 * 3 // because 2(3) is not an exponent or algebraic construct, it's straight multiplication

3 * 3 // division and multiplication are in left-to-right order, no precedence

9

Rust··on Ask HN: Any recommendations for good, free / open source JS graphing libraries?
I admit their licensing is stupid - why would I pay based on the number of developers I have working on my application?? It would make more sense to pay per-domain or per-site it's actually being deployed on.

That said, no, the price is too high for sure.

Rust··on Ask HN: Any recommendations for good, free / open source JS graphing libraries?
Highcharts (http://www.highcharts.com/) is pretty darn good.
Rust··on Superior jQuery plugin template
Just wanted to let you know I used your boilerplate for my first jQuery plugin recently - https://github.com/indyarmy/jQuery.awesomeCloud.plugin/

Thanks a lot, it saved me a pile o'trouble :)

Rust··on JQuery.awesomeCloud Word Cloud Plugin
Direct to demo page: http://indyarmy.com/awesomeCloud/
Rust··on Free copy of Guy Kawasaki's What the Plus
Does the action call really say "while supplies last" when referencing a downloadable PDF file??
Rust··on Ask HN: Why PHP over Java?
It should be noted that the Java dev obviously over-designed the system, and that a different dev may have delivered something much more "keepable".

However, my experience over the last 20 years has shown me that this is pretty much the way of things - expert Java devs love making things complex by layering more complexity over things in order to make them simpler. Expert PHP devs tend to remove complexity and turn in far more intelligently organized code.

I've seen exceptions to both generalizations, but not very damn many. It's depressing.

Rust··on Ask HN: Why PHP over Java?
I am both a PHP and Java dev, and have found that PHP is far faster, leaner and more maintainable for websites than Java is.

The last hard-core (ie. expensive) Java dev we had working on one of our back-end projects turned in code that was so abstracted and made such heavy use of dependency injection, it was not only difficult to read through, but took over 30ms to respond to requests. Maintainability was a nightmare, mainly because by abstracting things so thoroughly he effectively (and inadvertently) made the platform so tightly coupled that changing low-level code became very difficult.

Our current hard-core (ie. affordable) PHP dev spent almost exactly the same number of hours re-implementing the Java system, retained the extensibility requirements, and the framework returns responses in about 1ms. We have extendable objects for everything (models, controller, extensions, etc.), but without the 5 to 10 layers of abstraction.

As an added benefit, with PHP we don't have to worry about recompiling every time a change is made (during development, at least), we aren't running any memory-hog VMs, and it's far easier to find good devs when we need them.

That said, PHP takes a lot of crap because of its low barriers to entry. It's easy to learn the basics, it's very easy to learn bad habits, and it's too easy to write insecure code. A good PHP dev knows how to write fast, secure code, but it is hard to figure out who is a "good" PHP dev and who is a "copy/paste" PHP dev.

Rust··on Show HN: 2 guys -- Learned to code in 3 months and built this
Clickers!

http://knowitapp.com/

http://knowitapp.com/jeff

http://knowitapp.com/nash

http://knowitapp.com/invite/hn

Rust··on Ask HN: PHP/MySQL Data Encryption
Check out http://appwithphp.com/cryptography-and-php/ - it's a beginner/intermediate overview of how to implement one-way and two-way hashing/encryption in PHP. The concepts should be transferable to other languages though.
Rust··on To www or not to www?
Personally, I either code so the site doesn't care if "www" is there or not (watch your cookie domain though) or force a redirect to the non-"www" address (particularly when I don't want to purchase 2 SSL certs for a domain).

A couple of years a go I would have said to keep the "www" - it's a subdomain that refers specifically to the World Wide Web (or HTTP) address of a site, as opposed to the FTP or email services.

Nowadays, I prefer to either drop or ignore the "www" - if you're using an HTTP client to reach my domain, I'm going to go ahead and assume you want the website and not the FTP site. Intelligently named subdomains are good for organization :)

So either make both work, or redirect one to the other. It really doesn't matter very much either way.

Rust··on Tabs versus Spaces
That's just throwing complexity (IDE or SCM has to support that functionality) at a problem that doesn't need to be there in the first place (just use tabs instead of spaces).

Even so, I would still need to tell my editor how many spaces to convert to a single tab, and use the same number to convert tabs to spaces when I save or commit. God help us all if someone else forgets to do that too...

Rust··on Tabs versus Spaces
Always, always with the tabs, never spaces.

The main reason is that on my widescreen monitor, indents of 4 characters or less are hard to visually parse in dense areas of code.

If the original author of this code (the actual code I am setting fire to myself over right now) had used tabs instead, then I could set my editor to display indents as 8 or 12 spaces instead, and he can still use 2 spaces if he wants. This is strictly a display issue - he can use 2 and I can use 8, and the file is not different between our two computers.

With spaces, I'm stuck with whatever number of spaces he chose to use for indentation instead of being able to make the code easy to read on my machine.

We're not using 40-column terminals anymore folks. It's all right to uses tabs for indentation.

Rust··on Ask HN: What's your 'go to' tech analogy?
Cars, sex and music, depending on the audience.

After that, I explain the idea.

Edit: (to clarify) Cars, like you said, because a certain amount of car knowledge is already in the popular mob-brain. It's fairly easy to describe your web server, load balancer and scripting language as either car or engine parts.

Sex is useful when describing 3rd party API interfaces, particularly Facebook. This one can get pretty damn funny when the API is either poorly designed or unreliable. Also if you need to do weird things to make it work.

Music is good for the high-level stuff. Associating the front-end with the vocals, business tier with the guitars, database with the (wait for it) bass, and the server as the drums. There are bands with two or more of any of those roles (and keyboardists, and cow bell hitters, etc.), so this analogy tends to hold up very well as long as you avoid the details.

Rust··on Why there are no good mtg free apps for Android?
Ironically, I just spent a bunch of time this weekend looking for MtG apps for Android. I installed and tried M:tG Tracker (only used it as a life tracker so far, but it worked well) and couldn't find anything else useful.

I wonder how much trouble it would be to build something like Decked Builder (OSX) for Android tablets?

Rust··on Is this a good way to scale our product?
Hehe - to actually answer the question, though, the method you are describing might work with enough good planning behind it. Unfortunately, it doesn't sound like your lead dev is willing to do that. You will probably find that the amount of work required to fix the existing system is within a stone's throw of the work required to rewrite it.

I wouldn't call your described plan a "good" way of doing things, necessarily.

Rust··on Is this a good way to scale our product?
Wow, sounds like my workplace - pretty much the same story, except the two devs who wrote the 300,000 line monstrosity are already gone (worst page record: a page with one topic and 300 comments generates over 10,000 - yes, ten thousand - calls to MySQL, AFTER caching).

In our case, we're squeezing in a complete rewrite of the codebase around existing client work using the old platform. We're writing it as a few separate services (authorization service, content service, front-end, reporting service, and administration front-end) instead of a huge, monolithic app. To do this in a decent time frame (a few months), we're adding 5 or 6 contractors to a 3-person dev team, leaving 3 other devs able to deal with the existing platform.

Rust··on Ask HN: Do we still need FLV?
FLV is a holdover from a less civilized time.

The new regime requests the following in at least 3 different bandwidths (mobile, standard, HD) each:

* MP4 (h.264 Main Profile w/AAC audio) * OGG (Theora with Vorbis or MP3 audio) * WEBM (WebM with Vorbis audio)

This is from memory, so I could be mistaken about the specific codecs used for those last two, but those three file types combined with a player (or JS library) that detects bandwidth capabilities should let you play a video back on virtually any modern device (ie. most phones, tablets and browsers), and fall back to Flash using MP4 for browsers without HTML5 video element support.

I've used VideoJS and JWPlayer in the past (and recently!) with great success. There is no need for an FLV version of the video unless you expect your users to be using Flash before version 9 (or was it 8?).

Rust··on I have an idea for an iPad app...constructive criticism needed
I'd be happy to give an opinion or two! russ at indyarmy dot com
Rust··on Am I a douchebag micromanager?
#1 - ALWAYS encrypt passwords, no exceptions. Implementing SHA1 salted hashes is trivial.

#2 - Dates should be stored in UTC (make sure the server has the timezone correctly set), and display in the user's TZ or a reasonable default. The language will worry about DST. Don't let SQL touch it (in fact, you should probably store a UNIX timestamp - uint - instead of a datetime).

I would argue the above as "best practice" for storing that info. The douchebag is the developer who won't spend 5 minutes implementing either solution.

Rust··on Gandi.net will contribute $1 per inbound transfer to EFF until Jan 15th
Ahhhh, I just transferred three domains there a couple of days ago! Sorry EFF! If I'd known they were going to do this, I'd have waited.

Guess I'll just have to donate directly...

Rust··on Ask HN: How Can I Create an RNG Without a Seed? In LOLCode?
Clickers:

http://lolcode.com/specs/1.2

http://icanhaslolcode.org/

Rust··on Ask HN: Why web apps are not packaged as daemons?
Web apps generally need to be accessible on port 80, and only a single service can claim an IP address and port combination. If web apps were distributed as services, each one would need to run on a unique IP/port combination. In order for outside users to access those apps through the default HTTP or HTTPS ports (80 and 443, respectively), you would still need to be running at least a reverse proxy server that could remap incoming traffic to the correct internal port. On top of that, your web app would have to include an FPM or UWSGI service, increasing the size of the distributed binary.

Frankly, it's much easier just to leave that aspect of things to the server admin, and distribute your web app as a PHAR or Egg or Gem or whatever.

← PreviousPage 2 of 6Next →