C
C#3w ago
Jexs

What is this

Can someone explain to me what this is and what it means and what it does ? I’m a newbie public static System.Runtime.CompilerServices.CallSiteBinder BinaryOperation (Microsoft.CSharp.RuntimeBinder.CSharpBinderFlags flags, System.Linq.Expressions.ExpressionType operation, Type? context, System.Collections.Generic.IEnumerable<Microsoft.CSharp.RuntimeBinder.CSharpArgumentInfo>? argumentInfo);
103 Replies
Jexs
JexsOP3w ago
Would I ever have to type this out in my code ?
Pobiega
Pobiega3w ago
Very unlikely, for many reasons 1. those are all fully qualified types. You very rarely fully qualify your types when writing code yourself. 2. Those are types from System.Runtime, hardly stuff a beginner would use.
Jexs
JexsOP3w ago
Are fully qualified types, types made by Microsoft ?
Pobiega
Pobiega3w ago
no System.Runtime.CompilerServices.CallSiteBinder thats a fully qualified name if you had to write this code, you'd probably just do
using System.Runtime.CompilerServices;
...

public static CallSiteBinder BinaryOperation(...);
using System.Runtime.CompilerServices;
...

public static CallSiteBinder BinaryOperation(...);
How did you stumble upon this in the first place? it seems either decompiled or something from a stacktrace or something and as said, its hardly beginner stuff
Jexs
JexsOP3w ago
Im looking into Different namespaces on ms website and looking at their classes up to learn something new
Pobiega
Pobiega3w ago
ah
Jexs
JexsOP3w ago
I don’t think I’m smart enough to create my self a project yet
Pobiega
Pobiega3w ago
you can save System.Runtime for a lot later 😄
Jexs
JexsOP3w ago
What should I start with if you had to give a recommendation
Pobiega
Pobiega3w ago
Im sure you are, if you start small make a console app that does something. look at $projects for ideas
MODiX
MODiX3w ago
Collections of application ideas that anyone can solve in any programming language to improve coding skills: https://github.com/dotnet/dotnet-console-games https://github.com/karan/Projects https://github.com/florinpop17/app-ideas
Jexs
JexsOP3w ago
What project template do You work with the most
Pobiega
Pobiega3w ago
webapi and console thats 99% of my projects
Jexs
JexsOP3w ago
I really dislike xaml do you ever work with it
Pobiega
Pobiega3w ago
hardly ever, its only for GUI apps and I dont do those very often I handle data
Jexs
JexsOP3w ago
What do you mean by hand data what do you actually code
Pobiega
Pobiega3w ago
well I work for a product company that makes various webapps in healthcare that explains the webapi (I'm a senior backend developer, so I dont do frontends)
Jexs
JexsOP3w ago
Are you a web developer ?
Pobiega
Pobiega3w ago
technically, yes
Jexs
JexsOP3w ago
Dammmm senior
Pobiega
Pobiega3w ago
and console apps are very useful for everything else - CLI tools, hosted services that just "do stuff" (like run scheduled jobs in the K8 cluster etc)
Jexs
JexsOP3w ago
How long have you been programming for
Pobiega
Pobiega3w ago
uh... 30 years or so give or take 2 years I've been doing C# since 2002, and professionally since 2010 before C# I wrote a lot of PHP
Jexs
JexsOP3w ago
Dam nice I’m so frustrated with endless googling of stuff I don’t even know how to put together :/
Pobiega
Pobiega3w ago
the googling never stops 🙂 we google stuff too, all the time if you tell me what you want to do perhaps I can point you in the right direction
Jexs
JexsOP3w ago
I wanted to make a calculator with a login screen to store user names and passwords and have users register with accounts to and I had ChatGPT generate the code so I could study it but when I ran the program it had debugging errors or errors or something and I got all bumbed out
Pobiega
Pobiega3w ago
ok so simplify that idea down to its core lets ignore the calculator for now, as thats its own thing make a console app that asks the user to login or register. it takes a username and password in either case and either saves the data safely (perhaps in a database? or a file?) or looks it up in the stored place
Jexs
JexsOP3w ago
Okay Do you ever use ChatGPT to learn C sharp or programming ?
Pobiega
Pobiega3w ago
Not to learn, no I don't see how having something /someone else wrote the code for you helps with learning But it can be useful when trying to be productive
Jexs
JexsOP3w ago
I like taking apart source code
Pobiega
Pobiega3w ago
As long as you don't grow reliant on it... I've seen that a lot
Jexs
JexsOP3w ago
Hmmmm okay How did you learn ?
Pobiega
Pobiega3w ago
Documentation, books Remember, this was before YouTube or chatgpt existed
Jexs
JexsOP3w ago
Oh dam okay 👍🏻
Pobiega
Pobiega3w ago
And most importantly, I learn by doing Writing code makes you better at writing code. Making errors let's you fix them and learn to not do them again Seeing what works and what doesnt
Jexs
JexsOP3w ago
Okay ty buddy
Pobiega
Pobiega3w ago
So get to work on that signup/login program! Keep it easy so make a console app at first
Jexs
JexsOP3w ago
Okay 🙂 I think I’m going to go threw each namespace on the site till I learned enough to create a program with that pool of knowledge
Pobiega
Pobiega3w ago
I don't think that's a good idea to be honest It's way too much and too abstract
Jexs
JexsOP3w ago
I feel like googling it’s a dead end no ?
Pobiega
Pobiega3w ago
It's like learning a language by only reading the dictionary Ok imagine you writing this program we just talked about, what would be step 1?
Jexs
JexsOP3w ago
Like everything I search that’s related to my project is like a dead end Make a UI out of xaml
Pobiega
Pobiega3w ago
No Console app, not a UI
Jexs
JexsOP3w ago
Why not ui ?
Pobiega
Pobiega3w ago
Because it's just more complex Start easy Once you know how to do it in a console app, you can then learn how to do it in xaml Baby steps
Jexs
JexsOP3w ago
Hmmmmm okay
Pobiega
Pobiega3w ago
A lot of it will carry over
Jexs
JexsOP3w ago
Really from console to wpf ?
Pobiega
Pobiega3w ago
Sure. Not in terms of UI, but everything else How to store user info How to read it. How to search How to verify if the password was correct Etc
Jexs
JexsOP3w ago
Hmmm okay I’ll try that 😄 ty Also When your working on a program and you can’t find your answer on google what do you do ? Like that’s where I get stuck
Pobiega
Pobiega3w ago
I ask a coworker, or I go here There are some very very smart and experienced people on this discord
Jexs
JexsOP3w ago
Hmmm okay
Pobiega
Pobiega3w ago
Purple people open help threads all the time 🙂 It's nothing to be ashamed of, asking help
Jexs
JexsOP3w ago
Okay 🙂 ty buddy you and leo have been really help ful
Pobiega
Pobiega3w ago
I love Leo 🙂 He is great. Im the one who nominated him for 🟣
Jexs
JexsOP3w ago
Niceeee!
Pobiega
Pobiega3w ago
@leowest we are having a praise party, come join
Jexs
JexsOP3w ago
Lmao Don’t you think I should do straight wpf ?
Pobiega
Pobiega3w ago
No I think way too many people go big too soon Start small. Start TINY You need to build confidence in getting somewhere
Jexs
JexsOP3w ago
Ok
Pobiega
Pobiega3w ago
And if you go directly to WPF, you'll get stuck on fixing UI issues when your core functionality isn't even working UI is a massive task on its own That's why some people specialise on doing it I went the other way and specialize on everything except UI
Jexs
JexsOP3w ago
Okay!
leowest
leowest3w ago
what did I do this time? and yes I totally agree with Pobiega
Jexs
JexsOP3w ago
Yoooo
leowest
leowest3w ago
dont jump into ui framework go from console build stuff learn once you're more comfortable move on specially UI Frameworks are very catchy
MODiX
MODiX3w ago
leowest
https://learn.microsoft.com/en-us/shows/csharp-fundamentals-for-absolute-beginners/ I have personally watch those for the sake of suggesting something to people. they are short but concise videos about specific parts and the person talking is good at explaining what is going on just keep in mind, learning the language takes a lot of practice and repetition, so u learn 1 thing, open a console project, practice using what u have learned if u dont understand it, u ask questions the important is to be able to digest and use what u learned otherwise it will be as if u only looked thru it to soon forget and when u actually need it u no longer know the idea is, to not take too much at once, u learned about string manipulation? then go practice it a bit, see it working, see what u dont understand etc
Quoted by
<@1102729783969861782> from #chat (click here)
React with ❌ to remove this embed.
leowest
leowest3w ago
something I said awhile ago I know you're past that already but the essence is the same and same for me when I learned all this we barely had google documentation on microsoft site was abysmal now its so much better than it use to be people learning in this era have it so easy going not only u have a shit load of content on the internet, you can use chatgpt to search and summarize it for u(not to write code for u) @Jexs try writing some more complex application using console, for example you could write a ATM/bank app lookup dependency injection $di, use multiple classes to represent things, have the data stored in a file to start if u dont yet know SQL.
MODiX
MODiX3w ago
Dependency injection is really just a pretentious way to say 'taking an argument' See: http://blog.ploeh.dk/2017/01/27/dependency-injection-is-passing-an-argument/
Dependency injection is passing an argument
Is dependency injection really just passing an argument? A brief review.
Jexs
JexsOP3w ago
Okay
leowest
leowest3w ago
dont use static at all people give in because its a console app and think they need to use static everywhere u dont and if u try to keep the logic of your app separated from the visualization part you can easily use the same code of your ATM/Bank into a UI app
Jexs
JexsOP3w ago
I’m kinda worried for when I try to transition from console app to wpf Really Is that with like every app ?
leowest
leowest3w ago
it will be confusing there is a lot of new concepts u will learn in wpf or w/e ui framework u choose it can be, it all depends how well u can write the code to separate the concerns A good example would be DAL(Data Access Layer) they are their own library that gives you access to a database you can use it from a console app, web app, ui app its just part the whole code "a layer" but don't over think things too much right now just try to write a complex app with what u know right now then post your code for review and people will provide u with feedback on what to improve
Jexs
JexsOP3w ago
Should I ask gpt to provide me some source code learn from it and then ask it to help me evolve the program
leowest
leowest3w ago
no dont use other people source code use what u know this is so you can see where you're lacking knowledge what u need to practice if u just copy paste u wont learn your own shortcomings the goal of building projects is exactly that you will build stuff with what u know preferable without asking for help try to overcome the challanges your self unless you really dont know how
Jexs
JexsOP3w ago
Ok
leowest
leowest3w ago
and take note of the parts u have difficult with
Jexs
JexsOP3w ago
Gotcha
leowest
leowest3w ago
and if you're absolutely stuck and dont know u ask but u have to thinker
Jexs
JexsOP3w ago
Ty mate 🥹
Pobiega
Pobiega3w ago
MODiX
MODiX3w ago
✧ lumi ✧
tl;dr: i relied too much on GPT to teach me C#, and instead of watching and reading through my teacher's material, I put it all through GPT to have it teach me cuz I thought it would be faster idk. But you know, if you don't know something... how the hell are you gonna ask what you don't know. GPT was like giving me what I was asking for, with was like the big concepts I guess? but I was missing all the info in between. I just read through some of the material and I saw so much i had no idea about. Really simple stuff too lol so... big sigh I wasted a lot of time by trying to speed things up
Quoted by
<@105026391237480448> from #chat (click here)
React with ❌ to remove this embed.
Pobiega
Pobiega3w ago
and it feels quite relevant to learning from chatgpt
leowest
leowest3w ago
yep there are no shortcuts
Jexs
JexsOP3w ago
so if i do use chatgpt what should i limit it to? as a programmer should i be using it at all??
Pobiega
Pobiega3w ago
as an experienced programmer, its great for writing boilerplate or getting things "mostly right" and then tweak the bad parts but as a beginner, you can't tell the good from the bad as easily
Jexs
JexsOP3w ago
okay ty 🙂
Jexs
JexsOP3w ago
this is what i have so far
No description
Pobiega
Pobiega3w ago
is that your desktop leaking through the IDE? that is cursed as hell my man but hey, good on you for getting started!
Jexs
JexsOP3w ago
its an addon that lets me change the wallpaper of vs 😄
Jexs
JexsOP3w ago
when dealing with an error do you always click this to correct it or just google?
No description
Pobiega
Pobiega3w ago
generally google
Jexs
JexsOP3w ago
okay
Pobiega
Pobiega3w ago
but honestly, the error message is usually enough Operator == can't be applied to operands of type string and int is clear enough to me Do you understand the error?
Jexs
JexsOP3w ago
== is the operand? i just added "" to the one and it fixed it dont really understand what the error means
Pobiega
Pobiega3w ago
== is the operator the problem is you are comparing apples to oranges a string is not a number and a number is not a string they cant be deemed equal or not "5" and 5 are not the same
Jexs
JexsOP3w ago
okay
Jexs
JexsOP3w ago
so this is what i have so far: and now i guess i need to make a database to store all the passwords and users that register right would this be the correct page to look at? https://stackoverflow.com/questions/12657792/how-to-securely-save-username-password-local
Stack Overflow
How to securely save username/password (local)?
I'm making a Windows application, which you need to log into first. The account details consist of username and password, and they need to be saved locally. It's just a matter of security, so other
No description
Jexs
JexsOP3w ago
Also I was wondering should I ask gpt to generate me a project and just google the syntax ? No?
Pobiega
Pobiega3w ago
.. huh? No. Dont gpt stuff. Don't worry about securely storing it right now, go with just being able to store it for now Also, learn about methods and how to write them
Jexs
JexsOP3w ago
@Pobiega am i looking at the correct link? For the next step?
leowest
leowest3w ago
I dont trust chatgpt to be fairly honest with u, I've tried it in multiple occasion and was not satisfied with the results as a result of it I dont trust it so using chatgpt for me is literally doubling my work so I just dont use it
Jexs
JexsOP3w ago
Okay 👍🏻
leowest
leowest3w ago
it doesnt always correct it, its telling you what the exact issue is. You're trying to compare a string against a number (int) which is not possible... You need to first either convert the string to a number or vice versa to be able to compare it. Sometimes when you for example forget a using it will suggest and add that using for you for everything else it will just point you in the right direction of what the issue can be dont overcomplicate things just start simple and save it to a text file once you understand how to save it to a text file and read it back then try to hash the password so it wont be human readable by anyone and move from there taking on database require extra knowledge you would need to know SQL syntax and more depending on what kind of database engine u go with imo https://learn.microsoft.com/en-us/shows/csharp-fundamentals-for-absolute-beginners/ these are the basic topics u need to know you could watch those videos if u want or just read their titles these are the absolute must know things to start imo
Want results from more Discord servers?
Add your server