Monthly Archives: November 2011

Visual Studio Achievements: Who needs clean code anyway

I stumbled upon Visual Studio Achievements this morning via Maarten. The idea of combining development with game play might be enticing to some and as others have pointed out, could be a way to introduce younger generations to development and potentially get them interested. As such, the idea in itself is not an issue. What is however disturbing is the point system.

image

If you look carefully at the entries, you find that not only do some of them promote bad practices which lead to horrendous maintenance nightmares like the Region Manager

image

but a few of them are even geared more around selling higher end versions of the tool.

image

Were are the points for writing a Unit Test? Or keeping the number of lines in a method low?

As many of us have learnt ourselves through our mistakes, and are somehow trying to guide others in finding better ways to develop and write cleaner code, we are suddenly confronted with something that entices developers in the opposite direction. To those companies who waste millions having to maintain bad code or rewrite systems, this is not a game.

As it stands currently, that leaderboard should probably be renamed to “Hall of Shame”.

If this a joke, or the achievements points are not real, it would be a great opportunity for MS to really think through how they go about promoting this and what really does constitute a point.

ReSharper Settings in 6.1

This post is about ReSharper 6.1. For features in 6.0, please see previous posts introducing ReSharper 6:

 

EAP Warning: This post is based on ReSharper 6.1 Early Access Program and some things such as screenshots and minor details might vary from the time this has been written to the time of release.

 

This is a first in a series of posts about some of the new options available in terms of settings with ReSharper 6.1.

 

One of ReSharper’s pain points has always been settings, specially when it comes to managing them across projects and/or teams. With ReSharper 6.0 we started to make changes to build in support for a new way to manage settings, but unfortunately due to time constraints, we could not get it done in time for the 6.0 release. It has however made it into the 6.1.

Unified Settings Storage

An important change is that all settings have been unified into a single storage mechanism. This means that when you load or save settings, they apply to everything, from code style to templates, patterns and naming conventions. This should make it easier than before where different things were stored in different places.

 

Settings for every scenario

Everyone has their own style and methodology of working. Some like to name their properties in a certain way, others don’t like to be explicit about their privates. Some use underscores, others don’t. Some like the var suggestions. Others despise it. We are all different.

When it comes to working together, we have to make compromises and settle in a series of settings and ways in which to work. One day, hopefully, we won’t have this limitation and it will be transparent to us, but until then we need to find a way to not only cope with it but define it.

This scenario is very apparent when working on a team, but even as a solo developer, we can still require different settings based on different factors. We can be working on private projects that follow our own standards or be part of an open source team that follows the standards for the OSS project.

 

We hope with ReSharper’s new settings we can try and accommodate different scenarios. Let’s cover a few of the simpler ones.

 

Single developer and same settings for all solutions

If you are a solo developer or like to have the same settings across every single solution, then you won’t notice much difference in how you save your settings. You access the settings using the regular ReSharper | Options dialog and once done you press the Save button

image

 

These are also known as ReSharper Global Settings and are stored in

%AppData%\JetBrains\ReSharper\vAny\GlobalSettingsStorage.DotSettings

making them easily accessible for backup and restore as well as persistence during upgrades.

 

Different private settings on different solutions

Sometimes we’d like to have different settings based on different solutions, even if we are not necessarily sharing these settings with a team. We’ve made this scenario quite simple too. Once again we open up the ReSharper | Options dialog and make the required changes. This time however, instead of clicking on the Save button, we click on Save To and select  %SolutionName% Solution  – Private where %SolutionName% varies based on the active solution

image

 

This will create a file called %SolutionName%.SLN.DotSettings.user in the solution folder (in our case ConsoleApplication2.SLN.DotSettings.user) which holds the settings for this particular project. It is important to note that this file should not be checked in to source control as each user would have their own specific settings and thus one would override the other. We recommend that this file be added to the list of files to ignore by the VCS (i.e. add to .gitignore).

 

Shared team settings

The next step is to have a series of settings shared across the team. As you can guess from the previous screenshot, this is merely just choosing the next option down when saving settings:

 

image

 

which will create a a %SolutionName%.SLN.DotSettings file in the solution folder. This file should be checked in to source control.

 

These cover some of the simple scenarios when it comes to settings. However, sometimes it is not that simple. Often we want to have the best of both worlds. For instance, we might like to have team settings and tweak them a little bit to our own use. That’s where ReSharper’s smart settings come in.

Combining Settings: Layers

Settings in ReSharper are like onions, they have layers, and these layers, combined with what we call internally “smart savings”, provide more flexibility when it comes to tweaking settings.

Say for instance we are using some shared settings from a team settings file checked in with the project, yet there are certain settings we’d like to change privately that only affects us. How would we do this?

Quite simple. We modify the settings we want tweaked and then save it as Solution Private. ReSharper realizes that there are different values for a setting and the layering kicks in which one layer override another one. The actual order of the layering is:

 

image

Private Settings currently override Solution Shared, which in turn override Global settings. As such, by tweaking the settings to our individual needs (only those required), we can override specific team settings.

[Note: Some have mentioned that this wouldn’t enforce team settings. True, it does not, and we believe in discipline versus constraint.]

Managing Options

You might have noticed that in the ReSharper menu, as well as the Options dialog there is a new entry / button labeled “Manage Options” and “Manage…” respectively. These provide access to managing the different settings layers easily as well as importing/exporting and resetting.

image

 

When clicking on them, we’re displayed the following dialog:

image

 

The dialog box lists all the different layers currently available. Out of the box, ReSharper ships with the three we’ve already discussed: Global, Private and Shared with Team. Each of these are appropriately placed in the correct Group, which also happens to be three. From this dialog box we can edit each of these as well as import and export settings.

 

To edit specific settings, we merely select the one we’re interested in and click on the Edit… button on the top-left corner. This opens up the regular Options dialog box for us, with a minor difference. It now displays the name of the layer we are editing:

 

image

 

This difference is also apparent in that the Save To Button is no longer present, as when clicking Save we will automatically save the layer we are editing. When we edit the settings, only those of that specific layer are updated. Everything else stays intact.

Summary

The new ReSharper settings is hopefully designed in a way which allows to not only ease the pain of sharing settings, but provide for a variety of options and maximum flexibility. In the next parts we’ll cover how to add additional layers (including storing settings on Dropbox for instance), re-order, as well as importing and exporting of old and new settings.

Como en España no se vive en ninguna parte

Esas ganas de vivir, unido a la pasión que nos caracteriza, las ganas de marcha y el buen tiempo. ¿Cómo vamos a negar que mejor que en España no se vive en ninguna parte?

Pocos diran que en otro país se vive mejor. Menos los que viven aquí,  y mucho menos los que jamás han vivido en otros países. Crisis y corrupción hay en todas partes. Porque entonces dejar el buen tiempo para ir a otro país, ¿para enfrentarse a más de lo mismo, pero encima con lluvia?

¿Qué es vivir mejor?

Hay un refrán muy conocido que dice que en el resto del mundo se vive para trabajar, mientras que aquí en España, trabajamos para vivir.

Si vivir mejor es tener menos estrés, es pasar más tiempo haciendo lo que nos apetece, bien sea pasar tiempo con los nuestros o dedicarnos a nuestros hobbies, es poder llegar a fin de mes  y pagar nuestras deudas, y en general no tener tantas preocupaciones, entonces viendo el panorama en España, vamos por mal camino.

Según estudios realizados, somos entre los europeos que más trabajan; sí, estamos más tiempo en la oficina. Y no creo que sea porque estemos aún tomando la siesta o cogiendo tres horas para la comida. Encima, parece ser que somos los menos productivos.

Los sueldos en España son de los más bajos en Europa, por lo menos en comparación con países equiparables. Viendo el escenario, creo que es aceptable decir además que tenemos pocas opciones de encontrar mejores trabajos, siendo el paro básicamente el más alto de Europa.

Obviamente todo esto contribuyo a un poder adquisitivo más bajo, a mayor estrés para pagar deudas y en consecuencia a peor calidad de vida.

Y el futuro no es muy alentador.

Aquellos maravillosos años

La última vez que hubo un cambio de gobierno, fue con la salida del PSOE y 13 años de Felipe Gonzalez, para dar paso a Aznar. Fue la época del inicio del boom, ese boom inmobiliario que situó a España como referente mundial del crecimiento.

En esos tiempos, yo estaba acabando la carrera de informática. El futuro profesional que me esperaba era entrar en el Parque Tecnológico cobrando 300 Euros al mes como becario o entrar en la construcción, cobrando 2.000 Euros como albañil. Yo opté por programador. Otros no.
Muchos optaron por dejar su vocación, sus aspiraciones y cambiar de sector. Peor aún hubo quienes dejaron el colegio y los estudios para ser peones.

Sin embargo, todo marchaba bien. Esos mismos compraron casas, coches, segundas casas, bueno…para que voy a contar, si es bien sabido lo que pasó.

La burbuja explotó y dejó paso al escenario actual, un escenario desolador, donde no solamente hay paro sino hay años perdidos, años donde se desaprovechó la oportunidad de crecer profesionalmente, de mejorar en las vocaciones, de aprender. Se tiró toda una oportunidad por la borda. Se fue al dinero fácil. El que no se hizo albañil, se hice vendedor de inmobiliaria.

Hay quienes culpan al PSOE de todos los males. Hay otros que culpan al Partido Popular de permitir todos esos males. Claro que en esa época de la bonanza, ¿quien se iba a oponer al libre mercado?. Lo importante sin embargo, es tener a alguien a quien culpar menos a uno mismo.

¿El cambio llegará?

En las próximas elecciones lo más probable es que haya un cambio de gobierno. Y muchos tienen puestos sus esperanzas en ese cambio, creo que incluso más que los americanos lo tenían puestos en Obama. Hay quienes creen que con un nuevo cambio de gobierno, empezará otra bonanza. Pero no será así. Lamentablemente el cambio no va llegar con el gobierno. Esta vez no.

El cambio llegará cuando nos despertemos y nos demos cuenta de los errores que hemos cometido y de los que seguimos cometiendo, es decir, darnos cuenta que no hemos aprendido de nuestros males.

El cambio llegará cuando nos acordemos de cómo nos quejábamos cuando éramos simples trabajadores cobrando 600 euros mensuales y ahora como empresarios estamos pagando a nuestros trabajadores 600 euros mensuales.

El cambio llegará cuando nos demos cuenta de lo importante que es invertir en el continuo aprendizaje, en cultura.

El cambio llegará cuando entendamos lo que es un trato a cliente, lo que es el buen servicio.

El cambio llegará cuando aceptamos que pueda haber mejor vida de la que nosotros conocemos.

Pero sobre todo, el cambio llegará cuando no nos conformemos.

Hasta entonces, seguiremos diciendo que como en España no se vive en ninguna parte. Y puede ser cierto, pero será porque por el camino se nos ha olvidado lo que es vivir.