Better HN
topnewbestaskshowjobs
Log inSign up

dustingetz

7,912 karma · joined Sep 11, 2009 (17y ago) · 3,625 submissions

Founder Electric Clojure https://github.com/hyperfiddle/electric

https://twitter.com/dustingetz

Submissions

comment 14y ago · link · parent

here is some code i wrote last week: https://gist.github.com/3758511

it was a method i extracted from some old code somewhere else while i fixed a bug in it. the functional programmer in me sees opportunities to generalize (and prevent future bugs here), so i try to refactor it into a defaultdict and a higher order function, using guava. 20 minutes later I still don't have working code, i revert, curse the gods because this is a 30 second refactor even in python let alone clojure, and move on, i don't have time for this shit.

its not about it looking different. it doesn't matter that closures and objects are turing equivalent. its a syntax problem.writing functional java code has too much friction and is not worth it.

this is not even getting into how any hardcore functional code needs persistent data structures to be fast, which means a) you need to write your code against a 3rd party collections library instead of JDK provided implementations, and b) any interop with 3rd party code will now imply a conversion (copy) at the boundary.

comment 14y ago · link · parent

> "it's not java's fault" (from multiple comments)

languages have opinions. Java is designed around the principle of "everything should be a class" which makes everyone's first instinct to have lots of mutable instances with lots of mutable member variables. Turns out this leads to shitty code in the large.

Compare to Clojure, which supports mostly all the same features as Java, but emphasizes them differently. You can use mutable data, but by default everything is immutable. You can have methods and instances, but its easier to just use a function. Java can do higher order functions and closures, but they're so verbose that its better to choose imperative for/while loops over map/reduce/filter, which don't even come in the standard library. Clojure is designed to make higher order functions and expression-oriented thinking idiomatic, java makes this so difficult as to be not worth pursuing even with a team who already understands how to think this way.

Java's design leads people towards code that you're afraid to touch for fear of disturbing state somewhere else which causes failures unrelated to your change. That's why when you need to fix a bug, in Java, people will expose a hook here and there to make a minimum change that they are sure doesn't break code somewhere else. A decade of changes designed to expose little hooks to not break existing code, you end up with a AbstractSingletonProxyFactoryBean with intercepters and proxies and loaders. Nobody is claiming that AbstractSingletonProxyFactoryBean is an abstraction. It came into existence over time because it was the easiest way to fix bugs and adapt to changing requirements while not breaking existing code.

It's definitely java's fault, and all the best language designers know it.

PS Here's a paper that describes a team who migrated a bunch of excel macros to Java, found that they had built an unmaintainable mess, then took the same team and built it in OCaml, and have been using OCaml ever since. http://queue.acm.org/detail.cfm?id=2038036 - OCaml for the masses, Yaron Minsky, Jane Street

comment 14y ago · link · parent

> The project will be cancelled before the bug is fixed.

it most certainly won't be cancelled, despite multiple farked edge cases, if the critical path is providing business value. the customer increases revenues, the software company turns a profit, the managers and developers get nice bonuses to give their children a nice education, our 401k's get stable returns, the world gets buggy software but not THAT buggy, and everyone is happy except for a few cranky developers who get paid a lot of money to maintain shitty software from 9-5 inbetween disney world trips and cruises.

comment 14y ago · link · parent

wow readability is about API design like requests vs urllib2: https://gist.github.com/973705

except when APIs get 100x bigger, API design becomes 100x more important. and using a language ecosystem that encourages good API design, over a language that is cobbled together and has no particular opinions about what good API design looks like[1] (or, even, bad opinions[2]), so that less experienced developers end up with decent output, is that much more important than concerns like parens, commas and braces. curly braces never made a project fail. shitty API design does.

[1] javascript! [2] java!

sheesh. there are bad things about coffeescript, but this stuff hardly matters.

comment 14y ago · link · parent

Am I the only one who read your post and said "huh"? Don't mean to have a naive reply, but this is new to me.

comment 14y ago · link · parent

the question that should motivate a change like this:

what does new-language let your team accomplish that you can't accomplish with old-language?

question isn't answered in post, the answer is probably somewhere along a 2x increase in the complexity the same team can handle. i dunno if it is worth disturbing an existing codebase and the QA cost of making sure you didn't introduce any defects. meh. where i work, we have maybe 100k lines of javascript, and its not really a problem other than lack of types when refactoring imperative code, nothing near the scope of the problem of Java's lack of higher order functions.

comment 14y ago · link · parent

What? I'm about to buy, what problem are you speaking of?

comment 14y ago · link · parent

there are really smart people in the camp of long variable names, and there are really smart people in the camp of terse variable names. both sets are optimizing towards whatever subjective definition of "good code" they have, where, again, their definition is informed and intelligent even if it differs.

if someone really smart says they use terse variable names, you don't tell them they're wrong, you try to understand them. There exist styles of writing high quality code that don't need naming style like `someone_else_just_finished_writing?`. there are styles that use it. if you're only accustomed to the long way, you'd be well served to go join a successful team that uses the short way, instead of blindly saying that they're wrong. some of the clearest code i've ever seen was Haskell, for which i think most people find you don't need long names.

me, when i find myself needing long names, i try to refactor until i don't need them any more. its not always possible given time constraints, backwards compat, trying not to change fragile code etc, but i mostly chalk that up to a personal or team failing.

comment 14y ago · link · parent

due to the massive information asymmetry, didn't FB have a legal and moral obligation to provide an accurate valuation? this was my understanding from reading all the post-IPO anti-facebook fallout articles.

comment 14y ago · link · parent

has anyone played words with friends? all the cool kids log in with facebook. that way you can send game requests to girls and stuff.

people login with facebook when they want the experience to be social.

comment 14y ago · link · parent

its a market. all the gyms in the market use slimey tactics. you can start your own gym if you like. good luck competing though. TLDR: don't ever start a business that competes on price.

comment 14y ago · link · parent

i miss the days when a reporter's job was to report.

comment 14y ago · link · parent

its not reasonable to draw conclusions from the parent without comparing to the cost of archiving and retrieving 3TB on other services.

comment 14y ago · link · parent

sheesh, if you want get better, ditch the books and put the time into learning haskell or something.

comment 14y ago · link · parent

how do i copy the traces into a gist? i can't figure out how to turn off the built in pager widget which is just getting in my way

comment 14y ago · link · parent

can someone just post the code?

comment 14y ago · link · parent

maybe the new kids don't know any better? can we crowd-educate them as to acceptable comments? stackoverflow has used strict categorization of "reasons for flagging post" to great success in influencing how the crowd moderates.

  "-1, poor tone"
  "-1, offtopic"
  "-1, factually incorrect"

comment 14y ago · link · parent

> This is why we rotate logs, archive them and trash them eventually.

i think an organization trashes old logs for out-of-band reasons - acquiring more disk space requires following an organization's procurement process which imposes tons of friction, or because compliance with applicable regulations requires saving, e.g., emails, for three months and saving them for longer is a legal risk.

comment 14y ago · link · parent

> No real world code is simple and elegant enough that you don't need to think through the complex invariants of the code

in my experience working on enterprise biz apps the opposite is true. comments are what you do when you don't have time to make the code explicitly match your mental model of the proper solution. "don't have time" is a bit of a euphemism, as a lot of people don't realize that it is possible to write code that explicitly matches our mental model of the solution, but whatever.

here's an example: python lib requests vs urllib2. one of these could probably use a comment. the other is self evident. https://gist.github.com/973705

comment 14y ago · link · parent

posts like this do not even begin to cover the intricacies and scale of large development projects with make-it-or-break-it business timelines. we're not all building apps.

2961.

Performance enhancing drugs in the workplace(martinsnyder.net ↗)

2 points · by dustingetz · 14y ago · discuss

2962.

Curiosity was built with 2.5 million lines of C(programmers.stackexchange.com ↗)

102 points · by dustingetz · 14y ago · 33 comments

comment 14y ago · link · parent

when i was seeking i cold emailed maybe a dozen startups at various stages over a couple months, almost all of them responded. My typical cover letter is about 3 sentences mentioning functional programming, link to a simple github sample, and link to a recent technical blog post.

that said, intuitively you will get better offers when you are being recruited, which means establishing a history of interacting with them, participating in meetups, anything you can do to reduce their perception of hiring risk.

obviously, once you decide where you want to work, you obsess over nailing every piece of communication because your offer directly reflects their perception of you, but this is self-evident.

comment 14y ago · link · parent

Standard practice in Manhattan and Philadelphia at most office high-end office buildings. this is the world Americans live in. Yelp isn't in the business of protecting civil liberties.

edit: standard practice to deny entry to non-badged persons who aren't on a pre-submited event guestlist. i've seen this, for example, at every tech meetup held in a downtown office building i've ever been to in Manhattan and Philadelphia.

edit2: i've never actually challenged this, but i've been told that i would be denied entry if name not on list.

comment 14y ago · link · parent

EI is when you take existing large systems and you make them work together, and its really hard because the systems aren't designed to work together, and made harder because bigco internal teams aren't exactly known for the quality of their infrastructure.

Relevance is one famous company that staffs world-class engineers and does EI[0]. They also write databases[1]. and languages[2].

[0] http://thinkrelevance.com/clients [1] http://www.datomic.com/ [2] Clojure

comment 14y ago · link · parent

(parent again) even though my comment seems popular by votes if not comments, i wish i had checked my tone more carefully, i blasted it off from my phone from a restaurant. i'm just reflecting that there's just an awful lot of startups--perhaps with an interesting business challenge but straightforward technically--who talk about how they only hire A players and how difficult it is to hire, when really they need a competent ios or rails guy, and the contracting market is swimming with them, and they're making a ton more money contracting than the type of startups i'm familiar with wants to pay. the devs who know lisp and haskell aren't building apps, they're architecting enterprise integration contracts or building databases.

*i don't have a relationship with hayzap and i've never worked for a CMS company.

comment 14y ago · link · parent

The people who matter aren't going to comment on this, but I'm out celebrating, so what the hell. I was actively looking for a job until about 6 hours ago. I read lambda calculus papers for fun. Hayzap, and the class of companies hayzap belongs to, is not even on our radar. Hayzap does not have hard problems and does not need a team who can ace this interview, and those of us who can ace this interview are uniterested in you. We don't want to take your worthless equity and we don't want to take a 50% pay cut for the privilege of working for your startup.

comment 14y ago · link · parent

> Finally it is clear that Apple's record profit is at Microsoft's expense.

this is not clear to me at all

1
9899100
121