882 karma · joined Sep 4, 2012 (14y ago) · 181 submissions
[ my public key: https://keybase.io/alwaysbcoding; my proof: https://keybase.io/alwaysbcoding/sigs/ES-ODI1v11tS_xq38nxpRtSoFMBs30d--AiC25_1s3g ]
comment 11y ago · link · parent
This is so awesome. Much love to everyone at Facebook that has made this possible. With React, React Native, Rebound, GraphQL, Relay etc... You're saving us all from drowning in complexity when buiding web/mobile apps and I love it. Keep fighting the good fight.
comment 11y ago · link · parent
comment 11y ago · link · parent
Having used ClojureScript a bunch it's pretty nice to compile whatever backend programming language you're using to Javascript to use in your UI. Makes it really easy to share data structures between the front and back end. Would be really interesting to see more Ruby code written this way.
comment 11y ago · link · parent
I'm a huge fan of React Native, but it's just not the same writing it in Javascript vs. using ClojureScript/Reagent. With the Javascript React Native workflow you're still forced to include npm modules to do basic enumerations, and the technical debt added to your codebase because of JSX is really painful.
Since Reagent components turn into React functions it seems like you should be able to write React Native apps in ClojureScript/Reagent and solve all these problems. I just don't even know how to start setting that up. Can I just use the regular CLJS compiler to save a javascript file and run it on the iPhone? Is there a tutorial or really simple example of the clojurescript to react-native workflow somewhere that you know of? If you wanted to learn more about this stuff where would you recommend starting?
comment 11y ago · link · parent
The Apple App Store approval process is like that one random weak spot on the Death Star. The only question is what replaces it?
comment 11y ago · link · parent
React Native is a godsend.
comment 11y ago · link · parent
It once took me 24 hours to parse a JSON response into a Swift object. In ruby you can get a ruby object from JSON by calling JSON.parse(data)... that's it. It takes one second. In Swift it's a nightmare, it can take you a full day. Who the hell has time for that? Startups are all about speed, who wants to waste a day trying to parse JSON when it's a one-liner in literally every other language ever made.
I also hate using mutable objects for my data model. Swift allegedly solves this with Structs but they're really hard to use in practice. Want to pass a struct through a Notification? Too bad, needs to inherit from NSObject so guess you're stuck using mutable objects?
Swift might be a well designed language from an academic standpoint. I have no idea, I'm new to programming. But I can say for sure that it's horrible to use compared to other languages that I've used in production (Ruby, Clojure, Javascript). I would bet anything that being able to use any language/workflow of your choosing and compiling to iOS native through JS will be a better business decision than coupling yourself to XCode/Swift and whatever hacks you build to make the workflow less painful.
comment 11y ago · link · parent
Traditionally if you wanted to build an iOS app off the data model, you would need to hire an iOS developer who knows XCode/Objective-C to build a separate application that communicates with your backend through some REST/JSON combination. But with React Native I can just take the ClojureScript components that I'm already rendering on web and give them alternative renderings that target iOS native, because it's all just Javascript/React, and build my app that way. It's much easier for the person who created the initial domain model to build native components in the exact same workflow without missing a beat. iOS native is just a rendering target for your Javascript component just like web is, and you can code it in any language that can get to Javascript.
In a sense you're just building one application, and making it work natively anywhere, instead of building multiple decoupled applications. I am literally betting my future on this being a better way to build mobile applications, I'm sure that it is. The biggest barrier to making it work is the staggered release cycles you need because of the app store approval stop gates, but hopefully that will get cleaned up in the next couple years.
comment 11y ago · link · parent
It's crystal clear that using web tooling and compiling Javascript to native components is the way forward here. It's just that tools like PhoneGap, Titanium, Cordova ... were half-baked solutions and never really excited me. This is why React Native is such a game-changing technology. If a startup can get to iOS and quickly iterate without being held back by XCode/Swift it's a massive competitive advantage. Let other companies spend millions and 9 months hiring 'iOS only' developers, and struggling to get a V1 to market when you can take just your existing model layer which is already rendering JavaScript somewhere anyway, and have it target iOS native without missing a beat.
Really interested to see the fallout from React Native, especially once the Android library is released later this year.
133.
Yes, It's Good: Initial Thoughts on the Apple Watch(medium.com ↗)
1 points · by AlwaysBCoding · 11y ago · discuss
comment 11y ago · link · parent
comment 11y ago · link · parent
The preferred solution is to use a ClojureScript wrapper around ReactJS and write your own event handling logic. I'm a big fan of the Reagent library which wraps React with a dead simple API. I believe it's the best UI library ever created and I wish more people knew about it.
The big idea is that you store your UI state as one single Clojure data structure. A Reagent component is just a Clojure function that takes the necessary sub-section of the UI state as an argument and returns a Clojure data structure that represents the HTML code that it wants to render. An example of this would be the following component that displays a list of items.
(defn [items] [:ul.items (for [item items] [:li.item (:display-name item)]])])
Then whenever you change the state of 'items', the component will automatically re-render and inject the new DOM as necessary using React's diffing algorithm for high performance. The key thing here is that there is no Javascript framework to learn. All you do is manipulate Clojure data with Clojure functions and use React to render it. There's no 'Ember.component.extend' or 'ng-repeat' to worry about. You spend very little time looking through documentation. The Clojure langauge IS your framework, it's really incredible.
comment 11y ago · link · parent
As a general comparison, when it comes to building server-side web apps Rails is preferable to Clojure. But for the web stacks / ecosystems as a whole Clojure wins by about 10x. The main reason for this is ClojureScript. For those who aren't familiar ClojureScript is a Clojure->Javascript compiler that lets you write your UI code in Clojure and drastically simplifies Javascript codebases. Given how much time is consumed writing UI code in modern web app development, the benefits that ClojureScript gives you over the turbolinks/js framework of your choice approach that Rails emphasizes cannot be overstated.
I've found that writing web-apps/api's in Clojure, using ClojureScript on the front-end, then using Rails to write small services where you want to take advantage of some of the great Ruby libraries is the way to go. You get the best of both worlds.
comment 11y ago · link · parent
comment 11y ago · link · parent
If there were more prison twitter accounts it would do wonders towards expsosing how absurd our judicial / prison system is. More people should be live tweeting court cases / prison sentences. Could Adnan Syed have done companion tweets to the Serial podcast? This idea is so interesting.
comment 11y ago · link · parent
React is a rendering engine, it's covers the final piece of your web app (rendering a data structure into DOM). But whatever you do to create the data structure that gets passed to React is up to you. This keeps most of your domain logic outside the context of React, you just use React to render data->DOM. So basically the API you have to learn is just Javascript, which most people know already and is easy to lookup answers to your questions.
With Angular your domain logic exists in the context of the framework. i.e. if you ng-repeat something you can't just filter that collection with Javascript you have to use an ng-filter to do it which is a special Angular construct. So the API you have to learn to manipulate data isn't just Javascript it's Angular. And how does ng-filter work? Well, you're tied to the Angular docs to figure it out. The Angular docs are of particualary poor quality so this coupling turns into a really serious problem if you're trying to be productive.
To me React vs. Angular isn't a matter of preference like Ruby vs. Python -- it's more like git vs. FTP where there is a clear right answer if you're trying to be productive in a team envrionment.
comment 11y ago · link · parent
I've moved to React as well and feel it's a 10x boost in productivity because I'm constantly thinking in my domain and not in a framework.
comment 11y ago · link · parent
I'm not sure what the conversion rate of Azure computing dollar to mined Bitcoin would be, but this would work to some extent with $500,000 wouldn't it? What YC company wouldn't want a Azure -> cash liquidation web app.
comment 11y ago · link · parent
comment 11y ago · link · parent
comment 12y ago · link · parent
I was able to teach a data scientist on our team how to build UI components in Reagent in less than 24 hours to the point that he was able to build his own visualizations for his data analysis with minimal guidance, that's how intuitive it is.
Compare that with Om which I've tried for about a month to grok and still can't get a handle on it. The only advantage that Om gives you over Reagent that I can see is global undo out of the box, but it's at the cost of significant added complexity. And if that's what you were really after you could just build one global state atom in Reagent to give you global undo without all the added complexity of Om. What am I missing here?
I think Reagent's model is the perfect blend of ClojureScript + React. The only shortcomings are that it's not actively maintained and I wish there was a more robust library of helper methods baked in, but those are easy tradeoffs to make for something so simple and powerful.
comment 12y ago · link · parent
comment 12y ago · link · parent
I've always wished there was some sort of one bit communication for "want to get a drink?" or "want to go for a bike ride?" or "want to watch the redskins game?"
How cool would it be to vibrate someone's wrist with a martini glass saying implying that I haven't seen you in a while and want to go get a drink. No need for email, calling, texting anything. Just so simple, ping someone and say that I want to see them.
I think it's a bigger deal than you realize.