Jump to content

kaddle

Member
  • Posts

    77
  • Joined

  • Last visited

Reputation Activity

  1. Informative
    kaddle reacted to Franck in Questions on C# basics, IDE, .net framework, etc (need very detailed answers)   
    Same in C#. I mentioned it in the "using" and also again in my final paragraph. You needed to read the full thing to see it. It wasn't part of the quote.
  2. Informative
    kaddle reacted to wasab in Questions on C# basics, IDE, .net framework, etc (need very detailed answers)   
    I thought namespace gives scope to some piece of code. At least that's how it is used in c++
  3. Informative
    kaddle reacted to Franck in Questions on C# basics, IDE, .net framework, etc (need very detailed answers)   
    a non programmer probably doesn't know what package is either.
    Personally I use package all the time but pure .Net devs don't know that wording so i always have to repeat what i am asking using namespace wording instead.
    Package is a the equivalent of namespace in Java and PHP AFAIK so it's not an analogy.
  4. Informative
    kaddle reacted to Dat Guy in Questions on C# basics, IDE, .net framework, etc (need very detailed answers)   
    Actually, those are packages.
  5. Informative
    kaddle reacted to Franck in Questions on C# basics, IDE, .net framework, etc (need very detailed answers)   
    I'll answer too as different answers might be easier to grasp than other because of the wording speaks more to you. I'll try to keep mine as simple as possible.
     
    IDE : The IDE is the editor for not only C# but many language that Visual Studio Support. You could use Microsoft Word as an example where it has 1 interface but can edit *.doc (word file), *.docx (2012 + word files), *.txt (notepad files), *.rtf (rich text files), *.html (web page). But the IDE of Visual Studio will slightly change by Adding/removing/disabling some options depending on the type of project you are working with.
     
    .NET : it's only a bunch of files with an engine that has code in it that you can use to compile libraries or software using it. Works exactly the same way as Java, Python. You need to install something in order to run it. Java is Java JDK or Java SDK, Python well this one has hundreds of engine.
     
    Using : First to use code you need to point to the library. By default most project will have "Reference" in the project treeview. This mean those libraries are available to you in the entire project. Using in a specific file allow you to not have to type the full namespace.Class.Method to access it. Since it can be many namespace deep you can avoid retyping over and over again the whole thing by simply adding the using. 
     
    Namespace : The easiest analogy is folders. a namespace is a folder. Whatever you put inside it's brace require either typing the "folder path" i.e. myNamespace.Class1 or adding like explain above the shortcut "using myNamespace" so you can only type "Class1". You can put namespace into another namespace without a problem. This is like a folder in a folder. The main use is to categorized large section of a program.
     
    Curly braces : You are right they are beginning and closing statement. They do what they are supposed to do and that is enclose things. object created inside braces are not accessible outside the braces. Anything inside the can see it and that even if there is other braces levels. An example is by your code is you were to put something right underneath the namespace it would be visible inside the braces of the static void Main because you are still within the braces that contain the thing you added.
     
    Class : a class is an type of object that in .Net has extra built in functions to do things. Whenever you need an object with many properties this "should" be the object you want to create. In all executable project type you need what's called an entry point. This entry point is what the application call to start and once the code return to the original line where it called that entry point the program stops. In console applications the project specifically launch the Static void Main method by default so once it reaches the closing brace of that method it goes back to the main entry point and close the program.
     
    Now there is something very important and is true for most language but i will keep it C# specific. You could code a whole program in a single physical file. in C# they are .cs files. But that would be insanely messy. Therefore you can create many folders and files to keep things clean. If you create a class File in the folder B that is within a folder A then you will notice the class will automatically create with the namespace matching the folder names. This is NOT mandatory. You could have a file with namespace called dog in a folder called cat. The only use of namespace remember is to categorized things. Anything in the same namespace see each other. The use of folders and files are to keep things clean (and sane).
  6. Informative
    kaddle reacted to Dat Guy in Questions on C# basics, IDE, .net framework, etc (need very detailed answers)   
    There is no clear, absolute definition of an IDE. Basically, an IDE is "a text editor with a compiler built-in", and one could argue whether a text editor with external tools can still be called an integrated environment. The borders have become less clear though as "editors" like Atom, Sublime Text and Visual Studio emerge which actually are language-agnostic IDEs.
  7. Informative
    kaddle reacted to reniat in Questions on C# basics, IDE, .net framework, etc (need very detailed answers)   
    It's not really feasible to full academically understand a programming language as step 1 to being able to use that language. You really don't need to know the "very detailed" info about .NET when you're just starting out. A console app is a perfect place to start, and is all you need to start the basics. If you let yourself get bogged down by the rabbit hole that is language design, compilers, frameworks, compilation targets, etc., you are never going to get into actual programming. Start with the basics, then build on those, until eventually you will find that learning more about .NET comes naturally from solving a problem that led to that being needed info, or you might just want to learn it for its own sake but you'll have a fundamental understanding that gives context to what you're learning.
     
    You're asking for "very detailed" info about things that won't really mean much to you without some familiarity. The significance of namespaces is something that's hard to convey without being familiar with how to organize multiple pieces of code together. That's probably why what you're googling isn't clicking for you.
     
    Here's my attempt to explain these things as detailed as possible to someone who doesn't yet know about writing code (html/css don't count in this context):
     
     
     
    IDE:
    You're right that IDEs are just programs that help devs write/run/debug code. Yes notepad++ could be an IDE, but it would require some plugins in order to provide the same features many other IDEs provide out of the box (which may be fine depending on what you're after). For .NET specifically, Visual Studio provides a huge amount of features (since .NET is a microsoft thing and visual studio is made by microsoft as well), so it's not likely that you're going to be able to find enough plugins for a bare bones IDE to be able to compare to visual studio for microsoft .NET development. Which IDE you use is totally up to you, and don't worry too much about it when you are just starting since you won't have a barometer for comparison yet. Visual studio is fine for what you're doing, so keep at that for now.
     
    .NET:
    .NET is just a platform that is made by windows to make things easier on developers. A lot of the code involved with making certain apps is built into frameworks (this is true beyond just .NET), and .NET is just one example of a framework/platform. These frameworks provide libraries and utilities for developers to use (for example, there is a .NET library for making http requests so you don't have to worry about about managing web sockets directly). There are tons of other frameworks and platforms, but just using the one that is commonly used for the language you're working in is fine. Use .NET when writing c#, use the Java JDK/JVM when writing java, use node when working with server side Javascript. Some languages, like C, don't really have one, but that's because they are close enough to the machine code that one isn't really needed, and instead of a framework beneath C, you can avoid doing extra work by just using other C libraries. The specifics of compilation don't matter as much for C#, since it's a JIT compiled language (aka the framework does that stuff for you).
     
    using:
    using is just a shortcut to make your code a bit cleaner. If you are using System.Net, you could just make WebRequest object, instead of having to type out System.Net.WebRequest. The only major thing to watch out for is if 2 namespaces have the same name for something. Then you'd have to be more specific by typing it out so that the system knows which one you are referring to.
     
    Think of curly brackets as simple containers
    namespace ExampleNamespace {     // stuff in here is in the namespace ExampleNamespace  } class ExampleClass {     // code in here is in the class ExampleClass. } You'll get the hang of this kind of syntax stuff by just following the basic tutorials and building on it.
     
    Yes, but also a lot more. How to properly use classes is more about abstractions and making designs that are understandable. This is called Object Oriented Programming, and is not something that's easily explained without more of a basic code knowledge. But yes, tl;dr classes are just ways of laying out code. You could technically write out any application with only a single class (and all in one big main function), but that would be horrible. Lots of lower level languages don't even have classes, but do have other ways of organization. They are not needed for code to function, they are there for organization.
×