Interview with John Skeet

Original author: DotNetCurry Magazine
  • Transfer
In the second issue of this magazine, we are pleased to see John Skeet in our “virtual” chair. John Skeet is a true community assistant (take a look at his icons on StackOverflow), a leading C # specialist and author of many books. John has been an MS MVP since 2003. He currently works for Google.

Ladies and gentlemen, without further ado, we present to your attention the Software Engineer and Gentleman - John Skeet.

DNC: Hi John, we are very glad that you took the time in your schedule for this interview. To begin with, we all want to know more about John Skeet, tell us how it all began. How did John start working with computers?

JS: My first computer — common to the whole family — was the Sinclair ZX Spectrum 48 K, which we bought when I was 8. Over time, I bought other Spectrum models, but then gradually switched to PC. For a long time I spent most of my time at the computer, just playing games, but programming was always there.

DNC:What challenges did you face when working at Sinclair? Tasks that plunged you deeper into computer science?

JS: One of my first “big” projects on Spectrum was to write an analogue of the Logo language. At school, we had BBC Micros microcomputers, and Logo was used as a language for introducing computing; I really enjoyed it and wanted to use it at home, but we did not have an interpreter for Logo. I had no idea about trigonometry and did not have a good idea about structural programming, but I persisted and ended up with a pretty good implementation. The manual that was with Spectrum was very good, I literally learned all the basic trigonometry from there, long before we started studying it at school.



I still remember one subroutine drawing or deleting a triangle representing a turtle. The subroutine started with line number 7000 and if the result didn’t look quite right, I just added the call to “GOSUB 7000” as long as it worked. I understood that if there was more than one subprogram call in a certain place, then something was wrong ... but I did not always know what it was.

DNC: Well, we wanted to leave this question for later, but now you said you created an analogue of Logo when you were ... 8 (?) ... Have you ever thought about creating your own programming language?

JS:Occasionally ... but I don’t think that I have a strong enough imagination to create something truly revolutionary (of course I don’t have time for this). I think I can help the team designing a new language, but it’s much easier to be a sofa designer - to point out mistakes made in existing languages ​​than to do real things.

DNC: Well, there are a lot of couch specialists and here we have John. We all know about your love of C #. Most of your work is related to Java. What other programming languages ​​do you use for work? Do you study any languages ​​as a hobby or would you like to learn? Why?

My secret is that I really don't know other programming languages. I know VB enough to answer some questions on StackOverflow, and I can read some questions on F #, but I'm not very multilingual in that sense.

JS: My secret is that I really don't know other programming languages. I know VB enough to answer some questions on StackOverflow and I can read some questions on F #, but I'm not very multilingual in that sense. I definitely want to learn more about F # and hope to learn Go, as my colleagues talked a lot about it.

The trick is to find the actual use of things - most of my hobbies are creating .NET libraries such as Noda Time or writing articles about C #.

I am not an application developer, for whom I think it is much easier to try other programming languages. Now I have a Raspberry PI, which I hope will ignite my imagination on something. Although Mono works there, I'm going to try using it (Raspberry PI) to learn Go.

DNC: Very good, now we can add the Go tag to your list on StackOverflow. As a polyglot programmer, how often do you have the feeling “mmm ... is it interesting, does it work differently in other languages?” Does anything come to mind?

JS: Closures. When you refer to an external variable from a closure, what does this actually mean? Different languages ​​have different answers ... In C #, the answer to this question has changed over time (if you capture a loop variable in foreach in C # 2.0 - 4.0 then you will eventually capture the same variable for each value in the sequence; in C # 5.0 a new variable will be captured at each iteration).

DNC: Let's get back to your love of C #, which one function did you always want but which will never be implemented, or if you could add a “single” function to C #, what would it be?

JS: I would like to see more support for immutable types in one form or another.There are many places where it can be useful. For example, I like the behavior of anonymous types - simply immutable classes that override the Equals, GetHashCode and ToString methods in a useful way, and also allow you to give the necessary names to their properties. If we could do the same for regular classes as easy! Creating a “normal” class that contains several properties, has a constructor that takes values ​​and overrides the various methods makes the code a bit boiler-plate (Boiler-plate code - this is the name for repeating pieces of program code that are reproduced many times with minor changes), especially if you You want to create truly readonly variables, but not having properties with a private set-er.

In addition, I would like to see more support for creating immutable types - object and collection initializers are good, but only work for mutable types. You can use the builder pattern, but it's not very pretty. I doubt whether adding the functionality associated with the pattern builder is an interesting addition to the language. At least named arguments and default parameters provide alternative functionality. Of course, these ideas are about immutability on a superficial level. Deep immutability is complex, but offers great benefits. I know the C # team is aware of this benefit - if they can come up with an effective solution then this will be great.

DNC:C # started out as a statically typed language, but took on a lot of dynamic features. Is there anything that could be added to C # that would be innovative, or would it be evolution for something existing?

JS: The most interesting thing about all this is that many of the functions that originally appeared in dynamic languages ​​are not really dynamic. LINQ is fully statically typed, but list generators appeared in Python-e before that. Also, “var” makes C # look like a dynamic language, but without loss of type safety. Of course the “dynamic” type added in C # 4.0 is a completely different matter.

I think the new async / await functionality added in C # 5.0 (and naturally VB) will change the game.

I know that similar functions exist in other less popular programming languages, but I think it will be of great benefit to ordinary developers. The ability to create asynchronous code without turning it into spaghetti code is amazing. I am really excited about this functionality, and I hope it will change our idea of ​​writing code, as I think LINQ has changed the way many people think about data manipulation.

DNC: Besides the immutability, which seems to have changed only in the support of ReadOnlyCollections in C # 5.0, what else is on your wish list for C # 6.0?

JS:That's all I could offer, I'm sure the C # team has something much more amazing on their mind. I have already talked about improved support for immutable types, as well as I would like to see improved support for tuples that can make some code a lot easier, but I also consider it important that C # avoid pollution with unnecessary functionality. The development team must keep the bar high for new features, the only way they can rely on the fact that developers will learn about it over time. I was fortunate enough to learn C # since version 1.0, but can you imagine starting to learn it with C # 5.0? How long will it take you to learn the whole language, including the most recently added features? (I intend to stay away from unsafe code, in fact I cut out a whole section from knowledge of the language,

DNC: Tell our readers more about the Protobuf project (ported to .NET). In addition to the Protobuf project, do you have any top secret projects you are working on?

JS:Protocol Buffers is used to represent structured data in Google. This is a fairly simple language for describing the structure, as well as for the most efficient presentation for storage and transmission. This is a platform-independent format, which will obviously be useful if the platform you are using has support for the corresponding library. Google made the Protocol Buffers project open almost immediately after I joined it and I decided to port it to .NET. My version is roughly on par with the Java and C ++ versions that Google provides, but there are other ports. In particular, I know Marc Gravell did an interesting job in his Protobuf version for .NET, which takes a slightly different approach.

Right now I don't work much on Protocol Buffers - most of my open source coding I spend on NodaTime, which started as a port with the JodaTime date / time library for Java, but ended up becoming a JodaTime engine port, but with a rather different API on top of it . This is a really good project to learn about API design.

DNC: Please ask our readers 3 interesting questions about C #.

JS: OK! Several questions of varying complexity:

Question 1: Which constructor call can you use to print True code (in the .NET implementation from Microsoft)

object x = new /* fill in code here */;
object y = new /* fill in code here */;
Console.WriteLine(x == y);

Remember that this is just a constructor call and you cannot change the type of variables.

Question 2: How can you get this code to compile so that it causes three different method overloads?

void Foo()
  {
     EvilMethod();
     EvilMethod();
     EvilMethod();
  }

Question 3: Using a local variable, how can you drop this code in the 2nd line?

string text = x.ToString(); // No exception
Type type = x.GetType(); // Bang!

DNC: Can you pick one or two interesting conversations on StackOverflow? (Personally, I like reading facts about John Skeet :))

JS: Yes, I also like the facts page about John Skeet. As I said, this is not all about me, I’m just a convenient name to hang it for fun. The posts that I like are those in which I learn something new about C # or those that gave me a reason to write really terrifying code - usually together with a comment - "this is terrible, do not use it in real life." I was very pleased when Eric Lippert added a comment to one of these posts - "this is the best C # abuse I've ever seen." One of the advantages of being a C # amateur developer is that I can write code like this without any consequences.

DNC:If a novice / young developer wants to be like John Skeet, an extraordinary programmer, where do they start? Is it possible to create a “deep copy” of John Skeet on programming?

JS: To begin with, the bar must be kept much higher! The rumors about my competence are greatly exaggerated, as you have heard more than once if you spoke with my colleagues. I read the C # specification in more detail than many people do, and I have the gift of intentionally misusing the language and my communication skills are good enough, but despite this I am not an expert. I have a strong opinion about the API and language design, but ask me to write an entire application and I will be helpless.

Also popular now: