❔ Using text file to add data into a list

Hello, I would like to use text file to add data from a text file that are saved in a text document.
229 Replies
friedice
friedice14mo ago
i believe in you thumbsupcat
Pobiega
Pobiega14mo ago
Perhaps start with googling "C# read data from text file"?
The king of kings
Hey guys, great to see you again as always. Well! I have watched tutorials and read this docs on this concept.
The king of kings
Read from and write to a text file by Visual C# - C#
This article describes how to read from and write to a text file by using Visual C#. This article also provides some sample steps to explain related information.
The king of kings
The following requirements apply to your program: The program must be built with Windows forms. There should be a text box that shows a random book's ToString override and a button that generates a new book hint. The text box must inform the user about the title, author/publisher and type of book. I mean I have created a list, but the first small step would be is passing the path of the file. Right guys?
Pobiega
Pobiega14mo ago
passing the path of the file to what?
The king of kings
Sorry, I have created this thread but didn't continue yesterday with it, but now I will stick to it. Hello Pob are you available man?
Pobiega
Pobiega14mo ago
partially
The king of kings
Aha! Are you helping others currently?
Pobiega
Pobiega14mo ago
The king of kings
What 😃 Cool man You are free in your time and I can't scratch my head because of my dame course assignments I can't mountain bike, I can't visit friends I can't do nothing.
Pobiega
Pobiega14mo ago
Hey, noone forced you to do a C# course lol
The king of kings
noone what's that?
Pobiega
Pobiega14mo ago
no one
The king of kings
My passion of becoming a developer made me apply for this course lol
Pobiega
Pobiega14mo ago
so, whats the problem now? how far did you get on reading from a text file
The king of kings
Well! I have read the docs, watched YT tutorials, did some search on Google. But every time I implement, I get dame errors.
The king of kings
This dame reading & writing seems very easy, but I don't know why I suck though.
Pobiega
Pobiega14mo ago
Cmon faraj, you've been doing C# for almost a year now. Surely you can recognize when you have made a spelling error in a variable name by now?
The king of kings
I know you're gonna say that, because you've told me this like 100 times and Patrik 100 so the total is 200 times 😂 Let me show you where I got this code from and it's dame working
Pobiega
Pobiega14mo ago
let me stop you right there just fix the spelling error
The king of kings
C# StreamReader Examples - Dot Net Perls
Read text files with StreamReader inside a using-statement. Use ReadLine and while-loops.
Pobiega
Pobiega14mo ago
Faraj!
The king of kings
What The Hell
Pobiega
Pobiega14mo ago
Do you understand what a SPELLING ERROR is?
The king of kings
Stupid me S
Pobiega
Pobiega14mo ago
Do you like, not read the error messages that VS is telling you? I dont understand your process at all you seem to just type out some random code from a website and then give up when it doesnt work
The king of kings
How the hell I didn't notice that and I've looked many times and compared any spelling error <:picard_facepalm:616692703685509130>
Pobiega
Pobiega14mo ago
Here is how it should have gone 1. Get the error message above. 2. "Wait a minute, I declare that variable just two lines above!" 3. "Oh shit, I used lowercase instead of uppercase, silly me" 4. Fixed.
The king of kings
I mean, I don't like to copy & paste code from random sites my friend unless I review the code and understand it first, otherwise this is considered very useless practice.
Pobiega
Pobiega14mo ago
I never said you should copy paste but I do wonder if you read the error messages that VS gives you this is far from the first time you get stuck on a super basic error
The king of kings
Well! I didn't pay attention on this part where the error could be a spelling one honestly. Yeah! You're right. This is like very very beginner stuff.
Pobiega
Pobiega14mo ago
Read the error message! What does it say?
The king of kings
I will dabble check any spelling errors next time I promise you The name 'identifier' does not exist in the current context
Pobiega
Pobiega14mo ago
and what does that mean, in your own words?
The king of kings
I mean it's very obvious
Pobiega
Pobiega14mo ago
like, pretend Im brand new to C# explain what that error message means to me
The king of kings
That the variable shown in the error message is different than the one is already declared
Pobiega
Pobiega14mo ago
no it just means "there is no variable (or other thing) in the current scope with that name" when you see this error message, you stop and think. What am I trying to access? Is that thing in scope? Did I type the right thing?
The king of kings
I mean the the capital S is different than the small s
Pobiega
Pobiega14mo ago
yes, but thats not what that error message means it didnt say "typo in name identifier, expected 'S' found 's'" because the compiler doesnt know what you are trying to do
The king of kings
No
Pobiega
Pobiega14mo ago
it just knows you tried to access a variable that doesnt exist
The king of kings
Ok Yeah! That's about it. Thank goodness it's solved now
The king of kings
The code in the image seems confusing to me
Pobiega
Pobiega14mo ago
why
The king of kings
why are they passing parameters in the ctor Encoding.Default, false ?
Pobiega
Pobiega14mo ago
Ok Faraj, quizz time Can a class have more than one constructor?
The king of kings
I love quizzes Of course why not
Pobiega
Pobiega14mo ago
quizz over, you passed yes, classes can have multiple constructors. https://learn.microsoft.com/en-us/dotnet/api/system.io.streamreader?view=net-7.0#constructors as we can see here, StreamReader has one that takes... a string, an encoding and a boolean
Pobiega
Pobiega14mo ago
The king of kings
I mean you get one default ctor the first time you create a class and then you could define second one too depending on what you're trying to do. Ok! I saw it here in the docs too, why would I need to pass these params Encoding & a boolean?
Pobiega
Pobiega14mo ago
How about you read that documentation maybe that would answer your question
The king of kings
Ok! I will definitely do.
The king of kings
I got an idea about Encoding but still need to know the boolean papr
Pobiega
Pobiega14mo ago
The king of kings
I mean it says this but still it's not so clear to me
The king of kings
OMG there's a ton of information for each dame concept and it takes too much time to read read read and etc.. 🙆🏻‍♂️
Pobiega
Pobiega14mo ago
then skip that part for now skip the encoding and the bool, they are after all "optional", in that there is a constructor that doesnt use them
The king of kings
Ok! Yeah! I don't need to complicate stuff. I need to write the text file, but I wanna do it in a different way, instead of the foreach loop
private void button1_Click(object sender, EventArgs e)
{
var bookList = new List<string>();
if (File.Exists(@"C:\Users\moham\Downloads\tips_texter(1).txt"))
{
using (StreamReader reader = new("tips_texter(1).txt", Encoding.Default, false))
{
while (reader.ReadLine() is string item)
{
bookList.Add(item);
}
reader.Close();
}
}
label1.Text = textBox1.Text;
listBox1.Items.Add(label1.Text);
MessageBox.Show(listBox1.Items.Count.ToString());
}

private void button2_Click(object sender, EventArgs e)
{
this.Close();
}
private void button1_Click(object sender, EventArgs e)
{
var bookList = new List<string>();
if (File.Exists(@"C:\Users\moham\Downloads\tips_texter(1).txt"))
{
using (StreamReader reader = new("tips_texter(1).txt", Encoding.Default, false))
{
while (reader.ReadLine() is string item)
{
bookList.Add(item);
}
reader.Close();
}
}
label1.Text = textBox1.Text;
listBox1.Items.Add(label1.Text);
MessageBox.Show(listBox1.Items.Count.ToString());
}

private void button2_Click(object sender, EventArgs e)
{
this.Close();
}
. Figure out a format What do you think wise man 😁 ?
Pobiega
Pobiega14mo ago
? I have no idea what you are asking
The king of kings
Really 😆 I mean the foreach loop, and the code underneath? Is there aanother alternative?
Pobiega
Pobiega14mo ago
?? you make no sense Are you trying to read or write? What have you tried? Where are you stuck?
The king of kings
. I'm reading data from text file Sorry, I might asked the wrong question.
Pobiega
Pobiega14mo ago
then why the hell are you saying "I need to write the text file"
The king of kings
Hahahaha sorry, it was just missunderstanding that's all.
The king of kings
I have done the point one and two. Now I need to implement the third one
The king of kings
Importerade texter ska sparas bla bla bla @pobiega
Pobiega
Pobiega14mo ago
Post your code then
The king of kings
Ok! Gladly.
public partial class Form1 : Form
{


public Form1()
{
InitializeComponent();
}

private void button1_Click(object sender, EventArgs e)
{
var bookList = new List<string>();
if (File.Exists(@"C:\Users\moham\Downloads\tips_texter(1).txt"))
{
using (StreamReader reader = new("tips_texter(1).txt", Encoding.Default, true))
{
while (reader.ReadLine() is string item)
{
Book novel = new ();
bookList.Add(item);
}
reader.Close();
foreach (string item in bookList)
{
string[] array = item.Split(new string[] { "," }, StringSplitOptions.None);
}
}
}
label1.Text = textBox1.Text;;
MessageBox.Show(listBox1.Items.Count.ToString());
}

private void button2_Click(object sender, EventArgs e)
{
this.Close();
}
}
public static CreateBookFromLine(string book)
{

}
}
public partial class Form1 : Form
{


public Form1()
{
InitializeComponent();
}

private void button1_Click(object sender, EventArgs e)
{
var bookList = new List<string>();
if (File.Exists(@"C:\Users\moham\Downloads\tips_texter(1).txt"))
{
using (StreamReader reader = new("tips_texter(1).txt", Encoding.Default, true))
{
while (reader.ReadLine() is string item)
{
Book novel = new ();
bookList.Add(item);
}
reader.Close();
foreach (string item in bookList)
{
string[] array = item.Split(new string[] { "," }, StringSplitOptions.None);
}
}
}
label1.Text = textBox1.Text;;
MessageBox.Show(listBox1.Items.Count.ToString());
}

private void button2_Click(object sender, EventArgs e)
{
this.Close();
}
}
public static CreateBookFromLine(string book)
{

}
}
Pobiega
Pobiega14mo ago
There is a lot of weird going on here
public static CreateBookFromLine(string book)
public static CreateBookFromLine(string book)
this is not a valid method signature
while (reader.ReadLine() is string item)
{
Book novel = new ();
bookList.Add(item);
}
while (reader.ReadLine() is string item)
{
Book novel = new ();
bookList.Add(item);
}
you create a blank novel, then add the string? why bother creating novel then? Also, I'm not sure if is string item will handle EOF correctly.
foreach (string item in bookList)
{
string[] array = item.Split(new string[] { "," }, StringSplitOptions.None);
}
foreach (string item in bookList)
{
string[] array = item.Split(new string[] { "," }, StringSplitOptions.None);
}
so we turn the entire file into a list of strings (why not just use File.ReadAllLines in that case?) only to then later "process" the strings by splitting them and... doing absolutely nothing with the result.
The king of kings
Ok! I was told by another dev to define that method to use it with book objects, but then I didn't continue using it. It's spoused to be
Book novel = new CreateBookFromLine();
Book novel = new CreateBookFromLine();
` Ok! I was told by another dev to define that method to use it with book objects, but then I didn't continue using it. It's spoused to be
Book novel = new CreateBookFromLine();
Book novel = new CreateBookFromLine();
Could you show me an example on what you mentioned?
Pobiega
Pobiega14mo ago
First hit on google....
Pobiega
Pobiega14mo ago
File.ReadAllLines Method (System.IO)
Opens a text file, reads all lines of the file into a string array, and then closes the file.
Pobiega
Pobiega14mo ago
First hit on google....
The king of kings
Ok I'm done now with the reading string[] array = File.ReadAllLines(path) right?
Pobiega
Pobiega14mo ago
Yup
The king of kings
Awesome But how do I go and do separator thing the "delimiter" like , ; # ?
Pobiega
Pobiega14mo ago
thats unrelated to reading from a text file but you would probably use string.Split
The king of kings
Oh! Sorry, I asked the wrong question. You're right. This thing comes in the book type instantiation. Where we should split these
The king of kings
I mean when I add these lines to a list after reading them, they should be separated by # symbol, right?
The king of kings
in this tutorial the guy is passing a variable that stores the file, in my case what should I be passing? https://www.youtube.com/watch?v=cST5TT3OFyg&t=435s
IAmTimCorey
YouTube
C# Data Access: Text Files
To sign up for announcements about new videos and exclusive discounts, fill out this form: https://signup.iamtimcorey.com/ (your email will be kept safe and you will not be spammed). Data access in C# is not really hard, but there is a lot of conflicting information out there. This video will help you clear up how to read from and write to a te...
The king of kings
.
Pobiega
Pobiega14mo ago
Here are some questions for you to answer. What does that file represent? What does each row/line of that file represent? What separates a field from another? What does the first, second, third and fourth "fields" per line represent?
The king of kings
Great questions. I think we need to get deep inside the file, so I understand what's going on.
Pobiega
Pobiega14mo ago
You should be able to answer all of them within seconds.
The king of kings
the file is consisted of some lines of data that can be read and imported by the StreamReader object Each line represent some fields with different data types
Pobiega
Pobiega14mo ago
Incorrect. Incorrect.
The king of kings
They are separated by delimiter like # ; , and etc..
Pobiega
Pobiega14mo ago
wrong.
The king of kings
I mean they're not actual feilds like we have in c# because they're only texts, but the represent fields. Answering the last question, they represent fields.
Pobiega
Pobiega14mo ago
no
The king of kings
What I got F grade for all my answers 😆
Pobiega
Pobiega14mo ago
You're thinking of this entirely wrong.
What does that file represent?
The king of kings
Really
Pobiega
Pobiega14mo ago
What does it REPRESENT what ideas or information does this file contain? explain the purpose of this file not that it IS a file that can be read by StreamReader, thats true for every single file ever
The king of kings
I remember you used text file in one of the projects that I was building, you told me text file is instead of taking user input by Console.WriteLine(); I mean it's only data that's it
Pobiega
Pobiega14mo ago
YES Its a file full of data, in this case books ok next question
What does each row/line of that file represent?
The king of kings
ChatGPT
Pobiega
Pobiega14mo ago
Did I ask "what does a text generator know about the concept of text files?"
The king of kings
No, you asked what does a file represent?
Pobiega
Pobiega14mo ago
no I didnt I asked "What does THIS file represent?"
The king of kings
Yeah! This is what I meant too. Ok A title, author, type and availability of a book.
Pobiega
Pobiega14mo ago
more like "a book" but okay
The king of kings
Yes my friend It's pretty clear from the names representation
Pobiega
Pobiega14mo ago
ok, now...
What separates a field from another?
if each row represents a book, what separates the different "fields"?
The king of kings
hhhmm
Pobiega
Pobiega14mo ago
how is this a "hhhmmm" question? Use your eyes look at the file content
The king of kings
I told you before delimiter and you said incorrect ###
Pobiega
Pobiega14mo ago
Correct! previously you said "# , . etc" all of those are wrong the only delimiter you have here is ###
The king of kings
Really Yeah! In my case. But we should be able to use a different symbols too. like ; , .
Pobiega
Pobiega14mo ago
???????????????? Did I ask "what are common delimiters?"
The king of kings
does the text file accepts only ### Nope
Pobiega
Pobiega14mo ago
THIS PARTICULAR TEXT FILE uses ### and ONLY that
The king of kings
I'm just giving my opinion
Pobiega
Pobiega14mo ago
And I didn't ask for it and its not relevant here
The king of kings
Of course
Pobiega
Pobiega14mo ago
I wanted you to look at the file and go "ah, this file uses ### as the delimiter"
The king of kings
You're right only ### and nothing else
Pobiega
Pobiega14mo ago
because that information is VERY important to solving this "problem" if other files use , or not is 100% irrelevant
The king of kings
OMG Now, I see where you going with this.
Pobiega
Pobiega14mo ago
Really.
The king of kings
Yeah diffentely correct So when I asked you about the delimiter, you told me that's unrelated to reading Any more questions?
Pobiega
Pobiega14mo ago
What does the first, second, third and fourth "fields" per line represent?
The king of kings
First is book title, author, type and availability. They represent fields Right? You seem like you're playing a game
Pobiega
Pobiega14mo ago
I am Yes, they are indeed title author category and .. something else, availability sounds good so now that we know all this, and we know how to read a file into a string[] what do we do next?
The king of kings
Awesome man. I really miss playing games, I did it a lot when I was younger. What console do you have and what game?
Pobiega
Pobiega14mo ago
I mostly play on PC currently Diablo 4.
The king of kings
Really not ps 5 or Xbox Ok! Swedish kids talk about some game called Fortnite all the time or Minecraft.
Pobiega
Pobiega14mo ago
yup, they did 10 years ago and they still are 😄 and those are kids games, so makes sense
The king of kings
Good question, I like the way you review things accurately and follow by steps, then it seems much clear and easier to see the flow. Let me see
Pobiega
Pobiega14mo ago
thats literally what programmers do :p
The king of kings
Ok I need to sleep we can contiue tomorow Back on track
Pobiega
Pobiega14mo ago
Progress?
The king of kings
Yeah! But after my VS were closed and the project wasn't saved of me, so I think I lost it. Now, I've created a new one with almost the same implementation. I reached this step so far
using System.Text;

namespace BookTips
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}

private void textBox1_TextChanged(object sender, EventArgs e)
{
List<string> bookList = new List<string>();
if (File.Exists(@"C:\Users\moham\Downloads\tips_texter(1).txt"))
{
using (StreamReader reader = new StreamReader(@"C:\Users\moham\Downloads\tips_texter(1).txt", Encoding.Default, false))
{
while (reader.ReadLine() is string item)
{
bookList.Add(item);
}
reader.Close();
foreach (string item in bookList)
{
string[] bookParts = item.Split(new string[] { "###" }, StringSplitOptions.None);
string title = bookParts[0];
string author = bookParts[1];
string type = bookParts[2];
if (bool.TryParse(bookParts[3], out bool availability))
{
MessageBox.Show($"Conversion successful. Result: {availability}");
}
else
{
MessageBox.Show("Conversion faild. Invalid boolean value.");
}


}
}
}
}
}
}
using System.Text;

namespace BookTips
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}

private void textBox1_TextChanged(object sender, EventArgs e)
{
List<string> bookList = new List<string>();
if (File.Exists(@"C:\Users\moham\Downloads\tips_texter(1).txt"))
{
using (StreamReader reader = new StreamReader(@"C:\Users\moham\Downloads\tips_texter(1).txt", Encoding.Default, false))
{
while (reader.ReadLine() is string item)
{
bookList.Add(item);
}
reader.Close();
foreach (string item in bookList)
{
string[] bookParts = item.Split(new string[] { "###" }, StringSplitOptions.None);
string title = bookParts[0];
string author = bookParts[1];
string type = bookParts[2];
if (bool.TryParse(bookParts[3], out bool availability))
{
MessageBox.Show($"Conversion successful. Result: {availability}");
}
else
{
MessageBox.Show("Conversion faild. Invalid boolean value.");
}


}
}
}
}
}
}
Pobiega
Pobiega14mo ago
okay its... a bit convoluted, but it seems okay looks like you stopped half way thou also, why a messagebox on the bool conversion? 😄
The king of kings
That's a good question Since, I'm new to Winforms. How do I validate the conversion of the TryParse method then? Like what should I be using instead?
trunksvn
trunksvn14mo ago
been reading this form and most of your questions the answer is on google why
Pobiega
Pobiega14mo ago
what do you mean? why should you use anything at all? I'd just use bool.Parse tbh not even tryparse. if the value is invalid, throwing an exception is fine because that means the file cant be trusted And to be honest, Faraj, at this point.... you gotta start thinking for yourself its been a year, and your problem solving skills are still very underdeveloped it takes you several days, WITH HELP, to reach a point a beginner should be able to reach in an hour or two
TheRanger
TheRanger14mo ago
first to make this requirement you have to create a class called book first, did you create it?
The king of kings
But it takes a good coding skills to find solution bro it's not that easy. Well! I could've used only Parse and it can throw an exception where TryParse doesn't throw an exception but returns a boolean value. I try to use TryParse so often mostly for practicing purposes.
Pobiega
Pobiega14mo ago
its not that simple sometimes its correct to throw the exception, sometimes its not when parsing user input, tryparse is most often correct when reading from a file the user shouldnt be editing by hand, I think its correct to throw but parsing the bool is a trivial part of this problem its not the thing you should be focusing on
The king of kings
I know and we have discussed this in the chat server too. But just like said it could be a good practice to validate imperfect data.
Pobiega
Pobiega14mo ago
perhaps worry about that later you still need to actually solve the main problem
The king of kings
I totally agree with you on this and I'm doing all I can and that's it. It's a hard skill and I know many people here in the server they struggle and have having a hard time with practicing it's not only me. Thank you for showing up here in the thread bro. I have created the class + sub-classes.
TheRanger
TheRanger14mo ago
what sub classes?
Pobiega
Pobiega14mo ago
Of course you are not alone, but you do struggle more than most others. This leads me to believe that your current approach to learning might not be correct. If you have classes, why are we not seeing them in your code above?
The king of kings
Man, I told the others about this too but they were constantly saying no you need to expect that the data can be imperfect. I think you're about that.
Pobiega
Pobiega14mo ago
To be fair, you seem to be asking for help in like 4 different places, giving different context in each. but in this case, its not user provided data you are not validating the strings at all, so why the bool?
The king of kings
This is my problem. I waste day and night only for a small stupid issue where I could use that time to practice more relevant stuff. I need to start a new strategy.
Pobiega
Pobiega14mo ago
In my opinion, you are focusing too much on code, and not enough on problemsolving You need to actively practice and work on your ability to break down a problem into smaller tasks
The king of kings
Let me show you
Pobiega
Pobiega14mo ago
for example this one, there is so muhc more than just reading from a file going on
The king of kings
internal class Book
{
public string Title;
public string Author;
public bool Availability;
public string Type;

public Book(string title, string author, bool availability, string type)
{
Title = title;
Author = author;
Availability = availability;
Type = type;
}

public override string ToString()
{
return $"the title {Title} the author {Author} availability {Availability} the type {Type}";
}
}
internal class Book
{
public string Title;
public string Author;
public bool Availability;
public string Type;

public Book(string title, string author, bool availability, string type)
{
Title = title;
Author = author;
Availability = availability;
Type = type;
}

public override string ToString()
{
return $"the title {Title} the author {Author} availability {Availability} the type {Type}";
}
}
Pobiega
Pobiega14mo ago
there is turning a string into a an instance of a class, there is the GUI elements, there is the the actual file reading, which can be done in a multitude of ways
The king of kings
internal class Novel : Book
{
public Novel(string title, string author, bool availability) : base(title, author, availability, "(ShortStoryCollection)")
{

}

public override string ToString() => $"The title {Title} the author {Author} availability {Availability} the type {Type}";
}
internal class Novel : Book
{
public Novel(string title, string author, bool availability) : base(title, author, availability, "(ShortStoryCollection)")
{

}

public override string ToString() => $"The title {Title} the author {Author} availability {Availability} the type {Type}";
}
Pobiega
Pobiega14mo ago
Is there a requirement to have subclasses for Novel etc?
trunksvn
trunksvn14mo ago
LISTEN TO US PowerSlap
The king of kings
Yeah! My problem is I set and think generally about the whole program and not splitting into small steps and this lead to waste at least 5 days with confusion. I'm sooo tired of this learning method.
trunksvn
trunksvn14mo ago
catshy
The king of kings
I just showed them Yeah! This is very wrong too. It causes even more confusion, because everyone has a different approach.
Pobiega
Pobiega14mo ago
yeah but where is your var book = new Book(...) in the code above then? you've MADE classes, but you dont use them
The king of kings
Yes, just take a look at line 3 in the requirements.
TheRanger
TheRanger14mo ago
besides its asking you to save as books, of the correct subclass
Pobiega
Pobiega14mo ago
ah I see. you have missed several of these btw for example, your file reading code should be in its own class
The king of kings
Well! This is where I needed to know how to implement that on line 3.
Pobiega
Pobiega14mo ago
i think its time to stop writing code and start thinking you need to plan your stuff more
The king of kings
Aha! Which class?
Pobiega
Pobiega14mo ago
Read your requirements. Line 2 i believe.
The king of kings
Yeah! I think this is definitely what I should be doing. Ok It says I should be adding a class + import the date + save as books is this easy to do?
Pobiega
Pobiega14mo ago
yes
The king of kings
Save the data as books in a list Well! For you not for me bro. It's easy for you because you have done it before so many times and I have not done this before.
Pobiega
Pobiega14mo ago
to some extent of course, but at the same time, you have the code for all of this already you just need to re arrange it a bit, and make some methods
The king of kings
Ok
Pobiega
Pobiega14mo ago
tell you what, here is your once in a lifetime offer. lets jump on screenshare and ill teach you how to break the problem down. Ill give you 45 minutes at most.
The king of kings
See this is where I get stuck and try to find a way on how to do that. Awesome man. Thank you sooo much.
Pobiega
Pobiega14mo ago
wrong channel #dev-vc-1 @Faraj ...
friedice
friedice14mo ago
doomed
Pobiega
Pobiega14mo ago
How does it take 5+ minutes to notice you are in the wrong channel, when I have even pinged you? O_O
JansthcirlU
JansthcirlU14mo ago
@Faraj it's better if you post any additional questions that you have here so people can help you in chat you have the chance that people won't look at them
The king of kings
Thanks a lot buddy. You're right. I don't ask in the chat anymore, there are some people confuse me with many different opinions and some come to me and say "You've been in c# for a year" why you haven't learned the fundamentals, they act like they're Bill GATES or Steve Jobs and if you ask them about their education background, they all spent at least a year in the fundamentals in computer science uni.
JansthcirlU
JansthcirlU14mo ago
yes, that's certainly hurtful especially when you're trying hard to try to learn, but it's also important to plan and chop up your learning path into smaller pieces before moving on to doing too much if you're overwhelmed with the material to learn, it's good to start from the very basics and make sure you really understand those, and feel comfortable with them, before moving on to something more complicated I briefly watched Pobiega teach you and he really broke down the problem and tried to teach you how to think like a programmer, using the features that the C# language provides
The king of kings
I really don't care what others say. But I don't wanna bother ask them for coding questions either.
JansthcirlU
JansthcirlU14mo ago
that's perfectly fine, you should learn because you want to learn and not to please others, but please understand that having a learning strategy is also important and that you don't dive in head-first
The king of kings
Yeah! You're absolutely right. He is really good and giving the right tips and path to learn and think like a programmer. This talk changed the way that I was learning. The whole time I was taking a very wrong learning path.
JansthcirlU
JansthcirlU14mo ago
so how has your learning strategy changed, can you summarise what you're trying to do now?
The king of kings
Yes, that's really good question. The first thing I do is split each problem into small steps where I think clearly and figure out what I'm doing and why? I read my code step by step and I Google for solution and read the docs and the most important thing is I test code not just read read read the docs. I try to think about every tiny concept in code, why this? How to do this? What can I do with this?
JansthcirlU
JansthcirlU14mo ago
those are very useful things to do
The king of kings
Are you from Eu or US btw?
JansthcirlU
JansthcirlU14mo ago
I'm from EU
The king of kings
Wow, awesome. I'm from Sweden.
JansthcirlU
JansthcirlU14mo ago
I'm from Belgium
The king of kings
Great. I hear sometimes from Belgium it's a nice country and not as cold as here 😆
Pobiega
Pobiega14mo ago
(and they make good beer)
The king of kings
Are you a developer like senior, because I feel like you have a good enough experience from what you usually write. hahahaha really
JansthcirlU
JansthcirlU14mo ago
no lol I'm very much still a junior I like programming but I focus too much on .NET and I don't take enough time to learn about other technologies that work with .NET (such as HTML and CSS for making websites, for example)
The king of kings
I have never touched a girl in whole my entire life and never drink anything except for coca cola and never smoked either because I'm muslim.
JansthcirlU
JansthcirlU14mo ago
obviously I can't force you to try our beers but even though I'm biased I must say we make good beer there's plenty of bad beers here too but most are good
The king of kings
Really! I'm impressed. I like to ask you this because you're the one. How long experience do you have in .NET? What does it take to be a junior dev, because this is my goal. Ok! I know nothing about beers, because I never drink anything like that. I love sport and this makes me happy healthy and grateful always.
JansthcirlU
JansthcirlU14mo ago
the Belgian government provides training to get you ready for certain jobs, and I did the training for .NET development for about 9 months before I started at my first job my first job went pretty bad because I was too inexperienced but the next job I got I had a great senior dev who taught me many things and in total I've been programming for about 3 years now, but I still have lots to learn
The king of kings
Ok! So you had 9 months and you felt inexperienced. Wow, what a luck. Thanks to him you're living your dream of becoming a junior where people struggle to get this position.
JansthcirlU
JansthcirlU14mo ago
absolutely, a good mentor makes a huge difference so it's good that you ask questions in this discord server because there are so many people with so much experience that can point you in the right direction
The king of kings
Man every successful programmer or business owner talks about getting a mentor, it's very stupid and wasting time to ignore or be greedy to pay for a mentor where you could save sooo much time, confusion and headacke. Like Pobgia, Klarth, thinker and Merit they're really good and very very very supportive developers.
The king of kings
I think this guy Tim Corey looks a good teacher too and he offers courses on his website like this one I'm thinking about to purchase https://www.iamtimcorey.com/courses/csharp-mastercourse/
C# Mastercourse - IAmTimCorey
Master C# from the ground up. Get real-world ready by the time you complete this mastercourse.
JansthcirlU
JansthcirlU14mo ago
actually, have you done $helloworld before?
TheRanger
TheRanger14mo ago
you should drink water often 😄 drinking coca cola only doesnt sound healthy
The king of kings
Not really sure if I will benefit or become a junior dev after finishing the course as he claims, but maybe worth to try. Although I see no reviews either.
JansthcirlU
JansthcirlU14mo ago
don't worry about what it means to be a junior or senior dev, worry about learning and retaining more knowledge than yesterday or last week or last month
The king of kings
Well! I used to drink coca cola. but since it contains too much dame caffeine, so I gave up this for a long time ago. Caffeine in coca cola effects my brain, I can't sleep and the next day I end up with too much brain fog and I look stupid when coding later.
JansthcirlU
JansthcirlU14mo ago
TheRanger is right, water is healthier, but if you want something more flavorful you can always drink tea as well
TheRanger
TheRanger14mo ago
i drink coffee at morning at night is bad, will keep me awake
The king of kings
Exactly, today I regret of my bad mistakes and my learning path which I wasted a lot of time following a wrong path of learning coding, but following the Pobgia tips will save me a lot of time in the coming assignments and projects. You're right. According to the sleep expert, you should drink coffee 14 hours before you sleep. That means not after 10 o'clock, because out brain contains some amount caffiene.
The king of kings
Dr Rangan Chatterjee
YouTube
Sleep Expert REVEALS How Caffeine DESTROYS Your Sleep & Productivit...
Today’s guest is world-leading sleep researcher, author of the international best-selling book ‘Why We Sleep’ and Professor of Neuroscience and Psychology, Matthew Walker. Matthew shares research on the effects of caffeine on our sleep. Caffeine is a sleep disruptor, and just one dose of caffeine in the evening can decrease the amount of deep ...
The king of kings
Check out this video For becoming a developer, I do the following every dame day. I never drink coffee later than 10, I never eat or drink sugary products, I train every morning at 5:30, I do meditation every morning, I go to bed before 10 o'clock. I take could shower two times everyday. I set on the computer everyday for many many hours and lastly I do physical activities like football, floor-ball, hide and seek games with the kids and bicycle every weekend. 😁 isn't that funny I always thought why I'm doing all this and not getting forward in coding then I realized my learning method was wrong, so it's not the health issue.
JansthcirlU
JansthcirlU14mo ago
it seems like you're a very busy man, so I imagine it's hard to find the time to learn
The king of kings
No, man. I'm a single and I study a course on 100 percent rate and work 100 percent and I do the activities when I'm finish with learning and during the weekend. Are you expected to know all these as a junior like OOP Linq Interface UI Delegate and a framework like .NET Maui? Do you know all that?
Pobiega
Pobiega14mo ago
OOP, Linq, interface, delegates.. yes. MAUI, no. ASP.NET, probably yes but varies based on job
The king of kings
Ok! I thought so too. Basically, a junior dev needs to know the following above in order to help the company when building apps or websites, right?
JansthcirlU
JansthcirlU14mo ago
Those things you've mentioned are quite abstract and you will need to understand the fundamentals of a programming language before you can try to apply those abstract principles But yes, they're very widely used by programmers of any level of expertise
The king of kings
Ok! Yeah! I should learn and practice all these before jumping into any career or something. Although they're not easy.
Pobiega
Pobiega14mo ago
You will need to know these to have a chance at landing a job, most likely.
The king of kings
Yeah! I will do whatever whatever whatever it takes to reach this goal. I think investing on a good courses would help me to reach this goal. Learning by my self it's very boring way to learn.
Accord
Accord14mo ago
Was this issue resolved? If so, run /close - otherwise I will mark this as stale and this post will be archived until there is new activity.