Programmers talks

posted
Total Posts
17
show more
Kert
string IsThereAnyWayToImproveAtOsu(int for_user_id)
{
if(for_user_id != 124493)
return "playmore";
else
return "die";
}
Ephemeral
no ternary operator? for shame
SYAHME
Just noob programmer.
Topic Starter
-Makishima S-

Ephemeral wrote:

no ternary operator? for shame
string IsThereAnyWayToImproveAtOsu(int for_user_id)
{
string snx = (for_user_id != 124493) ? "play more" : "die";
return snx;
}
I don't use it too often so i am not sure if properly coded. Didn't looked for wiki, i promise.
Kert

Ephemeral wrote:

no ternary operator? for shame
Ternary is bad if you want to expand the code later
yeah right it's very needed here
Topic Starter
-Makishima S-
Kert is right.
Ternary is good for simple checking, like
string xyz = (foo == isFoo()) ? "Success" : "Error";
I hate reading code with ternary spam and tons of code inside it, it's a pain in the ass to fix / expand code there.
Old practice of spamming if - else works for me and let me make code more readable.

On Software engineering classes in university i remember that my teacher never forced anyone to using ternary, maybe that's why i often don't even realize it can be used.
Flanster
WPF sux and those who recommended it to me for better looks can eat a brick.
WinForms can do whatever the fuck you want aslong as you know how to

An example is my NotRainmeter program.
AshbeII
if(miss) {

this.invalidate();
MessageBox.Show("play more");
}
OT: idk i can only winform
DNR
public static void main(String[] args) {
System.out.println("I hate living I want to \ndie."
}
abraker
WARNING: Running this will simulate several years of your life in less than a second. It's best you don't know your future!
#define is ==
#define and &&
#define not !
#define quit false
#define osu is true
#define SS not quit
#define you SS and not quit osu
#define miss is true
#define retry not quit osu;
#define complain true
#define ask true is
#define get is you and complain
#define gud is SS;
#define pp is SS;
#define shitpost return(false);


int main()
{
while (not quit osu)
{
while (not SS)
{
if (you miss) retry
else if (not 300) retry
else retry

complain and ask 2 get gud
}

you get pp
shitpost
}

}
bigfeh

abraker wrote:

WARNING: Running this will simulate several years of your life in less than a second. It's best you don't know your future!
#define is ==
#define and &&
#define not !
#define quit false
#define osu is true
#define SS not quit
#define you SS and not quit osu
#define miss is true
#define retry not quit osu;
#define complain true
#define ask true is
#define get is you and complain
#define gud is SS;
#define pp is SS;
#define shitpost return(false);


int main()
{
while (not quit osu)
{
while (not SS)
{
if (you miss) retry
else if (not 300) retry
else retry

complain and ask 2 get gud
}

you get pp
shitpost
}

}
I've never seen a snippet of code that has more preprocessor statements than actual code

gore is a compliment, I'm out of words
Vuelo Eluko
holy shit its BigFeh
Please sign in to reply.

New reply