1
2
3
def filename
  self.uri.split('/').last
...

C# On Get the Filename segment o...

by jwmittag, January 01, 2008 16:29 Star_fullStar_fullStar_full

If we now reformat the C# c...

4bae3f603d397647c273dfa49ef8050c Talk
1
2
3
4
public string FileName
{
    get
...

C# On Get the Filename segment o...

by jwmittag, January 01, 2008 16:18

Last but not least we can u...

4bae3f603d397647c273dfa49ef8050c Talk
1
2
3
4
public string FileName
{
    get
...

C# On Get the Filename segment o...

by jwmittag, January 01, 2008 16:00

We can get rid of another t...

4bae3f603d397647c273dfa49ef8050c Talk
1
2
3
/// <remarks>
/// This namespace holds our own extension methods.
...

C# On Get the Filename segment o...

by jwmittag, January 01, 2008 15:57

Importing the entire System...

4bae3f603d397647c273dfa49ef8050c Talk
1
2
3
4
public string FileName
{
    get
...

C# On Get the Filename segment o...

by jwmittag, January 01, 2008 15:41

The Ruby version uses the A...

4bae3f603d397647c273dfa49ef8050c Talk
1
2
3
4
public string FileName
{
    get
...

C# On Get the Filename segment o...

by jwmittag, January 01, 2008 15:28

Introducing temporary local...

4bae3f603d397647c273dfa49ef8050c Talk
1
2
3
4
public string FileName
{
    get
...

C# On Get the Filename segment o...

by jwmittag, January 01, 2008 15:17

Now we remove the superfluo...

4bae3f603d397647c273dfa49ef8050c Talk
1
2
3
4
public string FileName
{
    get
...

C# On Get the Filename segment o...

by jwmittag, January 01, 2008 15:14 Star_full

Let's now work on improving...

4bae3f603d397647c273dfa49ef8050c Talk
1
2
3
def filename
  delim = '/'               # temporary local variable instead of passing as a literal parameter
...

C# On Get the Filename segment o...

by jwmittag, January 01, 2008 15:11 Star_full

To make the Ruby and C# ver...

4bae3f603d397647c273dfa49ef8050c Talk
1
2
3
def filename
  self.uri.split('/').last
...

C# Get the Filename segment o...

by jwmittag, January 01, 2008 15:04, 10 refactorings, tagged with ruby, rails, Ruby on Rails, RoR, C#, CSharp, C-Sharp, .net, DotNET, asp.net, Scott Porad, Comparison

On his Blog "Progress vs. P...

4bae3f603d397647c273dfa49ef8050c Talk