📜 ⬆️ ⬇️

Interview with John Skit

In the second issue of this magazine, we are glad to see John Skit in our “virtual” chair. John Skeet is a real community assistant (take a look at his icons on StackOverflow), lead C # specialist and author of many books. John is an MS MVP since 2003. He currently works for Google.

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

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

JS: My first computer — the Sinclair ZX Spectrum 48 K — which we bought when I was 8 — was common to the whole family. Over time, I bought other Spectrum models, but then gradually switched to a PC. For a long time I spent most of my time at the computer, just playing games, but programming was also always present.
')
DNC: What are some of the challenges you faced when working at Sinclair? Tasks that plunged you deeper into computer science?

JS: One of my first "big" projects on Spectrum was writing an analogue of the Logo language. At school, we had BBC Micros microcomputers and Logo was used as a language to introduce computation; I really enjoyed it and wanted to use it at home, but we didn’t have an interpreter for Logo. I had no idea about trigonometry and didn’t have a good idea about structured programming, but I showed perseverance and finished with a fairly good implementation. The manual that was with the Spectrum was very good, I literally learned from there all the elementary trigonometry, long before we started learning it in school.



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

DNC: Well, we wanted to leave this question for later, but now you said that you created an analogue 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 that). I think I can help the team designing a new language, but it’s much easier to be a sofa designer - pointing out mistakes made in existing languages ​​than doing the real things.

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

My secret is that I really do not 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 this 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 this sense. I definitely want to learn more about F # and hope to learn Go, since my colleagues talked a lot about it.

The whole trick is to find the actual use of things - most of my hobbies are related to creating .NET libraries such as Noda Time or writing articles on 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 spark my imagination on something. Although Mono works there, I'm going to try using it (Raspberry PI) to learn the Go language.

DNC: Very well, now we can add the Go tag to your list on StackOverflow. As a polyglot programmer, how often do you have the feeling “um ... 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 will capture a new variable at each iteration).

DNC: Back to your love for C #, which one function you always wanted, but which will never be implemented or if you could add a “single” function in 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, as well as allow you to give the necessary names to their properties. If we could do the same for ordinary classes just as easy! Creating a “normal” class that contains several properties, has a constructor that takes values ​​and overrides various methods, makes the code a little boiler-plate (Boiler-plate code - this is how duplicate pieces of code are called, which are reproduced many times with small changes) you want to create truly readonly variables, and not having properties with a private set.

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 pattern builder, but this is not very beautiful. I doubt whether the addition of 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 difficult, but gives great advantages. I know the C # team knows about this benefit - if they can come up with an effective solution, it will be great.

DNC: C # started out as a statically typed language, but adopted many dynamic features. Is there anything that could be added to C # that would be innovative or would it be an 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 actually not dynamic. LINQ is completely statically typed, but list generators have appeared in Python-e before. Also, “var” makes C # look like a dynamic language, but without losing type safety. Of course the “dynamic” type added in C # 4.0 is another matter.

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

I know that there are similar functions 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 way of writing code, as I think LINQ has changed many people’s ideas about data manipulation.

DNC: Aside from immutability, which seems to have changed only in support for ReadOnlyCollections in C # 5.0, what else is in 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 his mind. I have already spoken about improved support for immutable types, I would also like to see improved support for tuples capable of making some code much easier, but I also consider it important that C # avoid contamination with unnecessary functionality. The development team should keep the bar very high for new features, the only way they can count on the fact that developers will learn about it over time. I was lucky to learn C # from version 1.0, but can you imagine starting 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, I actually cut a whole section out of my knowledge of the language, I hope I will never need it).

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

JS: Protocol Buffers is used to present structured data to 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 that will obviously be useful to you 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 about 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 version of Protobuf for .NET, which uses a slightly different approach.

Now I’m working a little on Protocol Buffers - I’ve spent most of my open source coding on NodaTime, which started as a port with JodaTime date / time Java libraries, 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 API design.

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

JS: OK! Several questions of varying difficulty:

Question 1: What constructor call can you use to print this code True (in Microsoft’s .NET implementation)

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 make this code compile, so that it causes three different method overloads?

 void Foo() { EvilMethod<string>(); EvilMethod<int>(); EvilMethod<int?>(); } 

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 choose one or two interesting conversations on StackOverflow? (Personally, I love to read the facts about John Skyte :))

JS: Yes, I also like the fact sheet about John Skyte. As I said this is not quite 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 reason to write a really terrifying code - usually 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 beginner / young developer seeks to be like John Skit - an extraordinary programmer, where should he start? Is it possible to create a “deep copy” of John Skit on programming?

JS: To begin with, the bar should be kept much higher! Rumors about my competence are greatly exaggerated, as you have often heard if you spoke with my colleagues. I read the C # specification in more detail than many people, and I have the gift of deliberately misusing the possibilities of 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 design language, but ask me to write a whole application, and I will be helpless.

Source: https://habr.com/ru/post/201316/


All Articles