However there are security concerns when dealing with JavaScript. For example, if you've ever surfed the darknet, disabling JavaScript is highly recommended to avoid present and future exploits that could compromise your anonymity, funds, etc.
299 karma · joined July 8, 2011
However there are security concerns when dealing with JavaScript. For example, if you've ever surfed the darknet, disabling JavaScript is highly recommended to avoid present and future exploits that could compromise your anonymity, funds, etc.
Rails controllers are hard to test because actions aren't designed to be testable objects.
ActiveRecord models become monolithic because there's no separation of instantiation, validation, persistence, or retrieval.
I originally experimented with building a Rails app that forgoes ActiveRecord to a large extent; using plain Ruby classes + Virtus gem to separate the aforementioned concerns depending on context.
I was pretty satisfied with the number of design headaches I was able to avoid, which is when I started to create a framework around the aforementioned paradigms.
Not sure if I just lost my motivation or not, but I'm glad I'm not alone.
Comparing it to the notion of a "moon base" is extreme on multiple levels, I guess one of them being that the actual demand for such is clearly minimal where as Bitcoin's adoption continues.
Bitcoin being banned by someone somewhere was a wholly inevitable and arguably necessary outcome. The positive spin on this news is that Bitcoin is on the radar at all to even be banned by anyone to begin with.
Anything consumed in excess can be harmful in the short-term and long-term, including food, water, or oxygen.
https://twitter.com/edwarddroste/status/343418176454926337
"Maybe they're trying to catch your latest tweet?" was the reply that I wanted to send, but I didn't want to come off as cheeky to someone I revered.
Is the article not a distraction in itself? Sure enough, I came upon it this morning while I was browsing Twitter from my bed. The article itself is over 2000 words long; some of those words being a transcript from a 15 minute video. Now here I am commenting on it; taking up additional time from my day to formulate these points rather than attending to other things; reinforcing the dissonant relevance and irony of the points that the article is making. This article on distraction is a distraction in itself, and my viewership was predicated on finding it on a distracting service used from a distracting device. I found it and read it because I didn't have anything subjectively better to do at the time.
I'm OK with this.
If you want to get by with the hardware you already own, look into Litecoin mining, then sell those Litecoins for cash or Bitcoin. Mt.Gox will support Litecoin transactions (indeterminate ETA).
Honestly I think the easiest path is to just buy coins and hope they continue to appreciate. I remember not too long ago buying a few when they were in their ~$90s USD, and then regretting buying them at that "high" price. Now it's more than doubled.
Whatever the case, categorizing these symptoms into a disorder is rather inconsequential to the fact that taking Adderall has generally improved my quality of life. I honestly don't know if I'd be able to keep my job without it.
I should note that I was tested for ADHD and the results indicated that I actually didn't have it, even though the symptoms of inattentive ADHD seem to describe me perfectly.
1. I dumped view helpers for decorators (namely, the Draper gem). I got rid of complex logic in my view templates. Most of the logic I need in my views is transformed object properties. I need a date to appear as mm/dd/yy. I need a filesize in bytes to appear as KB/MB. I want a comment formatted as Markdown to be HTML. So now I'll decorate my objects so I have a nice post.formatted_date instead of needing to write the helper formatted_date(post). At worst I have some conditional statements in my views looking for the existence of a property. CSS also comes into play; the :empty selector allows me to cheat in some cases.
2. I write my view templates in a JavaScript templating language. I am a fan of slim for Ruby, so I went with Jade for JavaScript. I use therubyracer to call on these precompiled templates within Ruby itself, and render them like anything else. I then go on to use these same templates client-side. The reason why I abandoned view helpers to a large extent is because of this. Any logic that I need within a template would have to be duplicated server-side and client-side, which is antithetical to the goal. For my use-cases I've been able to do this successfully. It requires an adjustment to mindset, but is feasible. And really, my templates are a lot cleaner now than they've ever been.
3. When a user lands on a page, they get rendered HTML. Subsequent requests use AJAX and JSON responses to load things dynamically from there. Best of both worlds. Also, users who have JavaScript disabled can use the site albeit with not as much slickness.
4. Using to_json is hell; don't do it. I use the RABL gem for assembling my JSON, and use the same decorated objects. In the case of JSON, depending on your API, you might want to include say an ISO8601 date as well as a formatted date. Not a big deal, just vaguely duplicative.
The downside was how much code I had to write for myself. Using JavaScript templates was a biggy. But this is something that could probably be packaged as a gem, if I or someone else took the time. The framework (in my case, Padrino) still provides lots of tools that I need. Ruby ORMs are a big part of this.
There's still the issue of duplicative routes. I have routes defined in the app itself, and then within my JavaScript framework (currently Spine, but previously Backbone) I have to hardcode these same routes. I don't like this, however, routes are probably the last thing to change in my app if I put any thought into them ahead of time. This is something that requires additional thought, but I'm thinking there should be a way to get my app routes available client-side.
My current Padrino project is around 2000 LOC, excluding tests. As it has grown more complex, I've broken off larger parts of its functionality into smaller apps within the same project. These apps share some resources -- particularly models -- but in terms of controllers and helpers, they are very much distinct in their roles in the overarching project.
Padrino has changed my mindset on how I approach large projects. Instead of trying to create something massive in itself, I logically separate key parts of the overarching app into smaller apps mounted within the same project.
I question the entire concept of a "large app". When classes are too large, methods are too long, it's generally considered to be sub-optimal code, or poor design, and there's a point where one is expected to break these things down into smaller pieces. Why does this concept not apply to our web apps?
Anecdotal contradiction incoming. I started with Rails years and years ago (can't even remember when). I moved to Merb when Merb was the new hotness because I preferred it's modular approach. After Merb was "merged" (i.e. a few of its philosophies were put into Rails and Merb died due to lack of development), I caught on to Padrino and was impressed by it for the same reasons I was impressed by Merb. I program in Rails for a living but use Padrino for my personal projects.
I actually think a potential knock against Padrino is that it's not quite as easy to get into as Rails. When I got into Rails, it was all "create a blog in five minutes" which is what attracted me to it. There was a point where I didn't even understand the distinction between Ruby/Rails -- it was just one big scripting language to my PHP-addled mind. I think Padrino (or even just plain Sinatra) has a slightly steeper learning curve; but it's hard for me to comment on that necessarily because I am no longer a beginner and my perspective is a lot different.
Since I haven't played with Rails since 3 was in beta, I'm genuinely curious: from a purely technical standpoint, for what types of projects might Rails be a better choice than Padrino?