7,912 karma · joined Sep 11, 2009 (17y ago) · 3,625 submissions
https://twitter.com/dustingetz
comment 14y ago · link · parent
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
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
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
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
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
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
"-1, poor tone"
"-1, offtopic"
"-1, factually incorrect"comment 14y ago · link · parent
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
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
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
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
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
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
*i don't have a relationship with hayzap and i've never worked for a CMS company.
comment 14y ago · link · parent