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 13y ago · link · parent

yes but it does seem like the equations of general relativity needs less frequent refactoring than a java codebase.

comment 13y ago · link · parent

meh, i have used anorm. their site jabs at ORMs and jabs at Slick (typesafe SQL dsl in scala); but the wording of both jabs make it clear that they've missed the point of both tools. Slick is not about types - its about adding one-off functions to remove all the repition from complex SQL - and ORM isn't about hiding SQL under the hood, it's about expressing very complex queries at a higher level than is possible in SQL. Just because someone wrote it on the internet does not make it so.

If your app is simple CRUD on 10 tables, anorm is great. But even for CRUD on complex types (nested objects, objects with collections of objects, objects with values that aren't primitives e.g. dictionary types where possible values aren't known until runtime...) those queries will be crazy complex and repetitive in raw SQL and you will quickly see you need an orm (or move off sql to some other acid alternative like datomic). Anorm would be an ideal layer to write your own ORM in though.

comment 13y ago · link · parent

anti-ORM is not exactly a new sentiment - ORMs have been a hot & unresolved debate for two decades - but you need to be very careful about what you read on the internet, a lot of people express reasonably written opinions with an authoritative tone (like me) but are just wrong (hopefully not me haha). Find someone smart that you trust, like Rich Hickey or Greg Young, and try to understand what they say.

comment 13y ago · link · parent

yeah, Datomic is EAV (technically EAVT, it's event sourced so there is a notion of time and reads/writes need be acid with transactions and stuff) and EAVT can express even higher level queries than an ORM can, mostly because you can cache the indexes locally so you can do consistent read queries in your app process (Datomic's query engine is a library that runs inside your app, if cache is hot reads don't touch network... like git). From my understanding it doesn't have much to do with sparseness, though you certainly can support sparse objects performantly with EAVT.

EAVT/Datomic is a better fit for apps with complex structured data than an ORM over SQL, but migrating there is no trivial feat. Nor is convincing my customers in their due diligence phase, as they have surely been burned before by some kid pushing MongoDB, but they understand SQL and know the product can be successful with SQL, they know they can go get Oracle consultants to save their ass in 10 years when my company is sold, etc.

comment 13y ago · link · parent

i think your third paragraph is more or less false for apps over a certain size, think enterprise-y stuff. it is certainly false for the class of apps that i work on - big pharma regulatory compliance software, very complex data model, hundreds of tables etc. Our ORM can express higher level queries and a wider set of queries than raw SQL - you can express a query in one line (one thought) that compiles down to quite a few nested SQL expressions. Finally, the problems of orm stem from the fundamental nature of SQL, so dropping into raw sql couldn't possibly fix them. You need something like Datomic or CQRS/ES to remove the object/relational impedance mismatch at a fundamental level. (This is analogous to why Git rocks compared to SVN; Git solves the problem of centralized mutable state at a fundamental level which opens the door for a better model of the problem and more powerful abstractions.)

comment 13y ago · link · parent

quick summary:

    * no coding style flamewars
    * it has familiar syntax
    * builtin concurrency model
    * it has gc
    * it is fast
    * static types that don't get in the way
If you compare this list to popular up-and-coming ecosystems from the 90s (java, python, C, C++, Ruby), okay, concurrency is a big win and everything else, maybe go is a little bit better.

If you compare to other popular up-and-coming ecosystems in 2013 that have a similar sized following as Go (Scala, Clojure, Haskell, Node, Rust)...

Well, at least Go beats Node. and Haskell appeared in 1990.

2827.

High school programming taught in Haskell in Argentina(sawafaso.blogspot.com.ar ↗)

110 points · by dustingetz · 13y ago · 47 comments

comment 13y ago · link · parent

you will want to research and form your own opinion as there are very subtle nuances that have enormous consequences in maintaining large codebases, but here's a starting point: http://www.quora.com/Pete-Hunt/Posts/Facebooks-React-vs-Angu...

The main issue is that to do anything complicated in angular you need to start writing tricky[1] "link" functions; the React approach completely sidesteps this complexity. There are some tradeoffs you have to accept, like JSX, but they are easily worth it.

[1] tricky is of course relative; angular is easier to code than something like backbone+jquery or backbone+knockout.

comment 13y ago · link · parent

Knockout and Ractive take opposite approaches to managing the DOM. There is value in understanding all approaches and then choosing the best fit.

comment 13y ago · link · parent

The heavy emphasis of macros in Lisp may also be its greatest weakness. I see all sorts of Clojure code that uses macros where they needn't have, and it tremendously impedes my ability to use the code in ways the library author may not have expected. I love the way petehunt put it - metaprogramming is a last resort, you should feel bad when you use it, and language designers should include it but deemphasize it. (Scala and Haskell nail it I think; Clojure perhaps emphasizes macros a bit too much which harms the output of intermediate programmers. But, Clojure is not designed for intermediate programmers.)

comment 13y ago · link · parent

It is my impression also that react is aimed at very large sites (like Facebook), and you need to have a strong grasp of various approaches to dom management to wield React well. Though in the hands of an expert React is the sharpest DOM management tool available and its not even close.

Ractive's approach appears to be much more suitable for use cases like a journalist interested in only learning barely enough javascript to get by.

comment 13y ago · link · parent

from [1]: "In React, you simply update a component's state, and then render a new UI based on this new state. React takes care of updating the DOM for you in the most efficient way."

So you don't actually do DOM mutation yourself, nor do you "update" the DOM in response to events on models that changed. You think in terms of "pseudodom", not actual DOM, so if any state changes or an event fires you can just redraw all the pseudodom instead of worrying about finding the right place in the dom that you need to update.

[1] http://facebook.github.io/react/docs/interactivity-and-dynam...

Sorry, I don't mean to derail your thread.

comment 13y ago · link · parent

Ractive.js has some things in common with Facebook React, if you guys are interested in declarative DOM, react merits close study. React diverges from Ractive (and other databinding "things") by removing almost all mutation of models from the programming model, which removes a lot of complexity and is a pretty big deal.

http://facebook.github.io/react/

edit: upon closer study, Ractive seems to be more similar to React than I first thought.

comment 13y ago · link · parent

"Objects make good nouns"

most 'objects' as they exist in today's OOP have methods, which makes them both nouns and verbs. Idiomatic code in most of today's mainstream OO languages doesn't make heavy use of closures, mostly only Javascript.

Anyway, the closures vs methods debate has been going on for decades is not a closed topic[1], and the answer certainly depends on the language you're using.

[1] http://www.c2.com/cgi/wiki?ClosuresAndObjectsAreEquivalent

comment 13y ago · link · parent

what RPi kit do i need to buy to make this work? Do I need the complete starter kit, will that block the usb?

edit: here's what i purchased:

[1] CanaKit Raspberry Pi (512 MB) Complete Starter Kit (Raspberry Pi 512 MB + Black Case + Micro USB Power Supply + Original Preloaded SD Card + HDMI Cable)

[2] Edimax EW-7811Un 150 Mbps Wireless 11n Nano Size USB Adapter with EZmax Setup Wizard

[3] SanDisk Cruzer Fit CZ33 32GB USB Flash Drive (SDCZ33-032G-B35)

[4] Preloaded SD Card for Raspberry Pi (16GB, Raspbian "wheezy")

[1] http://www.amazon.com/gp/product/B00DLUXD64/ref=oh_details_o... [2] http://www.amazon.com/gp/product/B003MTTJOY/ref=oh_details_o... [3] http://www.amazon.com/gp/product/B00812F7O8/ref=oh_details_o... [4] http://www.amazon.com/gp/product/B00AYH22VY/ref=oh_details_o...

comment 13y ago · link · parent

And you can see status from two years ago! Google won't even recognize that gmail is down unless 5% of requests are failing (!!!! Try getting your work done all day if 1/20 actions fails.)

comment 13y ago · link · parent

but everyone knows that facebook "counsels out" for "poor cultural fit" if you don't meet expectations after six months, which is a far cry from "fire fast" with "little notice". They also pay well.

comment 13y ago · link · parent

"The thought of paying someone I was forced to fire because he (or she) is incompetent burns me up inside."

It was your decision to hire him, and it was your mistake that you are remedying by firing him. Incompetence is subjective. If your interview process makes it clear that your employees must live in constant fear of termination if they aren't ramping up fast enough for you, on your product with your technical debt and your team's shitty architecture choices ("fire fast" and "with little notice", you wrote), you'll find that your candidate pool vanishes.

comment 13y ago · link · parent

Hi Chris,

Instarepl is an awesome idea.

If someone were to implement an insta-repl as an IntelliJ plugin, or an emacs plugin, what remaining advantages would LT have? Is there something about the architecture of existing IDEs that is incompatible with an insta-repl?

Say I'm writing a medium size webapp, like, say, Gmail, in clojure + clojurescript. I don't understand how integrating my app into LT is going to 10x my productivity, outside of instarepl. Or being able to on-the-fly extend my IDE. Emacs can do that, and its not exactly a feature i can't live without.

It just seems like all the things you're talking about on the list, like [commands, settings, threading models, plugins, UX] are previously solved problems.

comment 13y ago · link · parent

Its not sad at all. Really good programmers can do things that ordinary programmers think impossible. This code was probably generated. Here is a paper on quine generation[1], and the authors have a very popular talk where they livecode a quine generator; that is, they livecode a program that generates an infinite list of quines[2] (source code from talk [3]).

[1] http://users-cs.au.dk/danvy/sfp12/papers/byrd-holk-friedman-... [2] http://www.infoq.com/presentations/miniKanren [3] https://github.com/webyrd/quines

The talk is amazing and hilarious.

On point, if the code is not generated in this fashion, there is assuredly a "work smart not hard" trick that drastically simplifies the problem.

comment 13y ago · link · parent

I want to use clojurescript on the page, (which has a compilation step), and I don't want to track the build output in source control.

comment 13y ago · link · parent

I would pay for someone to take care of this for me. I presently run a GH Pages static blog but would like complete control of the build. I want to upload a .zip somewhere and have things just work.

comment 13y ago · link · parent

I do all these things on the clock and in my experience it makes me more effective in the long run. Citation: a consistent history of rapid increases in responsibility and salary

comment 13y ago · link · parent

Switch '#foobar' to '[data-mycompany-id="foobar"]'. A nice byproduct is your selectors now work against detached fragments. A negative is your selectors are no longer o(1) but this has not been a problem for my team in practice

comment 13y ago · link · parent

If sarbox did indeed cause delayed IPOs to the extent described here, author didn't even try to make a case for it, he just said it is so.

comment 13y ago · link · parent

The point of all frameworks provide a set of idioms about how one should best solve a problem. It's not to make web apps possible, it's to establish an opinion about how webapps ought to be written in Go. Which is different than how one ought to do it in Java, and Scala, and Ruby.

It's nice to be able to leverage other people's opinions and established idioms without having to figure them out yourself.

comment 13y ago · link · parent

I think the killer feature will be functional Dom manipulation which is just starting to become feasible (Facebook React). Give it another year.

comment 13y ago · link · parent

> someone always has root

same in programming... unsafePerformIO, dropping into native code or assembly, etc. In 2013 the hardware exposes a mutable interface.

comment 13y ago · link · parent

bitcoin standard practice is to create a new identity with every single transaction, and that's been proven to be insufficient for anonymity against an academic, let alone a government.

comment 13y ago · link · parent

friend, i wish i could convince you otherwise. there's a difference between exposing your identity to people you trust, and exposing your identity to the entire world.

I would use a product that lets gay people talk to other gay people without leaking information. No other product can protect free speech, and if nightweb can't protect free speech, then what's the point?

1
949596
121