Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

.NET 

Chuck Norris Joke Generator

I got bored.

[Image: TG7HZRH.png]

Idk why, but the theme I used got fucked up halfway through and I couldn't change the groupbox. I'm too tired and just woke up so I didn't feel like trying to fix it. Have fun with your chuck norris jokes :D now you can be a real mlg with quick Chuck Norris jokes. glhf
Download sauce + bin.



Wtf I totally changed Form1 to "Chuck Norris Joke Generator. Whatever. Kek. GETTING coffee now ;D


Oh. And I know it can be optimized. Once again, I just got bored and I just woke up. Optimize it if you like, it's like 2 lines of code :P
(Jul 26, 2015 05:35 AM)Uzi London ++ Wrote:  Optimize it if you like, it's like 2 lines of code :P

Well, if you absolutely insist...

Code
Private Function GetJoke(joke As JokeType) As String
    Using wc As New WebClient
      Return wc.DownloadString("http://api.predator.wtf/joke/?arguments=" & joke.ToString())
    End Using
End Function

Public Enum JokeType
    nerdy
    explicit
End Enum

Edit- Some suggestions:
-You've already imported your namespaces, why continue to qualify them?
-Remember to dispose your requests, responses and streams. Wrap in Using blocks.
-You're mixing between title case and camel case, always the latter for local.
-No use in catching the exception if you're going to do nothing with it.
-Parenthesize methods.

I won't pick up on the Dispose call.
(Jul 26, 2015 06:09 AM)Odus Wrote:  Well, if you absolutely insist...

Code
Private Function GetJoke(joke As JokeType) As String
    Using wc As New WebClient
      Return wc.DownloadString("http://api.predator.wtf/joke/?arguments=" & joke.ToString())
    End Using
End Function

Public Enum JokeType
    nerdy
    explicit
End Enum

I won't pick up on the Dispose call.

I'm sorry. Please don't hit me :<
awsome now i can use a lion to click the mouse like chuck noris
[Image: 0NPSJZ1.png]

(Jul 26, 2015 06:09 AM)Odus Wrote:  Well, if you absolutely insist...

Code
Private Function GetJoke(joke As JokeType) As String
    Using wc As New WebClient
      Return wc.DownloadString("http://api.predator.wtf/joke/?arguments=" & joke.ToString())
    End Using
End Function

Public Enum JokeType
    nerdy
    explicit
End Enum

Edit- Some suggestions:
-You've already imported your namespaces, why continue to qualify them?
-Remember to dispose your requests, responses and streams. Wrap in Using blocks.
-You're mixing between title case and camel case, always the latter for local.
-No use in catching the exception if you're going to do nothing with it.
-Parenthesize methods.

I won't pick up on the Dispose call.

Hey, you should keep naming conventions in enums as well
So capitalize those fuckers, and call tolower()
[Image: jlscvfi.png]


Possibly Related Threads...
Thread / Author Replies Views Last Post
[Python] by Snowdrop14Jan 19, 2016 06:41 PM 4 400 Jan 19, 2016 06:41 PM
Last Post: horrorland1
[.NET] by Chuck Norris .Feb 4, 2013 06:44 PM 175 10,150 Feb 4, 2013 06:44 PM
Last Post: Silv
[Shell] by TobleroneJul 2, 2012 04:43 AM 14 363 Jul 2, 2012 04:43 AM
Last Post: AMDjack