Contract Work

Showing posts with label cool things. Show all posts
Showing posts with label cool things. Show all posts

Monday, June 16, 2014

One Giant Post about Ruby Nation



This year again, I attended Ruby Nation. This year was great because I actually understood what was going on!! Admittedly, I took better notes on the second day than on the first because I was speaking on the first day but most of the session I went to were really great. Also, I apologize in advance because this is just one giant post, as opposed to breaking it up by session which I usually do after conferences.

The first session was talking about ruby and government with Sarah Allen. She was recently a presidential innovation fellow and spoke a bit about the interesting things she was doing and the really interesting digital data issues that the Smithsonian system has. Sarah brought up some really interesting thoughts about rails in general. One of the most interesting (controversial?) things she talked about was making Rails more accessible. She talked about other platforms like Drupal or Wordpress and the ease of adding certain functionality or widgets there. These are things that Rails doesn’t have. It isn’t super accessible because you don't have the same sort of ability to add widgets or different features. Her point was that potentially being able to make it easier to add widgets would make us more effective programmers and that by doing this, we wouldn’t have to re-work things or add simple, commonly-requested functionality on a regular basis.­­

Her talk closed with three interesting points to think about. First, framework leads to language. Second, what if we could add UI features at runtime, and what would that look like? And third, non-developers are co-creators so how to we give them a more active role in rails.

The second talk was by Eileen Uchitelle and was about CRUD and ActiveRecord. I thought this talk was fantastic, although admittedly got a little lost in the middle. The premise of this talk was that when we assume activerecord is magic and does all these magical things, we end up not paying enough attention to our code and to the actual SQL queries and how they’re functioning. Eileen then went through an example using each of the CRUD methods (create, read, update, delete) and went through ways that the queries could be better, faster, and more effective. For example, in create, she spoke about batch insert and in read she talked about using pluck. Her slides are super clear and definitely worth a read.

The third session was Terence Lee speaking about working with Ruby. He spoke a lot about how to commit and encouraged everyone to get involved with fixing ruby, committing, and getting involved with the core team. I learned that .to_f is to float. Floating objects “represent inexact real numbers.” He talked about the future of ruby being focused on trust, transparency, and onboarding.

The fourth talk was given by Davy Stevenson on Ruby as science, art and craft. I thought this talk was really great and looked at code from different perspectives and points of view. She started with science, looking at algorithms and talking about what complexity looks like. Davy went through a variety of big O notation types like linear, quadratic, exponential, and factorial. She described an algorithm as a set of instructions that will solve a particular problem… a great definition for someone who isn’t a math person. She then looked at the convex hull problem and demonstrated different approaches through different algorithms that connect the points and show this convex hull in different ways. I won’t go into them here, but if you want to google them a bit further, she discussed brute force, gift wrapping, and monotone chain algorithms.

Then Davy talked about art. The art part was lots of imaged of different interpretations of art and thinking about them. The best part of that segment for me was a quote she mentioned from @sferik where he said that programming is about building powerful things in simple pieces.

Finally, Davy discussed craft taking the idea of apprenticeship and artisan abilities and connecting it to code. She said we write code to enrich our own lives and the lives of the people around us and then showed us examples of beautiful code. Definitely take a look at the slides to see what people consider as beautiful code.

After this was lightning talks!! There were a few talks… one on muscle driven development, which talked about health and treadmill desks. One on debugging, another on language and thinking about how the language we’re using shapes how we look at solutions. A fourth on Ruby For Good which is going to be awesome and everyone shold check out. The fifth was on the Angelo gem and the last talk was about how you shouldn’t do ops as a dev.

From here, we went into the tracks. Again, the talks today, I won’t do justice because I wasn’t focusing as much as I could/should have been but at hopefully I can provide some notes. The first session I went to was JohnPaul Ashenfelter’s Machine Learning talk. He did this at RailsConf as well (a longer version). It was really interesting. Basically, he spoke about different gems and things developers could use to learn more about the users. First, he talked about the sex machine gem which isn’t perfect but can help determine the gender assignment of your user base. Second, he discussed free geoip to show location awareness. After that, he got into clustering a bit and looking at clusters in order to help determine patterns. He walked through the ai4r gem which puts people into clusters and then calculates the centroid (centroid being the center of the random clusters) and finally, it loops through to see if users are closer to the center or their cluster or another cluster. This enables you to see what cluster people are in which is super helpful is your clusters show, for example, what tier users are paying for in your system. Alternatives to this can be hierarchical clusterers or divisive hierarchical clusterers. Finally, he talked about a gem called linalg and how you can use it for collaboration purposes (I think… my notes get a little sketchy here).

After that, I went to an ActiveRecord workshop with Dave Bock. This workshop is fantastic, but very hands on so not many notes. Basically, Dave has a handful of scenarios that each table has to discuss and talk about how they’d architect them. Really helpful for continuing to learn about ActiveRecord, associations, and modeling.

The next talks I went to was about tests and having a messy test suite. Presented by Chris Sexton and Aaron Kromer, this talk was great. They went through testing best practices and showed examples of clean, clear test structures. Some highlights were that you shouldn’t deeply nest state in your tests and you can fix this by creating contexts, this way the state is top level and you can test everything. Tests should help organize and expose state. Class declarations should tell what behaviors to test. Finally, the two most important pieces of advice were to prioritize what’s most important to test and then iterate towards that goal and make your tests better as you work towards your goal.

The last talk of the day was about sidekiq. I don’t have a ton of notes from this talk as well but presented by Mike Subelsky, it was a great walkthrough of sidekiq and what you can tell from the dashboard when running it.

Day 2
I was able to pay more attention on day 2.

Day 2 started with Jim Gay talking about east-oriented code. This is a pretty cool concept that operates under the principle of tell, don’t ask. The core of it is that queries travel west and commands travel east. The talked touched on the law of Demeter and talked about east oriented code being different than that. There are four things to keep in mind with east oriented code. First, always return self. In this way the method is prevented from querying, can only tell. It leads to polymorphism, duck typing, and encapsulation. Second, factories are exempt form this. Third, always follow rule 1. And finally, sometimes break rule 3. After rule four, he showed a really interesting rails erb template that described this and walked through it. I left this talk sortof understanding everything but definitely would love to take a look at the code examples and slides in order to comprehend it all a little further.

The second talk I went to was on two programmers in one. I loved this talk by Jano Gonzalez. He talked about how each of us as developers are a little hacker and a little thinker. The hacker wants to get things done, and quickly which can sometimes lead to a maintenance nightmare. The thinker thinks about maintainability, abstractions and all the different layers but sometimes can get away from the problem that they’re trying to solve and can have analysis paralysis. He then told his story about going from hacker to thinker and coming to a good balance with both sides when using ruby. Jano spoke about how the hacker is useful for exploring new territory but the thinker is good from defining components and acceptance criteria. Developers need to deliver value but also diminish technical debt and it’s all about the balance between the two. My favorite part of the talk was when he spoke about the 3 stages of learning from Martial Arts. There is Shu, Ha, and Ri. Shu is when you’re new and you follow all the rules. Ha is when you move on and start adding your own knowledge and breaking some of the rules, and Ri is when there are no rules to follow and no rules to break, you just do it.

After that was a talk on google glass by Lance. This was a fun talk and one I just sat back and enjoyed since I’m not really developing with google glass but was just curious. Lance talked about apps as service layers. He then went on to discuss some of the glass specs, things that are great about glass and things that still need to be fixed. He then talked about the Mirror API, which I still have to check out, and how you don’t need to know android in order to program for glass. There’s a concept of static cards which add functionality and a new(?) tool called WearScript which is a bit like phonegap for glass.

Interesting talk and really fun to just see some of the programming side of glass.

Sam spoke about the anatomy of a mocked call which basically involved doing a deep dive into what a mocked call means technically with rspec, using their internal mocking library. He started by talking about testing and why you test/TDD. His main points were that TDD’ing helps programmers create a mental model. It helps them think through what the code does and then because things change as you program, it helps keep that mental model intact and keeps you on track with the problem you’re trying to solve. In short, tests force behavior.

The first part of this deep dive was discussing stubbing. Stubbing is basically faking a response to a method. Moching enables you to verify the collaborations between objects by testing the methods that get called. It creates a mocked expectation. so in the example
it “does something” do
allow(foo).to receive(bar)
expect(foo.bar).to eq (nil)
end


The allow is actually allow= allowanceTarget.new

allowanceTarget is a subclass of the TargetBase and calls delegate_to on TargetBase and, with a setup_allowance, TargetBase defines TO as an allowancetarget enabling .to to exist as a matcher.

Then there is receive which is also often used as a matcher. Once receive is set up as a matcher, similar to how to is set up as a matcher above, then receive#setup_allowance creates a mock proxy. A mock proxy is an object that manages the metadata of mocks and stubs on the object in the lifecyce of a test. Calling add_stub on this proxy sets up a emthod double which saves the original implementation. Then calling foo.bar (the stubbed implementation) sends a message to the method double which sends a message to the proxy which invokes the stub which returns a value (gosh, I hope I got that right!).

When you run a test, rspec also runs setup and teardown before and after the test and at the end of the test, the teardown resets everything. This reminds me a little bit of how testing work in ember with quint.

Okay, now onto mocks. For explaining mocking, sam worked through the same example but using expect(foo) instead or allow(foo). In this case, expect = ExpectationTarget.new and goes through a similar process as the stub did, except this time with a mock. Here, once you have the proxy, the proxy callbacks checks to make sure the arguments are valid and the proxy raises if a mock wasn’t called.

Finally, I can’t remember at what point sam mentioned this, but during his talk (or when someone asked a question about using spies instead of mocks), he mentioned spies so now I know what spies are! Spies are whenever you do a a stub, it will record the information so you can set an expectation at the end of your test instead of at the beginning. Basically, you can set a spy to collect all sorts of information from you and when the object returns you can ask it questions about it’s experience. The way I envision this is similar to what the Dorothy’s were trying to do in Twister. In Twister, the tornado chasers weren’t able to learn more about tornadoes because they weren’t able to see or understand what was happening inside the tornado. They came up with a way to release thousands of little sensors into the tornado to collect all the information and have them transmit the information back so it could be recorded and studying. From my understanding so far, this is similar to what spies do.

Evan is great. He’s got so much experience and his talk was on remote pair programming. Now, I work remotely, so I’m familiar with a lot of the tools, but his talk was less focused on tools like madeye, nitrous, and screen hero and more focused on command line tools. He spoke a lot about vim and emacs (which made me really want to learn vim again… one day I’ll get around to that). He also spoke about tmux, ssh’ing into machines, and a lot of really interesting concepts. He spoke about how his remote pairing stack has changed over the years and different combinations of things he’s tried which allows people to pick any of these tools and configure it to their remote pairing liking. Overall, an interesting talk and some exposure to remote tools I hadn’t thought about in the past.

Mark spoke about wyriki which is a project that Jim Weirich was working on when he passed away. I’m gonna be honest and say that Mark lost me pretty early in his explanation but this is what I got. Wyriki is a different way to architect rails applications. It creates new structures of runners in between controllers and models which allow someone to isolate the business logic from everything else. The rest of my notes on this are sparse and it’s pretty obvious I got lost in there, but I think the core takeaway was thinking about different ways to structure apps, so not fat model, skinny controller and not everything in moderation but how to really separates different types of business logic in your apps.

Next up was Justin’s talk on breaking up with your test suite. I took frantic notes on this one and listened intently, but eve so I’m sure I missed stuff. Also, these slides were great and super understandable so check them out. So first was talking about why we should test. there were 8 or 9 ultimate reasons why code should be tested which fall into two essential categories. First, you can gain confidence from the test and you can gain understanding of the code through the tests. BUT he started by discussing that we should question before we test. When thinking about tests, we should think about the purpose, rules, and structure and we should expect that within our test suite these three items should be immediately clear to anyone looking at it. If we cram lots of different goals and motivations into each test, the test becomes unclear. The rules become debatable, the purpose becomes hazy, and the structure ends up being ad hoc instead of uniform. Every test suite should promote one type of confidence and 1 type of understanding. So, here are some different suites and for each suite Justin went through the user, what the understanding and confidence were, tips, and warning signs.

First up was the safety suite. The safety suite is for the browser It checks does the app work and is our product simple. If the tests do not fit inside 30 minute or if you can’t write a new test within 30 minutes then your product probably isn’t simple. These tests shouldn’t see the internal apis. They should bind to what is visible by the user and they should enforce a fixed time-budget. The warnings here are that failure from refactors are often false negatives here and that human intuition overvalues realistic tests. On this type of test suite, numerous releases and branches can get expensive and there is the idea of the superlinear slowdown meaning that the bigger the system, the slower the tests.

Next comes consumption tests You should verify behavior and demonstrate usage with these types of tests. The user is the repo’s customer and they are used to verify what you, as the programmer, is directly responsible for. It says, is this code usable? If it’s hard to test, it’s probably hard to use. For these the module boundaries should be meaningful beyond testing (ie- these things talk to each other so they should be tested together). It should fake all the dependencies. It should exercise the public, not private apis. And finally, it should be organized by the consumer’s goals and outcomes. Warnings-wise, these tests need to be fast and this is the only part of the suite that tells you “you just broke something”.

The next tests suite are contract tests. Contract tests are used by us. They represent our interests that live in someone else’s repo. It leads to faster feedback making sure that something in the system that someone else is working on, doesn’t break something you’re working on. For these, they should be written for first party dependencies and follow the same rules as consumption tests. These are NOT a replacement for actually going and talking to your fellow dev about what they’re working on.

Next is TDD. So, so far, in all these tests suites, none have talked at all about the design of the code. The main value in TDD-ing is to discover tiny, consistent bit that help with big projects. The user is someone concerned with implementation details and the inputs and outcomes. These tests are a sounding board and enable you to have confidence in building small things and learning about what roles our code is playing. Here, he showed a cool chart that had interesting structural points related to putting queries on the left, logic in the middle and commands on the right… reminded me a bit of east-oriented code structures. He also stated that commands and queries should have very little logic. The warning here is that discovery tests yield small disposable units so be okay with throwing stuff away.

Next are adapter tests (whoever knew there could be so many different kinds of tests suites!) These tests exercise the adapter API under just realistic enough circumstances. It warns us of outages or API changes. These tests also reduce the cost of swapping dependencies later. For these, don’t test them first and trust the framework. These are similar to contrat tests but contract tests improve communication between colleagues whereas these tests improve the feedback between your code and the 3rd party code. Last warnings are that these tests can be slow and outside of your control and that they can be tricky if you’re using some sort of CI.

Phew! that was that talk.

One note is that my confusion still lies a bit in integrating all of these different types of tests. Should an apps test suite have all of these things? What does it look like structurally? Are they in the same files or different files? But I think the idea of thinking about all of these different suites and the goals of tests and testing is pretty cool.

Production code analysis by Dan was a great talk. Dan talked about code cleanup and how to look at a monorail (single large application) and refactor/delete effectively. You want to look at what code is being run to allow for good code cleanup and that lots of these monorails have dead code. Some overarching tips are to celebrate clean up commits as a team and to start by finding large unused code sections by finding unused actions. There are a handful of tools he talked about to help find this dead code. First you can use new relic which can show you for any given endpoint, how often is it being hit and then you can do a route check to see what routes are completely unused. You can also use tools like graphte, statsD and redis to find unused actions. For example, statsD is pretty easy to implement, has lots of info from Etsy’s blog, and can be used to see both timing and emdpoint information. You can look at background jobs in redis to see which jobs aren’t being triggered at all and what events are related to those jobs.

For mailer, you can see which is the most popular and least popular mailers by hooking statsD into active mailer. Finally, if you find the actions not being triggered, you can often delete the related views that aren’t being rendered any more.

Another good place to look is at translations. Which translations are in memory but aren’t being used anymore? Use the gem humperdink to track these translations. Finally, you may have two methods that are doing the same thing in your code. For this, learn which is best by wrapping the methods in a split. Wrapping them in a split and tracking them with statsD will tell you which method is faster or more effective and allow you to make data-driven decisions.

Lastly, Dan talked about logs. Logs are great for cleaning up code. Logs should be searchable and in one place. You should try to standardize the log format and multiple apps that communicate should be in the same system. Once you’ve got good logs, you can do log queries or check out endpoints to see what’s arriving to them. For this, check out the gem imprint.

Russ Olsen spoke about going to the moon! Wait for this talk to come out on video. I had to leave about 15 minutes early which was a bummer but he’s such a good storyteller, I was on the edge of my seat the whole time.

Sunday, May 25, 2014

Interesting Reads 5/17 - 5/23

Lots of really great links this week. There are a few more RailsConf talks since I had a chance to watch a few more of those this week. Some great posts on terminal and keyboard shortcuts and tricks, and some fun team-related posts.

Enjoy!


Amazing tips and tricks in this post for keyboard shortcuts.

AND amazing tips for terminal in this one.

Leading a team is really hard. Jessie does a great job talking about some of the ways to actually be a GOOD manager.

Some great tools and thoughts for thinking from railsconf.

Love this! https://speakerdeck.com/aviflombaum/20-things-i-love-about-code

A really interesting talk about imposter syndrome

I've always looked at the stages of group development in the context of leadership groups and immersion experiences but this is an interesting post on the high performing team dynamic in programming

Does the size of a team affect the quality? This post talks about some of the data behind it.

Monday, March 31, 2014

Snappy Means Happy



Matthew Beale gave us a lot to think about and showed me a bunch of tools I had no idea existed in this talk about performance. He started by giving us some good things to think about… mainly, what does fast mean to you? He showed different speeds and what that would mean in terms of actually viewing an app (ie- animations, etc.). You can use that “fastness” scale to then look at your code and see what piece is taking the longest. Is it the network? The javascript? Or the render? Thinking about each of these and looking at times for each part help you narrow down what tools to use and what part needs to be made snappier.

When you’re ready to dive into performance and have pinpointed what part needs working on, then you can move on to the recommended methodology. This is 1) gather the facts and isolate the problem. 2) analyze and theorize about what’s going on. 3) change a single thing… if you change a bunch of stuff and performance is better then you don’t actually know what made the difference. And 4) confirm the theory. The example Matthew used was loading the ember.js website on your phone.

So, first you need to reproduce the immobile latency reliability… in this case you can use slowyapp, Charles, or network line conditioner. You then create a clean browser (this was also a new concept to me) which means you have no extensions, a private window and therefore nothing interfering with the site you’re working on. Then you measure and analyze in the network inspector. In that inspector you can check out the timings tab which gives you a bunch of information.

Part of that information shows us that if you look at the timeline, you can see the load order of things and how long each element is taking. Here, you end up being able to move a script tag which makes the page’s load time much faster.

Next, we looked at “janky” animation. To solve this issue, you first need to understand browsers, then you measure with the timeline tool (another one of the inspector tabs). You can highlight a specific section to get more information about it. You can look at frames which show how long something takes to get to the screen. Green = paint, yellow = javascript, clear = upload to GPU, compositing. AND THEN, render console has a bunch of additional tools you can use to record and generate the data.

If you’re a little lost on where all these tools are and how to access them, the slides show it all pretty clearly.

Also, at this point in my notes I had written “OMG, so many tools!” which I thought was worth sharing here.

In this case, the solution to the issue is a webkit transform that keeps it on the GPU and then uploads the whole thing to the graphics card. By adding a Z translation to the animation, it forces the GPU to say this is 3D and should be put on the graphics card.

Finally, we talked about ember.js property change notifications. For this methodology, first you need to understand observers and then look at the profiler. Observers are synchronous and fire when a set thing occurs. There are two options .setProperties or Ember.run.once. Then you look at the profiler. The profiler has processing and memory. You run a profile and get back information in form of a flame chart. A flame chart allows you to see the stack that is being run. In the list view you can use the profiler to pinpoint the issue. Here, you refactor to create a buffer instead of pushing items into an array which fires 1 change notification instead of many.

The important thing to remember here is to have a methodology to solve issues, to remember that web performance does not equal ember performance and that there are a heck of a lot of awesome tools you can use to help you out.

Sunday, March 30, 2014

Modeling the app store and more


This session was a really cool session that showcased what ember can do and something that was build with ember as opposed to diving into a specific tool or component of the framework. Presented by Jeremy Mack, the talk was about how he used tapas with ember and built a search engine without a server. Jeremy looked at the app store and was annoyed with the silly popup links and the lack of good functionality in the app store.

The first issue he discussed was that there are lots of different data types in the app store. The core model is the iTunes item and an iTunes item has data like price, artwork, name, etc. Everything else inherits from iTunes item.

Jeremy then talked about mixins, which let you encapsulate functionality and reuse them. Mixins are kind of like components (I think) but components focus on the template and what you see whereas mixins focus on properties that can be added to other classes. The app mixin that was created are comprised of things that ALL apps have. These are aspects like screenshots, version, developer, and more. Then there is a genre mixin, and other mixin types. The app uses different mixins depending on if the iTunes item is a song, app, movie, or other option.

Then there is an adapter. The adapter is code that talks to a specific endpoint. In addition, there are then serializers. The serializers turn the adapter stuff into the format that you want it in.

Going back to talking about the iTunes item… it has classifies, polymorphism and sideloading. Classifiers are different properties that we know about. There’s a top charts serializer which uses the ID to transform the top charts data into the correct format. Then there are also relationships which map the parent-child relationships using ember data. It also maps the other data (ie- bringing into the app view information from youtube, rotten tomatoes, etc.). There is a fetcher which is defined in the controller. It takes care of pagination (custom built in this app), uses the identity map to de-duplicate, looks at required params, max results, etc.

Finally, in the templates for the app, there were lots of partials utilized, which is interesting. And as a sidenote, he uses fastclick to optimize the touch response.

Finally, here’s the app! It’s amazing so check it ou: fnd.io

Saturday, March 29, 2014

Animations and Transitions

Can you believe that at this point we were only like half way through the first day?! I’m amazed at how much was covered so quickly.

The next talk was about animations and transitions. I have to admit, after the last couple of talks where I hadn’t yet had much hands-on experience with those tools, I was really excited for this one. The project I’ve been working on has had some animation and transition difficulties so I was interested in hearing why these transitions were potentially so complex and get some good ideas for moving forward.

The talk was give by Edward Faulkner. The talk “slides” are basically an awesome demo that you can continue to use as you experiment with different transition and animation types.

Ember animations fall into 2 categories of simple and complex. Simple animations are those that occur in the same route.

Sample: {{animate-changes of=how }}: this separates how I’m animating versus what I’m animating and then the actual animation happens in the css.

There are also components that have a toggle animated class which can have current and next specified.

<div>
  <div class="next">{{next value}}</div>
  <div class="current">{{current value}}</div>
</div>


In an ember component, you can also have a bound property. You can use bound properties to show what is happening (in the case of the demo- the font size is a bound property). You can track the state and bind it.

You can also have an animated if helper. Here, you can have a computed property in the controller that is related to the animated helper and in the template, you can dictate how to represent these situations.

The more complex animations are those that go between routes. These are much more difficult and there is no drop-in library that solves this. You need to figure out how to coordinate the transition and animation between the views, templates, controllers and routes. Referring to the slid e showing the parent to child transition, we're looking at a nested route. The parent route stays rendered and the parent controller has a computed property looking for the details controller, which can flip the class and trigger the css transition. This is a mouthful but it makes sense. Going back is a much more complicated story. One way to solve this is to enact willTransition. The example for this is in the presentation slides. I highly recommend checking it out because I don’t have notes from this part which means I was too fascinated by what was going on to write down the steps.

The last part of the talk discussed modals. A modal has a state and URL that is not tied to the route. But modals can be used with query params to bypass the router and go directly to the controller meaning that rendering the modal has its own css rules. BUT be careful because you need to animate the modal away as well which is more difficult. Just clicking on “back” or “ok” doesn’t animate it away, it just takes it away. At the end, a few mobile specific concerns were mentioned as well.

Wednesday, March 26, 2014

Being a Healthy Programmer

Health issues. Something we all face as developers but is not really talked about. Being a developer comes with some very specific health concerns that are different than what I’ve experienced in other fields. As I’ve learned to code over the past year, I’ve gotten a lot of advice and learned a lot of best practices. None of this advice, however, has included anything related to health! All of a sudden, I was coding full time and experiencing all these new issues and I had no idea why. We all experience similar physical pains of transitioning into a new industry but it's one of the things I think isn't discussed adequately enough to prevent it from happening. Additionally, a lot of the solutions cost money, which may be something you don't have a lot of if you are going through a career transition, coming out of a bootcamp, or just in the beginning of your job. In speaking to others, I found that most of the stuff I was experiencing are really common among developers. I sent out a request to understand what people experience and what some solutions are and here’s what I got.


Eyes. Obviously looking at a screen that is two feet away from your face all day has got to have some serious long term effect. Additionally, if you don’t have the right prescription then you’re also probably dealing with some sort of eye strain.

Back. Posture and sitting up straight is really important. Long term affects can include needing physical therapy, surgery or just constant pain.

Headaches. I know a few people (including myself) that have been experiencing afternoons headaches. There are LOTS of things that can affect headaches including hydration, food, eye strain, muscle aches, and more.

Hydration. Turns out we all forget to stay hydrated during the day. Between coffee intake (which actually dehydrates you) and getting so focused on work that we forget to make sure we’re drinking, this is a major issue (that can, of course, relate to other things on this list like general draining, back pain, and headaches).

Food. What?! You forgot to eat again? Me too! I can’t even count the number of times I’ve looked up from my computer and realized it’s 2pm and I haven’t had breakfast or lunch yet. Obviously, not a healthy practice.

Sleep. “Just 5 more minute and I’ll be able to solve this issue and close my computer.” I’ve said this to a friend or my husband so many times. We tend to try to power through problems, drink coffee or energy drinks to push that last bit of code to production, or just accomplish a little more by working through the night which is solid, uninterrupted time. This is also related to something someone called “sleep creep” (which I love). Instead of working through the evening, some developers will get up at 4:30am, have some solid morning work time and then have to check out for a bit in the afternoon for a nap or to recharge.

Weight Gain. We sit. A lot. Like all day. There are lots of ways exercising can affect other things on this list, but weight gain and circulation from sitting all day can definitely be harmful and a tough pattern to break out of.

General draining. What we do involves a lot of brain power and a lot of thinking. It is easy to get exhausted and it’s easy to finish the day and just want to get the easiest thing for food and sit on the couch to unwind. This isn’t so much a solution, but a good article that goes into this issue further.

Hands. There’s lots of concern about repetitive strain and carpal tunnel syndrome. This is definitely an issue that, as a newbie I don’t think about much but as someone getting started in a longterm development career, I probably should.

(Thanks to @vicfriedman, @pamtaro, @embryoconcepts, @robyurkowski, @tundal45, @stevenhaddox, @_ZPH, and @peterbroderick for your help and mentioning issues you’ve faced or are concerned about)

So, how do we improve out situation? It’s great to offer solutions like a standing desk, complex raised screen setup, and other such tools but these tools are expensive! Here are some cheap ways we can solve these issues.

“Pretend” standing desk. My first standing desk was literally 3 boxes stacked on top of one another to give me computer a little bit of height.

Pomodoroing. Following the pomorodo work style basically means that you do focused work for a specific amount of time (usually 25 minutes) and then you take a mandatory break for 5 minutes. There are lots of benefits to doing this but I find that it makes me more aware of myself. When I have a forced break, I make myself drink water, use the restroom during the break. I also find that when I break every 25 minutes, I’m way more aware of my posture and actively correcting my slouchiness.

F.lux. This app helps alter your computer screen lighting based on the time of day. I wasn’t so much a believer until I started using it but the gradual deletion of blue light from your screen helps you mind get ready for sleep even if you’re still using your computer.

Posture exercises. This is one a friend passed along to me. I also recently saw an app that focuses on alerting you when you aren’t holding good posture.

Exercise in general. I’m lumping standing versus sitting into this category as well. Exercise is always tricky to make time for but it is definitely an important part of being a developer (I reluctantly type as someone who really hates going to the gym). Put GYM in your calendar.

And finally, there’s the Healthy Programmer book which I haven’t read at all, but I’d bet it’s pretty informative.

I’ll be honest, I’m not the best at following all of these. I haven’t found good boxes to make a standing desk, I only successfully pomodoro’ed once in the past 3 weeks, but being more aware of these issues motivates me to make sure I’m establishing best practices for my health. And of course I’m hoping in the near future to be able to purchase the things I need to make my home office and work situation even better (ie- the chair I use is like the worst chair for programming EVER).

Got more issues, suggestions, and cheap alternatives? Leave them in comments below.

Tuesday, March 18, 2014

So Many Random Learnings

I love learning and in the past few weeks, I've learned so much!! In lieu of a more organized post on this stuff, here’s a random smattering of what I’ve learned the last few weeks.

Ls –lM lists everything in list form
Git rebase –i sha is what you use in order to squash commits

Git rebase master… I’m still learning the process and exactly how to troubleshoot this but it seems standard in worksflows that require pull requests and it’s pretty interesting to solve merge conflicts.

Debugging (with capybara): insert a save_and_open_page to see what page/path opens

Alfred workflows are amazing. I’m trying to train myself to use my mouse less. My wonderful mentor suggested that instead of going cold turkey on the mouse, I should start by getting good at just a few things. So, I’m starting with Alfred workflows and trying to get better at not using my mouse within my text editor (sublime).

Alfred workflows that I have set up include spotify, dash, and being able to search for any file or folder on my computer. I’ve got the git workflow partially set up.

In Sublime text, one of the most useful things I’ve learned recently is CMD + . will switch back and forth between the test file and file being tested. CMD T allows you to type to open a file. Just to name a few.
Option and highlight lets you highlight the first letter of each line


Git commit (without –m, etc.) will open your text editor so you can do the commit message there, save it, close it and it’ll bring you back to the command line and finish the commit
Git checkout – brings you back to the last branch you were on
Git rebase –i HEAD ~1 rolls back 1 commit (~2 rolls back 2 commits)

From the command line putting touch and then the path with the filename at the end will create that file

When squashing commits (which means making multiple commits into one commit), you always ‘s’ (squash) the second one

Gem railroady produces a UML diagram of your code structure

Kill process… somehow I created a connection with a server and then I created a second connection with a server and then couldn’t get one of those connections to close!
ps aux | grep finds the process so you can see if it’s running (I’ve since used this ps aux | grep ruby and ps aux | grep puma)
Then kill -9 prodID (number all the way to the left) kills it. Alternatively, you can also kill it by doing killall -9 thin (or whatever you’re trying to kill)

Friday, February 7, 2014

Interesting Reads 2/1 - 2/7

Well, it certainly has been a busy week for me. Fortunately, I've also come across some really interesting articles and things to read/watch. AND I've actually read all of the articles this week (except for the last one... it's a video I haven't had a chance to fully check out yet). There's a variety of stuff in here this week so ...

Enjoy!

Will NOT Work for shoes! I love shoes, but this is a great article about women and their workplace value.

If you've had a rough week or are a newer developer, this short post is a great pick-me-up.

Personally, I'm not very good at celebrating small wins. That, coupled with the fact that I'm getting used to a "dev" to do list, as opposed to a non-dev to do list, makes it hard sometimes to feel like I'm accomplishing greatness. This post talks about that and some great ways to reflect regularly on your work.

Okay, I lied!! I haven't had a chance to read this article about the amazing new Marvel API, but I've gotta find time soon!

On a slightly dryer note... here's some great HTML5 documentation.

In my new position, I'm learning Javascript... lots of Javascript, but Ember.js in particular. Since I'm new to it, I thought this article gave some interesting, basic pointers about the differences between some of the more popular JS languages.

A great post from Aaron based on a question asked at RetroRuby's Newbie track last week!

And to close out this week, here's a video I haven't watched yet about Postgres and things you haven't found.

Friday, January 3, 2014

Friday, December 27, 2013

Interesting Reads from the Week

I'm trying something new. I'm going to try to post interesting articles I've read (or meant to read) during the week every Friday. These articles/talks/blog posts/etc. may not have been published this past week, but it means I read or watched them this week. I'll try to also post who I heard about them from, but I didn't note that this week, so it'll be just the things I read for now.

Enjoy!

The Taxonomy of Terrible Programmers

Pairing vs. Code Review

Sublime Text Tips and Shortcuts

The Unreasonable Effectiveness of TDD

How Developers Stop Learning: Rise of the Expert Beginner

Thursday, December 19, 2013

IRC 101

IRC, internet relay chat, is one of the ways developers communicate… and something that can seem a little confusing when you first start, so here’s some IRC 101 so the next time everyone's talking about it, you'll know what's going on.

First, what is IRC? It’s basically internet chat rooms. A lot of people probably want to yell at me for that simplified explanation, but that's pretty much what it is. There are lots of different rooms based on lots of different topics. You pick a nickname when you join and then you can join different rooms and chat with people. You can also run your IRC configuration on a server which enables you to stay connected when you close your computer and read back when you are back at your computer with some time.

I personally don’t hang out in too many rooms. I’ve found that it’s also helpful to ask someone “in the know” about these channels. Some channels are super friendly. Others are really good about answering questions on specific topics or functionality (like the Pry channel). More are based around open-source projects (like the Spree channel). Finally, some channels are really unfriendly and people are kinda mean. I avoid those channels for obvious reasons.

Next, there are a few different ways to access the IRC servers. Some are more complicated and some are less. I, personally, use irssi, which accesses IRC via the terminal but can be a little complex to set up. I enjoy using irssi, however when people post gifs, they don’t show up inline, which means you have to click on them to see them, which can be a little annoying sometimes. Other options include Textual, Limechat, and Colloquy. There are various free trials and free versions, but a few are paid for. Here are some set up options from Chris and Sean . For irssi in particular, in addition to Sean's set up there are lots of additional scripts you can run to make lots of stuff happen including styling of the window, colors, replies, links, and much much more. Here's a pretty good guide to using irssi and here's an additional article abut IRC in general written by Spree Commerce. The Spree article gives even more options for accessing IRC.

Now for some basic functionality tips and tricks. When you want to join a channel, you just type /join followed by a space and the channel name. To direct a message to a specific person, just start the message with their nick name. You can even start by typing the beginning of the nickname and pressing tab to complete the name. To put yourself into a reply (like *allie_p goes to make coffee) just type /me in front of what you want to post in the chat. Finally, to send a message to someone just type /msg followed by a space and the nickname of the person you to message followed by the message you want to send. The message to that person will show up in a new window. With IRSSI, you can have multiple windows open (which means be in multiple rooms or conversations) and you can switch back and forth between them by pressing CTRL P or /win 3 (or whatever window you are trying to get to). To scroll up or down in a conversation, you use FN and then up or down arrows.

Final tips and tricks… check out http://textfac.es to learn about the weird faces you may see in the channels (I still don’t really understand half of them) and reacting gifs for great gifs to post in response to things.

If you’ve got more tips and tricks, feel free to add them in the comments!

Tuesday, November 26, 2013

RubyConf Randomness: Other things I learned that weekend

This post if all about the other random things I learned at RubyConf. Just as a note to begin, some of these items are talk-related, others are just literally random things I learned. In order to learn, I needed to ask. Don’t shy away from asking about a joke or tv character. It’s not embarrassing to even ask the small questions...I’m new to tech and therefore I don’t understand all of the star trek references or ruby jokes. Ask them!! Then you’ll be able to laugh at them in the future! It’s the little things that make a big difference.

1. Koybayashi. There’s more than one. I have a confession… I love eating contests and the sport of competitive eating. Yup, you read that correctly, eating contests. The best part of every year for me is the Nathan’s hotdog eating contest every July 4th. I love the commentators and the competitors, I know all of them and their stories and their past records. One of the most famous major league eaters is Kobayashi. He held the world record for number of hotdogs eaten for a long time until Joey "the jaws" Chestnut came onto the scene. Now, during Evan’s talk about Redis and Recommendation Engines, he had a slide about Kobayashi. This slide had no hotdogs and I was very confused. Turns out, there’s more than one famous Kobayashi. The Kobayashi he was referring to was Kobayashi Maru, (Straight from Evan!) a fictional test administered to Starfleet cadets in Star Trek. Cadets are evaluated on how they handle failure. Now that slide makes much more sense both in slide content and in placement within the presentation.

2. Talks I wish I had gone to. There are two talks that I really can’t wait to watch. These are Pat Shaughnessy’s Garbage Collection talk and Dave Copeland’s talk on branching, nil, and attributes. I saw lots of cool notes about these two sessions on twitter and heard great things from people who were at those sessions. Another note on talks, I thought the lightning talk by Andrew Harvey was really good. If he posts his slides, you should definitely check them out.

3. I didn’t do a full write up on notes from Day 3, session 3 about being an open source maintainer. I didn’t have many notes but hopefully this topic will be more relevant to me in the future. I wanted to put some little notes about it here though. Some key points I noted were the idea of rewriting the history, triaging a pile of issues when you first become a maintainer, and taking responsibility.

4. I learned about like 15 new languages while there. Seriously, who knew there were so many programming languages?! Some languages I heard of included poison, Dylan, and whitespace. I intend to fully ignore these until I’m a little more comfortable with ruby but I can’t wait to be at the point in my developer education where I can play around with these weird random languages and easily understand what’s happening.

5. The last session was a fireside chat with Matz. At some point someone asked a question about someone called Nobu and everyone laughed. For those of you who also didn’t get it, here’s what everyone was laughing at. There is a guy named nobu who has the most contributions to ruby and the running joke is whether or not he’s a bot or a real person. Apparently he’s a real person. Next time, I’ll be able to laugh too

6. I arrived late to board game night and therefore didn’t really jump into anything, but there were some really cool games being played! If you were there and remember any of the names, please leave them in comments! I’m always looking for new interesting games.

On a final note, I just want to say thank you to everyone that I met and had conversations with while at RubyConf! It was really fantastic to meet so many people doing so much cool stuff. And thank you to the organizers who put together the scholarship program! I wouldn’t have been able to go if it hadn’t been for that opportunity.

Hopefully I’ll see everyone in San Diego next year!!!

Program on my iPad?! - Day 3, Session 3

TL;DR: have you ever programmed on your phone or iPad? I haven’t but now I totally want to.

I thought this session was plus/minus (sorry Charles Wood! I still love Ruby Rogues!). My main issue with the talk is that he showed this awesome demo of actually being able to pull up the command line on your phone or iPad in order to actually program but didn’t really go into how one would accomplish this.

Charles talked about the toolbox he uses to get his development machine in the cloud. Primarily, he uses SSH, Digital Ocean, tmux, emacs, Github, and Chef. First, the SSH is configured and public/private keys are created. You can create one key for each machine or a single key for all your machines. He discussed Digital Ocean as the server he uses.

Second, he prefers to use TMux. I’ve heard a lot about tmux for pairing and how it’s a great tool when you want to pair with someone (I’ve yet to use it). For this case, however, he also liked it because you can pick up where you left off instead of having to restart something or get back to where you left off. Additionally, you can do multiple or split screens which is useful.

I didn’t write down any notes about emacs, github or chef since I have a bit of a background on those (if you ever want a great presentation on chef, hit up Nathen Harvey… he did a 10 minute “what is devops and what is chef” talk for Rails Girls a few months ago that was so amazing).

I jotted down a few notes about security, since that seems like an important issue when you’re using a phone or ipad to log into your development environment. These security suggestions included turning off the root ssh, using public/private only, having a firewall, using something like proXPN (a tunneling service) and using sudo.

The main question I had after this session was “ok, but now how do I actually get this working?!” He did a good job explaining the tools, some of which I was familiar with, others not as much and while all the tools at the end sound great. I’m still not quite so sure how they all get pulled together to let me program on my iPad. After the session, I spoke with Conrad a little bit about this and he pulled things up on his phone (which again, was really cool) and I think I understand overall how I would go about doing this. It mainly has to do with setting up the SSH and a server and I think everything else stems mostly from that. The basic steps are to 1. set up or have access to a server. 2. Install with a package manager onto the server. 3. Ssh into the server. 4. Then you have an ssh client for iPhone, like prompt, which is a terminal emulator for ssh. (I’m a little unclear on that last part, so if you do want to get into this, I’d suggest taking the basic tools listed above and then doing some additional research on the actual setup).