Better HN
topnewbestaskshowjobs
Log inSign up

AlwaysBCoding

882 karma · joined Sep 4, 2012 (14y ago) · 181 submissions

https://www.youtube.com/channel/UC8CB0ZkvogP7tnCTDR-zV7g

[ my public key: https://keybase.io/alwaysbcoding; my proof: https://keybase.io/alwaysbcoding/sigs/ES-ODI1v11tS_xq38nxpRtSoFMBs30d--AiC25_1s3g ]

Submissions

comment 11y ago · link · parent

I'm totally cool with Facebook mining my data if their open source keeps up this pace. GraphQL + Relay are total game changers for structuring web + mobile applications. Code bases get cleaner and more reliable. Less data gets sent over the wire. Other cool libraries are going to be built on top of Relay (I'm pretty excited to see what can be done now with ClojureScript components in .cljc files).

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

Just use a tab bar where the right most tab is "more" and that brings up more navigation options. Can still have more than 5 nav links and avoids the hamburger menu, you can thank me later.

comment 11y ago · link · parent

All those hours and millions of dollars into perfecting their recommendation system, and Popcorn Time still has a better UI for viewing movies than Netflix does. Just show me all the top movies and let me pick one, why partition them into drama/comedy and filter out the one's you don't think I'll like? it makes the experience worse.

comment 11y ago · link · parent

This is awesome. I'm really curious to see if the Ruby community will ever fully embrace something like Opal.

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've been using the Reagent library for all my web UI's and it's simply incredible. I desparately want to translate this same workflow to iOS.

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

Yeah I agree,

I saw a round of layoffs go by at a company I worked at that caught me by surprise. It always felt extremely disrespectful to me that I wasn't alerted beforehand. A simple heads up the night before would have done wonders.

comment 11y ago · link · parent

I've always thought that Apple's horrific App Store approval process was the single biggest threat to the Apple empire. Glad to hear someone else speak out about this. It's seriously absurd that there's an arbitrarily enforced stopgate that prevents you from deploying code. It's a complete disaster. If someone could make a way to instantly deploy code to mobile phones every developer would switch in a second.

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

I think it's terrible. Parsing a JSON response into a Swift object takes a full-day to figure out when it's literally just JSON.parse(response) in any other language. You can't pass immutable structures (structs) into NSNotifications and I can't figure out why. It's confusing and poorly documented, and a complete chore to use.

React Native is a godsend.

comment 11y ago · link · parent

Swift is awful to use in practice.

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

JS->iOS is the way of the future, beacuse increasingly you can get to Javascript from any language. So for example, if your backend data system is built in Clojure you can get to Javascript via ClojureScript which is a Clojure->Javascript compiler. If you wanted to build a web application off your data model you could use your Clojure data model on the front-end, the final HTML produced is just some web rendering of that data model.

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

I built my first mobile app this year (iOS) and I was appalled at how bad the tooling and development workflow for mobile was. Swift is a disaster, the app store approval process feels like going back 10 years in a time machine, debugging XCode is like trying to solve the riddle of the Sphinx, testing is hard, a reloaded dev workflow is non-existent... It's no wonder startups can't get out the door and quickly iterate on mobile.

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.

comment 11y ago · link · parent

Good concept, I hate games with timers though. You should have an option to turn it off, I like enjoying strategy games + taking my time

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

Yeah I agree, for basic DOM manipulation it's easier to just call out to the google closure functions than worrying about including jQuery... HOWEVA, there are a lot of useful libraries (highcharts, jqueryUI etc...) that are built on top of jQuery so I find myself including it frequently in my cljs builds.

comment 11y ago · link · parent

Yes, you can use any JS library you normally would from ClojureScript. Pretty much the only JS "framework" that feels natural to use from ClojureScript is React, but things like jQuery, Highcharts, etc... all work just like they would in CoffeeScript.

comment 11y ago · link · parent

You can write Ember/Angular/Knockout etc... in ClojureScript (I've done it before) but it comes out feeling weird and unnatural. You always feel like you're trying to fit a square peg into a round hole.

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

Having used both Rails + Clojure here's my take.

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

At this point I'm just going to pause my inbox with http://inboxpause.com/ and open it in the morning, see everyone on the other side.

comment 11y ago · link · parent

This is unbelievable if true. Why has nobody thought of tweeting from prison before? It's genius. Is there anything the government can legally do to prevent this from happening? Do you have the right to freely distribute your thoughts while incarcerated?

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

AFAIK the Apple Watch doesn't support video of any sort, so if you want to get moving pictures on your watch the gif is the only way. Gif is about to make a comeback if anything.

comment 11y ago · link · parent

No, it's different.

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

You're 100% right. Once you're in Angular-land you are completely tied to the framework. You don't think about "how can I make X in my domain happen?" you think about "how do I make X in Angular happen". This coupled with the horrific Angular docs make it really tough to justify using from a productivity standpoint.

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

Better idea, make a script that can spin up Azure instances and mine Bitcoins on them. Then build a web app on top of it that will liquidate Azure credits to cash as a service. When someone dumps their credentials into your site you spin up $500,000 of computing power on Azure to mine Bitcoins from and then liquidate the Bitcoins you mine into cash and take like 15% off the top.

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

Just wondering, can the scraper record video of the site it's on? I feel like that's something I have a lot of use cases for. Even if it's not possible is there some hack you could do by taking a snapshot every 1/30th of a second and stitching it together into a 30fps video? Always been curious about this.

comment 11y ago · link · parent

Very short sighted mentality. It assumes that people are cogs and the measurable effect of working with someone is the amount of tangible output. Working with extremely talented developers can fundamentally change your perspective about how you should be building your system / approaching a problem that can have huge future benefits. I would rather work with a genius for 12 months than a cog for 3 years.

comment 11y ago · link · parent

Semantic UI is really good as well.

http://semantic-ui.com/

comment 12y ago · link · parent

I agree 100% with this post. Reagent is the best UI library that I've ever worked with. It's powerful, just works, and it's easy to understand what's going on under the hood.

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

Perfect example is r/nfl censoring the Bill Simmons story last week.

comment 12y ago · link · parent

+1 for Reagent. Best UI library that I've ever used. Om is really confusing to me and requires too much configuration to make it usable. Reagent works out of the box and just makes so much sense. It never feels like you're using a framework, it just feels like using a tool to abstract away the complexity of rendering from your UI logic. It's really enjoyable to use. Then again it hasn't been updated in six months so there's that...

comment 12y ago · link · parent

That was one of my favorite features.

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.

1234567