programmers slang

Download Programmers slang

Post on 28-Nov-2014

1.117 views

Category:

Technology

3 download

Embed Size (px)

DESCRIPTION

In modern programming, developers frequently use and follow some principles to become better and produce quality code. This is a talk to introduce yourself to the acronyms that we have encountered most often while writing our day to day code. We will give examples, discuss what they mean and how to follow things like DRY, KISS, TDD and many more.

TRANSCRIPT

  • 1. PROGRAMMERS SLANG Frequent acronyms
  • 2. BOB CRIBBS Python I Ruby I iOS f bocribbz t bocribbz in bocribbz GitHub bocribbz slide share bocribbz http bocribbz.com
  • 3. FLOS /s/
  • 4. FLOS Free Libre and Open Source This is not something that you will hear too often, but its a good concept to follow. ! The programmers community is huge and a lot of them have tons of things to share, so why not join them?
  • 5. API / p /
  • 6. API Application Programming Interface Denes the way software applications can interact with each other.
  • 7. CRUD /krd/
  • 8. CRUD Create Read Update and Delete These are the basic operations for persistent storage. ! Its implementations are found in database systems and in API actions.
  • 9. ORM / r em/
  • 10. ORM Object-Relational Mapping A technique for converting data between incompatible type systems in OOP languages. ! Some web frameworks implement their own ORMs for mapping to different database systems using the same structure.
  • 11. MVC /em v s/
  • 12. MVC Model View Controller It refers to a pattern for storing and interacting with information.
  • 13. MVC Model: refers to storing the information, usually the database layer. ! View: how the user sees the information (eg HTML). ! Controller: performs various operations to produce the expected output or modify the information.
  • 14. MVP /em v p/
  • 15. MVP Minimum Viable Product Represents a strategy used to release a new product with the least needed functionality in order to produce feedback from clients and enhance it later.
  • 16. SaaS /sas/
  • 17. SaaS Software as a service / Service Oriented Architecture Represents a software architecture where all components are designed to be services. ! Which means, the web is a client/server architecture.
  • 18. SaaS It has 3 demands on the infrastructure: ! Communication: allow customers to interact with service ! Scalability: new services can be created rapidly to handle load spikes ! Dependability: service and communication continuously available 24x7
  • 19. TDD /t d d/
  • 20. TDD Test-Driven Development Is a programming strategy that consists of short cycles, where tests are written rst and the actual implementation comes second. ! Its especially useful to ensure code quality. ! A frequent strategy used with TDD is Red-Green-Refactor.
  • 21. TDD def test_my_profile(self):! response = client.get(/myprofile/)! assert response.code == 302! ! def my_profile(request):! return redirect('/login/')! def test_my_profile(self):! response = client.get(/myprofile/)! assert response.code == 302! def my_profile(request):! if not request.user.is_auth:! return redirect('/login/')! return 'OK'! ! ! ! ! ! ! user = UserFactory(foo, pass)! client.login(foo, bar})! response = client.get(/myprofile/)! assert response.code == 200! def test_my_profile(self):! user = UserFactory(foo, pass)! client.login(foo, bar})! response = client.get(/myprofile/)! assert 'Hello foo' in response ! ! ! ! ! ! ! ! ! ! ! def my_profile(request):! if not request.user.is_auth:! return redirect('/login/')! return 'Hello %s' % request.user
  • 22. BDD /b d d/
  • 23. BDD Behavior-Driven Development Is a technique introduced to ensure that the software is doing what the client expects, while at the same time maintaining code quality. ! Behaviors had to be dened rst and implementation had to follow them, by providing test rst and only then writing the actual code.
  • 24. BDD As a registered user I can visit my profile page.! def test_my_profile(self):! response = client.get(/myprofile/)! assert response.code == 302! ! user = UserFactory(foo, pass)! client.login(foo, bar})! response = client.get(/myprofile/)! assert 'Hello foo' in response
  • 25. FIRST /frst/
  • 26. FIRST Fast Independent Repeatable Self-checking Timely These are properties that a good test has to meet in order to be useful and effective.
  • 27. FIRST Fast: it has to run quick ! Independent: a test has to be able to be executed isolated and not rely on other tests. ! Repeatable: a test can be executed anytime and the outcome will still be the same. ! Self-checking: it must automatically detect if it passed ! Timely: refers to test being written before code (TDD)
  • 28. FIRST - FAST Fast means fast...
  • 29. FIRST - INDEPENDENT def test_my_profile(self):! self.client.post(register, ! {user: foo, pwd: bar})! client.login(foo, bar})! response = client.get(/myprofile/)! assert 'Hello foo' in response def test_create_user(self):! self.client.post(register, ! {user: foo, pwd: bar})! [...]! ! def test_logged_in(self):! client.login(foo, bar})! response = client.get(/myprofile/)! assert 'Hello foo' in response! !
  • 30. FIRST - REPEATABLE def test_last_login(self):! tdelta = datetime.timedelta(days=1)! today = datetime.today()! ! user = UserFactory(foo, pass)! user.last_login = today - tdelta! ! tdelta = datetime.timedelta(days=30)! since = today - tdelta! assert user in User.objects.filter(! last_login > since)! def test_last_login(self):! ! tdelta = datetime.timedelta(days=1)! today = datetime.today()! user = UserFactory(foo, pass)! ! ! user.last_login = 2013-09-01! ! since = today - tdelta! assert user in User.objects.filter(! last_login > since)!
  • 31. FIRST - SELF CHECKING def test_last_login(self):! tdelta = datetime.timedelta(days=1)! today = datetime.today()! ! ! def test_last_login(self):! tdelta = datetime.timedelta(days=1)! today = datetime.today()! ! user = UserFactory(foo, pass)