What I Have Learned from Organizing Remote Internship for Ruby developers

85
Remote internship for Ruby Developers Ivan Nemytchenko, @inem Developer Advocate at GitLab http://inem.at

Transcript of What I Have Learned from Organizing Remote Internship for Ruby developers

Page 1: What I Have Learned from Organizing Remote Internship for Ruby developers

Remote internship for Ruby Developers

Ivan Nemytchenko, @inem

Developer Advocate at GitLab

http://inem.at

Page 2: What I Have Learned from Organizing Remote Internship for Ruby developers

Software developer since 2002

Page 3: What I Have Learned from Organizing Remote Internship for Ruby developers

2008

Page 4: What I Have Learned from Organizing Remote Internship for Ruby developers
Page 5: What I Have Learned from Organizing Remote Internship for Ruby developers
Page 6: What I Have Learned from Organizing Remote Internship for Ruby developers
Page 7: What I Have Learned from Organizing Remote Internship for Ruby developers
Page 8: What I Have Learned from Organizing Remote Internship for Ruby developers
Page 9: What I Have Learned from Organizing Remote Internship for Ruby developers
Page 10: What I Have Learned from Organizing Remote Internship for Ruby developers
Page 11: What I Have Learned from Organizing Remote Internship for Ruby developers
Page 12: What I Have Learned from Organizing Remote Internship for Ruby developers
Page 13: What I Have Learned from Organizing Remote Internship for Ruby developers
Page 14: What I Have Learned from Organizing Remote Internship for Ruby developers
Page 15: What I Have Learned from Organizing Remote Internship for Ruby developers

→ SOLID principles→ Design partterns

→ Refactoring techniques→ Architecture types

→ Code smells identification

Page 16: What I Have Learned from Organizing Remote Internship for Ruby developers

"From Rails way to modular

architecture"

"Stop being Rails Developer"

Page 17: What I Have Learned from Organizing Remote Internship for Ruby developers

RailsHurts.com

Page 18: What I Have Learned from Organizing Remote Internship for Ruby developers

Don't be the best student in class

Page 19: What I Have Learned from Organizing Remote Internship for Ruby developers
Page 20: What I Have Learned from Organizing Remote Internship for Ruby developers
Page 21: What I Have Learned from Organizing Remote Internship for Ruby developers
Page 22: What I Have Learned from Organizing Remote Internship for Ruby developers

What intern gets:→ project in portfolio

→ development from idea to production→ teamwork experience→ remote work experience

Page 23: What I Have Learned from Organizing Remote Internship for Ruby developers

Technologies

→ Twitter Bootstrap→ Haml, Sass, jQuery

→ Rails, Sinatra or Lotus(Hanami)

Page 24: What I Have Learned from Organizing Remote Internship for Ruby developers

Requirements→ basic ruby/rails knowledge

→ 20 hours/week min

Page 25: What I Have Learned from Organizing Remote Internship for Ruby developers
Page 26: What I Have Learned from Organizing Remote Internship for Ruby developers
Page 27: What I Have Learned from Organizing Remote Internship for Ruby developers

Need a test to choose the best!

Page 28: What I Have Learned from Organizing Remote Internship for Ruby developers
Page 29: What I Have Learned from Organizing Remote Internship for Ruby developers
Page 30: What I Have Learned from Organizing Remote Internship for Ruby developers

Test → Aptitude test

Page 31: What I Have Learned from Organizing Remote Internship for Ruby developers

Part 1 requirements→ registration

→ list of products→ create product→ show product

Page 32: What I Have Learned from Organizing Remote Internship for Ruby developers

Part 2

Page 33: What I Have Learned from Organizing Remote Internship for Ruby developers

Part 2

Page 34: What I Have Learned from Organizing Remote Internship for Ruby developers

Part 2→ 3 different types of users→ different registration forms→ different types of products→ different permissions

Page 35: What I Have Learned from Organizing Remote Internship for Ruby developers

Part 3

Page 36: What I Have Learned from Organizing Remote Internship for Ruby developers

Part 3→ Ability to "purchase a product"

→ Work with external API→ Complicated "purchase" logic

Page 37: What I Have Learned from Organizing Remote Internship for Ruby developers

Final result:

Page 38: What I Have Learned from Organizing Remote Internship for Ruby developers

validates :avatar, presence: true, if: "role == Role.with_name(:shop) || role == Role.with_name(:administrator)"

validates :password, length: { minimum: 10 },if: "role == Role.with_name(:administrator)" validates :name, :last_name, :passport_photo, :birth_date, presence: true, if: "role == Role.with_name(:administrator)"

validates :shop_title, presence: true, if: "role == Role.with_name(:shop)" validates :password, length: { minimum: 8 }, if: "role == Role.with_name(:shop)"

validates :password, length: { minimum: 6 }, if: "role == Role.with_name(:user)"

Page 39: What I Have Learned from Organizing Remote Internship for Ruby developers

def buy @product = Product.find params[:id] if @product.pro or not @product.user.is_a? Shop or current_user.email.split('.')[-1] == 'com'

flash[:alert] = "You can't buy this product" else photos = RestClient.get 'http://jsonplaceholder.typicode.com/photos/' photo = JSON.parse(photos).sample thumbnail = photo['thumbnailUrl'] url = photo['url'] thumbnail_color = thumbnail.split('/')[-1].to_i 16 url_color = url.split('/')[-1].to_i 16 if thumbnail_color > url_color flash[:alert] = 'An error happened' BuyMailer.admins_buy_fail(current_user).deliver_now! else flash[:notice] = 'Success' BuyMailer.user_buy_success(current_user, url).deliver_now! todos = RestClient.post 'http://jsonplaceholder.typicode.com/todos', {} todo_id = JSON.parse(todos)['id'] BuyMailer.admins_buy_success(todo_id).deliver_now! end end redirect_to :back end

Page 40: What I Have Learned from Organizing Remote Internship for Ruby developers

def buy @product = Product.find(params[:id]) if current_user.can_buy? if @product.sell_able? photo_url = get_photo if photo_url.nil? flash[:alert] = "Sorry, _you_ can't buy this product. Try again later" AdministratorMailer.buy_error(current_user.email).deliver_later redirect_to :back else post = HTTParty.post("http://jsonplaceholder.typicode.com/todos") post_id = post['id'] AdministratorMailer.successfull_buy(post_id).deliver_later UserMailer.successfull_buy(current_user, photo_url).deliver_later redirect_to(:back) end else flash[:alert] = "Sorry, we can't sell _this_ product" redirect_to :back end else flash[:alert] = "Sorry, _you_ cant buy _anything_" redirect_to(:back) end end

Page 41: What I Have Learned from Organizing Remote Internship for Ruby developers

Common mistakes:

1. Ignoring levels of abstraction2. Gemification

3. Nowbody knows about service objects4. Put business logic in random places

5. Bad naming

Page 42: What I Have Learned from Organizing Remote Internship for Ruby developers

Next steps:

1. Group hangout codereview2. Lecture about patterns

3. Refactoring4. Cross code review

Page 43: What I Have Learned from Organizing Remote Internship for Ruby developers

Project work

Page 44: What I Have Learned from Organizing Remote Internship for Ruby developers

Project work:

Results

Page 45: What I Have Learned from Organizing Remote Internship for Ruby developers

railshurts.com/quiz

Page 46: What I Have Learned from Organizing Remote Internship for Ruby developers

Internship automatization

Page 47: What I Have Learned from Organizing Remote Internship for Ruby developers

github.com/lenshq

Page 48: What I Have Learned from Organizing Remote Internship for Ruby developers

Problems

Page 49: What I Have Learned from Organizing Remote Internship for Ruby developers
Page 50: What I Have Learned from Organizing Remote Internship for Ruby developers
Page 51: What I Have Learned from Organizing Remote Internship for Ruby developers

Problems→ collective irresponsibility→ inability to communicate

→ lack of motivation→ a lack of mentors

Page 52: What I Have Learned from Organizing Remote Internship for Ruby developers
Page 53: What I Have Learned from Organizing Remote Internship for Ruby developers

BURNOUT

Page 54: What I Have Learned from Organizing Remote Internship for Ruby developers

Mistakes→ Making it free?

→ Too big teams (2 is enough)→ Allowing everyone to participate in

projects

Page 55: What I Have Learned from Organizing Remote Internship for Ruby developers

Worked out not so well:

→ Project work

Worked out well:

→ Aptitude test

Page 56: What I Have Learned from Organizing Remote Internship for Ruby developers

Today

Page 57: What I Have Learned from Organizing Remote Internship for Ruby developers

Junior needs→ real tasks to work on

→ some achievment to put into portfolio

→ whole development cycle experience

→ team work experience

Page 58: What I Have Learned from Organizing Remote Internship for Ruby developers
Page 59: What I Have Learned from Organizing Remote Internship for Ruby developers
Page 60: What I Have Learned from Organizing Remote Internship for Ruby developers
Page 61: What I Have Learned from Organizing Remote Internship for Ruby developers
Page 62: What I Have Learned from Organizing Remote Internship for Ruby developers
Page 63: What I Have Learned from Organizing Remote Internship for Ruby developers
Page 64: What I Have Learned from Organizing Remote Internship for Ruby developers
Page 65: What I Have Learned from Organizing Remote Internship for Ruby developers
Page 66: What I Have Learned from Organizing Remote Internship for Ruby developers
Page 67: What I Have Learned from Organizing Remote Internship for Ruby developers
Page 68: What I Have Learned from Organizing Remote Internship for Ruby developers
Page 69: What I Have Learned from Organizing Remote Internship for Ruby developers

Seniors

Page 70: What I Have Learned from Organizing Remote Internship for Ruby developers

→ routine tasks→ research tasks

→ nice to have features→ low priority features

→ missing features in their favorite open source

project→ side project ideas

Page 71: What I Have Learned from Organizing Remote Internship for Ruby developers
Page 72: What I Have Learned from Organizing Remote Internship for Ruby developers
Page 73: What I Have Learned from Organizing Remote Internship for Ruby developers
Page 74: What I Have Learned from Organizing Remote Internship for Ruby developers
Page 75: What I Have Learned from Organizing Remote Internship for Ruby developers
Page 76: What I Have Learned from Organizing Remote Internship for Ruby developers
Page 77: What I Have Learned from Organizing Remote Internship for Ruby developers
Page 78: What I Have Learned from Organizing Remote Internship for Ruby developers
Page 79: What I Have Learned from Organizing Remote Internship for Ruby developers
Page 80: What I Have Learned from Organizing Remote Internship for Ruby developers
Page 81: What I Have Learned from Organizing Remote Internship for Ruby developers
Page 82: What I Have Learned from Organizing Remote Internship for Ruby developers
Page 83: What I Have Learned from Organizing Remote Internship for Ruby developers
Page 84: What I Have Learned from Organizing Remote Internship for Ruby developers

If I do it again:

→ more "tests"→ call for mentors

→ turn mentor's experience into their "tests"

→ reject newbies

Page 85: What I Have Learned from Organizing Remote Internship for Ruby developers

[email protected]

@inem