![]() |
|
[.NET] [LEARNING VB] Made a useless app | Suggestions for imporvement? [LEARNING VB] - Printable Version +- Hack Forums (https://hackforums.net) +-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444) +--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151) +---- Forum: Software Development (https://hackforums.net/forumdisplay.php?fid=118) +---- Thread: [.NET] [LEARNING VB] Made a useless app | Suggestions for imporvement? [LEARNING VB] (/showthread.php?tid=4842630) |
[LEARNING VB] Made a useless app | Suggestions for imporvement? [LEARNING VB] - Khamul - May 30, 2015 Ok so I made a Pastebin grabber (without using 'http://pastebin.com/raw.php?i=') just to try and learn a few things about regex, string arrays and various other things... Pretty dumb I know but on the upside it does work! Example: Spoiler (Click to View) Code (Yes it is going to be shitty, also just forget the fact I used multithreading and only used 1 thread, it was because I was just experimenting with multithreading then had the idea for this app): Spoiler (Click to View) Anyone have any useful project ideas that I could have a go at to try and improve? I'm very new to VB btw... * - Neos07 - May 30, 2015 Some ideas: - Chat spammer - Facebook, Twitter... account creator - Screen Capture - Assembly and icon changer - Email Bomber * - Nicktron - May 30, 2015 Please post your code, we can't really tell you where to improve, if we can't see anything else than the design. * - Khamul - May 30, 2015 (May 30, 2015 04:42 AM)Nicktron Wrote: Please post your code, we can't really tell you where to improve, if we can't see anything else than the design. Ok I have done. Let me know what I have done wrong! * - Nicktron - May 30, 2015 First of all, when you work with threads, import "System.Threading". Second, don't set Me.CheckForIllegalCrossThreadCalls to false. Google on how to use delegates. Third, this line: "TextBox1.AppendText(CStr(line & Environment.NewLine))" it is not necessary to use CStr, it could be: TextBox1.AppendText(line & Environment.NewLine) Thats all I have for a quick look. :) Also this is fine for a beginner, I must say. * - Ninja - May 30, 2015 (May 30, 2015 04:32 AM)Neos07 Wrote: Some ideas: Don't make a tool that does this all in one. It would be horrible. * - Khamul - May 30, 2015 (May 30, 2015 05:19 AM)Nicktron Wrote: First of all, when you work with threads, import "System.Threading". Thanks for your feedback, About the 'Cstr' thing, people have said using this is a good habit but I guess since 'line' is already declared as a string it's not needed. * - Nicktron - May 30, 2015 (May 30, 2015 06:17 AM)Microsoft Word ® Wrote: Thanks for your feedback, About the 'Cstr' thing, people have said using this is a good habit but I guess since 'line' is already declared as a string it's not needed. My pleasure 🤝 Also I don't see why it would be a good habit, since it's already a string as you said. :) * - Odus - May 30, 2015 I was preparing to write up a huge response because I see a lot that can be improved on, until I saw this: (May 30, 2015 04:24 AM)Microsoft Word ® Wrote: I'm very new to VB btw... Someone very new should not be working with IO, networking, Regex (even though I can't see it in the code you provided), and threads. I'm guessing you kind of glided your way through the project with the help of the internet for each problem you ran in to and slushed each snippet together, correct? This is an awful way to program so I'd suggest channeling your ambitions into learning from the start. (May 30, 2015 06:17 AM)Microsoft Word ® Wrote: Thanks for your feedback, About the 'Cstr' thing, people have said using this is a good habit but I guess since 'line' is already declared as a string it's not needed. My guess is they mean it's a good habit to work with Option Strict on. Btw Calling CStr/ToString() explicitly is redundant when using the & operator since it implicitly converts the operands it's concatenating to their string type representations. * - Khamul - May 30, 2015 (May 30, 2015 08:21 AM)Odus Wrote: I was preparing to write up a huge response because I see a lot that can be improved on, until I saw this: Thanks for the feedback, I kind of have tried 'learning from the start' and this was the first real 'project' I have attempted... I did get a few snippets from other people and I know that's not a great way to do things but I'd say most of the code I didn't know before this I got from MSDN and adapted it to my needs... I'm going to buy a few books so I can have a reference of some of the basics that I sometimes forget...I might just wait until September when I start my Computer Science degree at university. * - BahNahNah - May 30, 2015 If you are new to vb you should start with console applications. Try making a simple console calculator. * - Ninja - May 30, 2015 (May 30, 2015 08:42 AM)BahNahNah Wrote: If you are new to vb you should start with console applications. Try making a simple console calculator. Why console? A GUI for a calculator is not hard at all. * - BahNahNah - May 30, 2015 (May 30, 2015 08:43 AM)Tyranitar Wrote: Why console? A GUI for a calculator is not hard at all. It is for someone who has just started vb. * - Khamul - May 30, 2015 (May 30, 2015 08:43 AM)Tyranitar Wrote: Why console? A GUI for a calculator is not hard at all. Sorry guys for the confusion, I'm new to VB as in I've been trying to learn on and off for about a month and a bit...I've already made a GUI calculator but thanks for the suggestion. |