-
Historia:
- Eich escribió el primer prototipo de JS en 10 dias en Mayo de 1995
- Creado en poco tiempo, sin restricciones, como en Java las Checked Exceptions o en C# los metodos finales.
- JavaScript Jabber Podcast con Brendan Eich: https://devchat.tv/js-jabber/124-jsj-the-origin-of-javascript-with-brendan-eich
- Aprender JavaScript me obligó a estudiar. Kudos a Pasku por la cantidad de recursos que me pasó.
- Scheme: Higher-order functions o functors, lexical scoping
- Lo mejor es su flexibilidad, es multiparadigma
-
Douglas Crockford Lectures on JavasScript:
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <div id="cards-gui-container"> | |
| <label for="deck1">Deck1:</label> | |
| <input id="deck1"/> | |
| <br> | |
| <label for="deck2">Deck2:</label> | |
| <input id="deck2"/> | |
| <input id="whoWinsButton" type="button" value="Who wins?"/> | |
| <br> | |
| <label id="result">The winner is...</label> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System; | |
| using System.Linq; | |
| using System.Reflection; | |
| using NUnit.Framework; | |
| namespace Metaprogramming | |
| { | |
| enum Role | |
| { | |
| admin, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def sum_numbers_in(expression: str) -> int: | |
| if expression is None or expression == "": | |
| return 0 | |
| if "," in expression: | |
| tokens = expression.split(',') | |
| return int(tokens[0]) + int(tokens[1]) | |
| return int(expression) | |
| class StringCalculatorTests(unittest.TestCase): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import re | |
| def sum_numbers_in(expression: str) -> int: | |
| if expression is None or expression == "": | |
| return 0 | |
| if "," in expression: | |
| tokens = expression.split(',') | |
| total = 0 | |
| for token in tokens: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import unittest | |
| # TDD - Test-driven development. -> | |
| # BDD - Behaviour driven development - Outside-in TDD - Mocks | |
| # Inside-out TDD VS Outside-in TDD | |
| # Paso 1: Definir una buena lista de requisitos - Piensa primero cobarde. | |
| ## | |
| # Design principles: Less Astonishment/Surprise Principle |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def who_wins(cards_player1, cards_player2): | |
| ranking = { | |
| '2': 2, | |
| '3': 3, | |
| '4': 4, | |
| '5': 5, | |
| '6': 6, | |
| '7': 7, | |
| '8': 8, | |
| '9': 9, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import unittest | |
| from cards import who_wins | |
| # ToDo List: | |
| # diferente cantidad de cartas -> raise error | |
| # ['1'],['3','4'] -> raise error | |
| # cartas con invalidos, | |
| # 'W' -> raise error |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Sensor: | |
| """Lo vamos a simular""" | |
| def is_detecting_movement(self) -> bool: | |
| pass | |
| class Recorder: | |
| """Lo vamos a simular""" | |
| def start_recording(self): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import unittest | |
| from camera import Controller, Sensor, Recorder | |
| class CameraTests(unittest.TestCase): | |
| def test_asks_the_recorder_to_stop_recording_when_no_information_received_from_sensor(self): | |
| sensor = Sensor() # mocks | |
| recorder = Recorder() # mocks | |
| self.called = False |