Linguagem de programação C#            Adriele Alvarenga            Claudson Oliveira
Histórico• C#  – Surgimento: 2001  – Influências: Java, C++ , Object pascal, etc...
Histórico• C#  – Surgimento: 2001  – Influências: Java, C++ , Object pascal, etc...  – Anders Hejlsberg (Turbo pascal e Bo...
Histórico• C#  – Surgimento: 2001  – Influências: Java, C++ , Object pascal, etc...  – Anders Hejlsberg (Turbo pascal e Bo...
Características• Normalizada (ECMA 334 e ISO/IEC 23270)
Características• Normalizada (ECMA 334 e ISO/IEC 23270)• Orientada a objetos
Características• Normalizada (ECMA 334 e ISO/IEC 23270)• Orientada a objetos• Compilação
Características•   Normalizada (ECMA 334 e ISO/IEC 23270)•   Orientada a objetos•   Compilação•   Visual Studio ou C# Expr...
Propriedades• Legibilidade e Redigibilidade
Propriedades• Legibilidade e Redigibilidade  – Baseada em C++ e Java
Propriedades• Legibilidade e Redigibilidade  – Baseada em C++ e Java   public class Hello1   {             public static v...
Propriedades• Confiabilidade  – Tratamento de exceções
Propriedades• Confiabilidade  – Tratamento de exceções  – Utilização de ponteiros (unsafe)
Propriedades• Confiabilidade  – Tratamento de exceções  – Utilização de ponteiros (unsafe)  – Coletor de lixo
Propriedades• Confiabilidade  – Tratamento de exceções  – Utilização de ponteiros (unsafe)  – Coletor de lixo
Propriedades• Confiabilidade  – Tratamento de exceções  – Utilização de ponteiros (unsafe)  – Coletor de lixo       unsafe...
Coletor de lixo• Gerência de memória da Heap
Coletor de lixo• Gerência de memória da Heap• Biblioteca Win32
Coletor de lixo• Gerência de memória da Heap• Biblioteca Win32
Coletor de lixo• Gerência de memória da Heap• Biblioteca Win32• Busca linear
Coletor de lixo• Gerência de memória da Heap• Biblioteca Win32• Busca linear
Coletor de lixo• Memória dividida
Propriedades• Ortogonalidade  – Permite uso dos conceitos básicos
Propriedades• Ortogonalidade  – Permite uso dos conceitos básicos  – Poucas exceções     • Ponteiros para void, array do t...
Propriedades• Eficiência  – .NET     • Just-in-time
Propriedades• Eficiência  – .NET     • Just-in-time     • Compilação híbrida
Propriedades• Eficiência  – .NET     • Just-in-time     • Compilação híbrida     • Otimização de instruções
Propriedades• Portabilidade  – dotGNU
Propriedades• Portabilidade  – dotGNU  – Portable .NET
Propriedades• Portabilidade  – dotGNU  – Portable .NET  – Mono (Novell)
Propriedades• Portabilidade  – dotGNU  – Portable .NET  – Mono (Novell)
Entrevista
EntrevistaHow long is the future of C#? You’ve been on it for almost 10years. C# the project started in late December of ‘...
EntrevistaDo you get feedback regarding the C# language, not just theimplementation?   (…) I read people’s blogs, I read f...
EntrevistaWhen I compare C# to Java, C# seems to have a stronger pushtoward evolution. The Java people seem to want a base...
EntrevistaI am not in this to engineer the next COBOL; let’s just put it that way.What is it that powers the Internet revo...
EntrevistaWhat do you suggest to become a better C# programmer?   It’s hard. There are many good books out there on C# pro...
Entrevista What’s facing us now and in five years?Concurrency is the big one right now. That thing is right in our face, a...
EntrevistaDoes the object-oriented paradigm create problems?You know, it depends on what you group under the object-orient...
Entrevista  Regarding your interest in functional programming, should  computer science students study more math and exper...
EntrevistaWhat lessons should people learn from your experience?Well, if you look at the first product I worked on, Turbo ...
C# .NET - Um overview da linguagem
Upcoming SlideShare
Loading in...5
×

C# .NET - Um overview da linguagem

337

Published on

Apresentação feita na disciplina de Linguagem de progração da Universidade Federal de Juiz de Fora.

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
337
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
4
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

C# .NET - Um overview da linguagem

  1. 1. Linguagem de programação C# Adriele Alvarenga Claudson Oliveira
  2. 2. Histórico• C# – Surgimento: 2001 – Influências: Java, C++ , Object pascal, etc...
  3. 3. Histórico• C# – Surgimento: 2001 – Influências: Java, C++ , Object pascal, etc... – Anders Hejlsberg (Turbo pascal e Borland Delphi)
  4. 4. Histórico• C# – Surgimento: 2001 – Influências: Java, C++ , Object pascal, etc... – Anders Hejlsberg (Turbo pascal e Borland Delphi) – Objetivo: Plataforma .NET
  5. 5. Características• Normalizada (ECMA 334 e ISO/IEC 23270)
  6. 6. Características• Normalizada (ECMA 334 e ISO/IEC 23270)• Orientada a objetos
  7. 7. Características• Normalizada (ECMA 334 e ISO/IEC 23270)• Orientada a objetos• Compilação
  8. 8. Características• Normalizada (ECMA 334 e ISO/IEC 23270)• Orientada a objetos• Compilação• Visual Studio ou C# Express
  9. 9. Propriedades• Legibilidade e Redigibilidade
  10. 10. Propriedades• Legibilidade e Redigibilidade – Baseada em C++ e Java
  11. 11. Propriedades• Legibilidade e Redigibilidade – Baseada em C++ e Java public class Hello1 { public static void Main() { System.Console.WriteLine("Hello, World!"); } }
  12. 12. Propriedades• Confiabilidade – Tratamento de exceções
  13. 13. Propriedades• Confiabilidade – Tratamento de exceções – Utilização de ponteiros (unsafe)
  14. 14. Propriedades• Confiabilidade – Tratamento de exceções – Utilização de ponteiros (unsafe) – Coletor de lixo
  15. 15. Propriedades• Confiabilidade – Tratamento de exceções – Utilização de ponteiros (unsafe) – Coletor de lixo
  16. 16. Propriedades• Confiabilidade – Tratamento de exceções – Utilização de ponteiros (unsafe) – Coletor de lixo unsafe static void usandoPonteiros(int* p) { int numero = 4; p = &numero ; }
  17. 17. Coletor de lixo• Gerência de memória da Heap
  18. 18. Coletor de lixo• Gerência de memória da Heap• Biblioteca Win32
  19. 19. Coletor de lixo• Gerência de memória da Heap• Biblioteca Win32
  20. 20. Coletor de lixo• Gerência de memória da Heap• Biblioteca Win32• Busca linear
  21. 21. Coletor de lixo• Gerência de memória da Heap• Biblioteca Win32• Busca linear
  22. 22. Coletor de lixo• Memória dividida
  23. 23. Propriedades• Ortogonalidade – Permite uso dos conceitos básicos
  24. 24. Propriedades• Ortogonalidade – Permite uso dos conceitos básicos – Poucas exceções • Ponteiros para void, array do tipo void
  25. 25. Propriedades• Eficiência – .NET • Just-in-time
  26. 26. Propriedades• Eficiência – .NET • Just-in-time • Compilação híbrida
  27. 27. Propriedades• Eficiência – .NET • Just-in-time • Compilação híbrida • Otimização de instruções
  28. 28. Propriedades• Portabilidade – dotGNU
  29. 29. Propriedades• Portabilidade – dotGNU – Portable .NET
  30. 30. Propriedades• Portabilidade – dotGNU – Portable .NET – Mono (Novell)
  31. 31. Propriedades• Portabilidade – dotGNU – Portable .NET – Mono (Novell)
  32. 32. Entrevista
  33. 33. EntrevistaHow long is the future of C#? You’ve been on it for almost 10years. C# the project started in late December of ‘98, so we’re coming up on our 10-year anniversary. That’s not 10 years of existing in the industry, but it’s 10 years since inception internally. I’d say we’ve got another 10 years at least, but it all depends. I’ve said I’ve long given up predicting the far-off future of this industry because no one ever gets it right anyway. But I certainly see a strong healthy future for C#. We’re not done innovat-ing, and there’s plenty of work still to do.
  34. 34. EntrevistaDo you get feedback regarding the C# language, not just theimplementation? (…) I read people’s blogs, I read forums where people ask technical questions, go to conferences—all sorts of ways that we get feedback daily on what works and what doesn’t in the language. We take that feedback back to the design team and we maintain a long laundry list of all of the crazy ideas. Some of them will never make it into the lan-guage, but we keep them on the list because there’s something there that maybe someday we’ll get a good idea around this area. We know that we don’t have it right yet, but there’s a desire to do something. Certainly there’s no way we could design the language without all this feedback, so it’s all based on listening to what people do with the product.
  35. 35. EntrevistaWhen I compare C# to Java, C# seems to have a stronger pushtoward evolution. The Java people seem to want a baselinewhere everyone’s code looks more or less the same. Whetheryou’ve programmed Java for a decade, never programmedbefore, or just graduated from a six-month course on Java, allof your code will look the same. C# seems to pull in new ideasfrom Haskell or from F#. Is there a desire to add new featuresthat people who’ve just finished the six-month C# coursehaven’t seen and won’t immediately understand?
  36. 36. EntrevistaI am not in this to engineer the next COBOL; let’s just put it that way.What is it that powers the Internet revolution and the electronic revolutionthat we’ve seen? It’s the fact that we’re constantly evolving. I bring it backto that. The minute you stop evolving, I don’t know that you’re adding anyvalue. This is, again, taking it to the extreme. Of course, there is value instability of the platform, but I think you provide that value by ensuringbackward compatibility. You are free to get off the bus at C# 1.0 and justnot move any further. For those people that really want to be moreproductive and want to build newer kinds of apps like SOA or whatever andget into more dynamic styles of programming—adaptable programs andmore declarative styles of programming like we’re doing with LINQ—thenyou’ve got to evolve or get out of the way, or something else will replaceyou.
  37. 37. EntrevistaWhat do you suggest to become a better C# programmer? It’s hard. There are many good books out there on C# programming and I would encourage people to pick up one of the better books. I’m not going to start naming names here, but there are many good books out there that will help you become a better C# pro-grammer and help you better understand the .NET Framework. There are many things available online that also help. There are things like Codeplex. There’s a bunch of open source projects that you can grab and look at and learn from and so forth. To become a better programmer in general, one of the things that have helped me is to look at different styles of programming and different kinds of programming languages(…)
  38. 38. Entrevista What’s facing us now and in five years?Concurrency is the big one right now. That thing is right in our face, and we’ve got tofind solutions to that problem. One of my biggest challenges in the foreseeable future ishaving our team work that issue.Again, we’d like to do it in an evolutionary fashion, but how do you deal with the sharedstate problem and side effects without breaking all the existing code? We don’t knowyet, but it very well may be that that concurrency is a big enough paradigm change thatwhole new languages are needed or whole new frameworks are needed. Although Idon’t think we’re at that point yet. I think there’s a lot of ground that we can gain frommaking it possible for people to write APIs that internally are massively parallel andwritten by people that really understand a particular domain, be it transformations ornumeric processing or signal processing or bit- maps or image manipulation. (…)
  39. 39. EntrevistaDoes the object-oriented paradigm create problems?You know, it depends on what you group under the object-oriented paradigm.Polymorphism and encapsulation and inheritance are as such not a problem,although functional languages typically have a different view of how you dopolymorphism with their algebraic data types. Aside from that, I think the biggestproblem typically with object-oriented programming is that people do their object-oriented programming in a very imperative manner where objects encapsulatemutable state and you call methods or send messages to objects that cause them tomodify themselves unbeknownst to other people that are referencing these objects.Now you end up with side effects that surprise you that you can’t analyze.In that sense object-oriented programming is a problem, but you could do object-oriented programming with immutable objects. Then you wouldn’t have these sameproblems. That’s kind of what functional programming languages are doing, forexample.
  40. 40. Entrevista Regarding your interest in functional programming, should computer science students study more math and experiment more with functional programming?Well, I certainly think that it is important to include functional programming inany computer science curricula. Whether you start with it that depends. I’m not sure thatyour very first introduction to programming should be functional programming, but Idefinitely think that it ought to be part of a curriculum.
  41. 41. EntrevistaWhat lessons should people learn from your experience?Well, if you look at the first product I worked on, Turbo Pascal, it was very muchabout not believing the traditional way of doing things. Don’t be afraid. Just because people tell you it can’t be done, that doesn’t necessarily mean that it can’t be done. It justmeans that they can’t do it. I think it’s always fun to think outside of the box and try tofind new solutions to existing problems.It was the only thing I wanted to do. I was very, very passionate about it.You have to have that passion to get really good at something, because that makes youput in the hours, and the hours are the real key. You need to put in a lot of work.
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×