|
Then it is not OOP. Either the language follows the rules completely or it does not.
|
|
|
|
|
This is now a valid C# program:
using System;
Console.WriteLine("Hello World!");
Espen Harlinn
Senior Architect - Ulriken Consulting AS
The competent programmer is fully aware of the strictly limited size of his own skull; therefore he approaches the programming task in full humility, and among other things he avoids clever tricks like the plague.Edsger W.Dijkstra
|
|
|
|
|
Very interesting, but there is not much else that it could do.
|
|
|
|
|
Quote: but there is not much else that it could do
It's a real time saver - I bet I'll save at least 0.00000001% on my next .Net project
As for what else is new in C# 9.0 record types seems like a useful extension, with the same pitfalls as structs. Meaning it easy to loose many of the performance benefits through mindless boxing/unboxing.
Init only setters: seems to be useful for functional programming purists - Upside: objects are immutable so you can avoid explicit locking in a multithreaded program, downside: there is going to be a lot of lock contention related to the allocation of objects. So far I believe the downside is, on the average, far greater than the upside.
Pattern matching enhancements: Minor syntactic sugar … which has the potential to make some code more readable, but to me this:
if (e is not null)
{
}
is not more readable than:
if (e != null)
{
}
Native sized integers and delegate pointers: sounds interesting, but I have no idea about how much this will improve the performance of a program. Sounds mostly like stuff the JIT compiler would do for me anyway …
New Expressions: This is something I'm actually going to use.
Support for code generators: I have yet to use partial methods for anything, but have used class factories and virtual functions to achieve similar functionality in the past. This would certainly reduce the amount of generated code.
Espen Harlinn
Senior Architect - Ulriken Consulting AS
The competent programmer is fully aware of the strictly limited size of his own skull; therefore he approaches the programming task in full humility, and among other things he avoids clever tricks like the plague.Edsger W.Dijkstra
|
|
|
|
|
Apples and Oranges for the most part. C++ is a language. OOP is a style of programming. C++ is capable of performing OOP, but there are detractors as well.
|
|
|
|
|
I was a C/C++ programmer before I learned Java and found it quite straightforward. My starting point was The Java™ Tutorials[^], which I recommend. Do it from the beginning and don't skip sections that seem too simple, and it should make sense.
|
|
|
|
|
I don't like tutorials. I just want to read one book from the begining to the end that will answer my queestion "What's the purpose of this and that". The problems are that tutorials are there, the books are there but the answers to questions "Why to use?" and "When to use?" aren't there. A simple example is java interfaces. When I'm reading books and whatching tutorials this is what i get "Interface is a contract. And know what java number this and that allows better interface" Ehhh okey.... but what is it exactly and why should I bother to use it? I cmade programs without it so far and everything is tip top, so why should I use it now? What's the point? "Because compiler doesn't know if a method exist" So what? Why should I write a method in an interface and not directly in a class? No answer there. I check a book on C++... Oh, Now I understand. It's an attempt to go back to multiple inheritance that was thrown away by java inventors
modified 3-Jun-21 21:01pm.
|
|
|
|
|
|
Oh, I actually checked it I just so some link and thought it would be some 13-year old youtuber showing how to copy and paste java syntax. You was right. That is really helpful. Still in written form and structured, so it's nice. I give it a shot. Thank's
modified 3-Jun-21 21:01pm.
|
|
|
|
|
Well that was why I posted the link: so you could go and study it and make up your mind, not dismiss it out of hand. One thing you really need to develop in the IT world is an open mind.
|
|
|
|
|
Richard MacCutchan wrote: One thing you really need to develop in the IT world is an open mind. and a lot of patience.
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
Rating helpful answers is nice, but saying thanks can be even nicer.
|
|
|
|
|
Nelek wrote: and a lot of patience. I'm still working on that part.
|
|
|
|
|
I only said it is needed, not that we develope it
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
Rating helpful answers is nice, but saying thanks can be even nicer.
|
|
|
|
|
Wow I started to read that and it's much better than those horrible expensive books. I never read oracle documentation because I thought it would be too hard to read it too much at the time I began learning so I never checked it after that. But it really is answering my questions. Thank's again
modified 3-Jun-21 21:01pm.
|
|
|
|
|
I think this, and your other responses, suggest what you are really good at is talking about what you think you are learning ... rather than really learning.
To reach mid-level mastery [1] of any of C, C++, C#, Java, for most mere mortals beginning to program is going to take a year, or more, of hard work.
The tendency to imagine you know more than you know is as dangerous as imagining you know what you don't know.
When someone as gifted and experienced as Richard MacCutchan gives you advice, you should take it !
That's great that you find C compelling, but, is it possible you are motivated by a desire to avoid Java which may be necessary for your studies ?
[1] I would define this as being able to create an application that runs on a specific OS, on specific hardware, has a UI, and does something useful
«One day it will have to be officially admitted that what we have christened reality is an even greater illusion than the world of dreams.» Salvador Dali
|
|
|
|
|
|
Just do it ... swoosh ...
Start with the simplest controls ... button, textbox ... learn how to select them, instantiate them, set their properties, and write code that responds/listens to their events.
«One day it will have to be officially admitted that what we have christened reality is an even greater illusion than the world of dreams.» Salvador Dali
|
|
|
|
|
Yeah I already started it but the hardest thing is to program it in a way that separates the GUI from program's logic, like write it in a separate class and put it everything together... Than I start to make a mess.. things stop to work or some parts and ... oh It's chaos But tommorow, I will not leave the computer until it's done. I'm gonna fight
modified 3-Jun-21 21:01pm.
|
|
|
|
|
|
Thank's but I'm more of a book reader-type and I learn best by reading well structured books. The problem is that all the books on Java, besides Deitel book are worthless. They are OK up to inheritance and after that they are just horrible. I read them and I ask myself: "Why to use that? When to use that? What's the point with this and that? Why do that?" and the authors never answer. C++ - books on the other hand are written in this manner "We use this, because of that, if you do this, that goes wrong, do this to make that right. You need this becuase it makes that easier". I don't know why java programming authors are so bad at teaching. 1000 pages after 1000 pages and still they don't expalin anything... like they want to hide something from you... I'm just frustrated.
modified 3-Jun-21 21:01pm.
|
|
|
|
|
Use the right tool for the right job.
"Easier" is rarely "better".
Learn D.
|
|
|
|
|
It seems like Java is the right tool for almost everything because it has good GUI support but... it so messy... Like it's ok up to inheritance and GUI and than... lambda this... abstract class this, inner class that, interface that, library this, library that. For a beginner like me it's a total chaos.
modified 3-Jun-21 21:01pm.
|
|
|
|
|
No, Java isn't right for anything and its practitioners should never be allowed near a computer.
|
|
|
|
|
Haha
modified 3-Jun-21 21:01pm.
|
|
|
|
|
Programming languages are part of the toolbox of a good programmer, each with its own strengths and weaknesses. A good programmer will try to use the programming language most appropriate to the job. For example, most programmers would not write a program to calculate orbits in COBOL, nor would they write an interactive game in Fortran (though it is possible to do both).
A good programmer will know more than one language, and will be able to write code in the differing styles that these languages impose, e.g. procedural for C and C++, Object-Oriented for C++ and Java, etc. The idea is that you should be able to match the project to the appropriate language.
Many programmers have had a long and successful career knowing only one language (for example the COBOL programmers who started in the '60s). Today, you are likely to migrate between projects with differing requirements, and cannot afford to limit yourself in such a manner.
In addition to your Computer Science studies (data structures, algorithms, etc.), I would recommend trying to learn at least one popular language a year - C, C++, Java, Python, etc. You do not have to become a master of the languages, just know how to program in them and where to find the more advanced stuff. This will help you when you have to look for a job.
Programming is a challenging career, but it can be very rewarding to the right person. Good luck!
Freedom is the freedom to say that two plus two make four. If that is granted, all else follows.
-- 6079 Smith W.
|
|
|
|