Blog de Francisco Velázquez

otro blog personal

Shortcuts en Visualstudio para TestDriven.NET

leave a comment »

Un simple recordatorio:

TestDriveNet_shortcut

Written by fravelgue

December 2, 2014 at 3:37 pm

Posted in development

Tagged with

Quote: SacrificialArchitecture

leave a comment »

For many people throwing away a code base is a sign of failure, perhaps understandable given the inherent exploratory nature of software development, but still failure.

But often the best code you can write now is code you’ll discard in a couple of years time.

Martin Fowler.

Written by fravelgue

October 22, 2014 at 2:31 pm

Posted in Uncategorized

Ngrok en Windows

leave a comment »

Ngrok es una magnífica herramienta que nos permite publicar servicios que están alojados en nuestra máquina detrás de un firewall. Muy útil, para depurar servicios o aplicaciones web, que interactúen con otros servicios.

En mi caso lo uso para publicar aplicaciones web en IISExpress mientras desarrollo. Para ellos tenenmos que hacer los siguientes pasos.
1) Lo primero averiguar el puerto que está usando nuestra aplicación. Lo podemos ver desde IISExpress. Por ejemplo: 51234. Y decidir un dominio para ngrok, en nuestro caso example.ngrok.com
2) Permitimos conexiones externas en nuestro firewall a ese puerto:

netsh http add urlacl url=http://example.ngrok.com:51234/ user=todos

3) En el archivo: \Users\Usuario\Documents\IISExpress\config\applicationhost.config Añadir un nuevo binding para permitir conexiones externas, a nuestra aplicación buscando por su nombre.

<binding protocol="http" bindingInformation="*:51234:example.ngrok.com" />

4) Una vez hecho esto sólo tenemos que ejecutar ngrok

ngrok -authtoken TU_TOKEN -subdomain=example 51234

Y en consola veremos:
Fowarding http://example.ngrok.com -> 127.0.0.1:51234

Para acabar indicaremos como abrir varios puertos. Para esto hay que modificar el fichero:
\Users\Usuario\.ngrok Con una configuración parecida a esta:

auth_token: TU_TOKEN
tunnels:
  example:
   proto:
    http: 51234
  exmaple2:
   proto:
    http: 51235

Muy importante poner espacios, en lugar de tabuladores. Así en consola veremos:
Fowarding http://example.ngrok.com -> 127.0.0.1:51234
Fowarding http://example2.ngrok.com -> 127.0.0.1:51235

Written by fravelgue

September 2, 2014 at 5:32 pm

Posted in development

Tagged with , ,

ASP.NET WebPages Optimizar el uso de strings

leave a comment »

Interesante optimización del equipo de WebPages para mejorar como se renderizan las páginas.

Instead of creating a string from the StringWriter (_tempWriter) we will copy the underlying buffer in chunks to the output text buffer. For large pages this both reduces the total allocations to 1KB as well as avoid getting into the large object heap.

Este es un problema común en código manejado cuando se usan cadenas.

Written by fravelgue

August 13, 2014 at 4:00 pm

Posted in development

Tagged with , , ,

F# para desarrolladores de C#

leave a comment »

He estado viendo esta presentación: F# for C# developers de Øredev, que podría llamarse como agilizar las pruebas con F#. Ya que propone usar F# para facilitar las pruebas en aplicaciones que podrían estar desarrolladas en c#.

Aquí se puede ver como se define una clase:

fsharp_class_definition

Aquí como usar Nunit para hacer una prueba unitaria:

fsharp_unit_test

Sobre el min 30:39, podemos ver como hacer pruebas primero usando Fsunit y después unquote:

fsharp_unit_test_fsunit_unquote

Así mismo mostró como hacer BDD.

fsharp_bdd

Y por último como realizar Mocks:

fsharp_mocks_1

fsharp_mocks_2

Written by fravelgue

January 2, 2014 at 3:34 pm

Posted in development

Tagged with , ,

Nuevo lenguaje desde Microsoft

leave a comment »

Aunque todavía no tiene nombre estoy totalmente entusiasmado con lo que se está rumoreando del nuevo lenguaje: M#. Intentaré recopilar enlaces sobreo lo que vaya apareciendo.

Written by fravelgue

December 31, 2013 at 1:27 pm

Posted in development

Tagged with ,

Programación funcional

leave a comment »

Cierto que los lenguajes imperativos como C# están incluyendo aspectos de los funcionales, en este caso mediante lambdas y Linq. Y muchas son las opiniones a favor de este cambio de mentalidad, como por ejemplo, esta proclamando la muerte del IF.

También es muy recomendable esta serie: Refactoring to functional:

I’ve been thinking. They teach us that we need to think in terms of objects and identify these with nouns among other techniques. We then need to make sure that we name them correctly, that they’re small, that they only have a single responsibility and that they can’t have too many dependencies injected into them. And now they’re telling us that we should try and not maintain state because it’s bad for concurrency. I’m beginning to wonder, why the hell have classes at all?

Por último también incluir este punto de vista muy acertado, de la complejidad de tratar la concurrencia con lenguajes imperativos.

Written by fravelgue

December 30, 2013 at 8:33 pm

Posted in development

Tagged with ,

En desarrollo de software

leave a comment »

I would submit that the appearance of hard work is often an indication of failure

via.

Written by fravelgue

December 13, 2013 at 8:12 am

Posted in Uncategorized

Tagged with

Lenguaje D

leave a comment »

Me gusta leer las características de otros lenguajes, para compararlos con mi conocido c#. Y la verdad es que D tiene muchas cosas positivas e interesantes.

D is not a scripting language, nor an interpreted language. It doesn’t come with a VM, a religion, or an overriding philosophy. It’s a practical language for practical programmers who need to get the job done quickly, reliably, and leave behind maintainable, easy to understand code.

Por cierto tiene clases, GC, lambda functions, y tipos inmutables entre otras.

Written by fravelgue

October 12, 2013 at 10:41 am

Posted in Uncategorized

Tagged with ,

Pruebas unitarias y Dependency injection

leave a comment »

No soy un “abusón” de las pruebas unitarias pero no puedo estar más de acuerdo con lo que dice:

Unit tests don’t uncover all design problems, but they are effective with respect to cohesion and coupling issues and the rather significant principals that relate to these.

I’m no fan of the ceremony surrounding Inversion of Control and the impact some of the most popular types, like Dependency Injection, has on production code. But, having never learned the cost of low cohesion and tight coupling from unit testing, dynamic programmers often violate sound design.

via.

Written by fravelgue

September 19, 2013 at 6:31 pm

Posted in development

Tagged with , ,