``````if ( variable )
{

}
else
{
Console.WriteLine("Wrong")
}``````

He doesn't know what "Not" is it :|

``````A,B=map(str,input().split())        # let's begin by casting strings to strings!

while(int(A)!=0 and int(B)!=0):

tamanhoa=0
tamanhob=0

for i in range(len(A)):
tamanhoa+=1                 # wonderful way to determine the length of
# a string!
for i in range(len(B)):
tamanhob+=1

vA = [0]*tamanhoa
vB = [0]*tamanhob

if tamanhoa>tamanhob:
vA = [0]*tamanhoa           # Just to make sure it really gets set!!!
vB = [0]*tamanhoa

for i in range(tamanhoa-1,-1,-1):
vA[i]=int(A[i])         # he even saved an operation by casting
# the char to int at the same time!
for i in range(tamanhob):
vB[i+1]=int(B[i])
elif tamanhoa<tamanhob:
vA = [0]*tamanhob           # Just to make sure it really gets set!!!
vB = [0]*tamanhob

for i in range(tamanhoa):
vA[i+1]=int(A[i])

for i in range(tamanhob-1,-1,-1):
vB[i]=int(B[i])

tamanhoa=tamanhob

else:
for i in range(tamanhoa):
vA[i]=int(A[i])

for i in range(tamanhob):
vB[i]=int(B[i])

print(vA)
print(vB)

carry = 0

for i in range(tamanhoa-1,-1,-1):
soma = vA[i] + vB[i]
if soma > 9:
carry += 1
if vA[i-1]!= 9:
vA[i-1] += 1
else:
vB[i-1] +=1

if carry == 0:
print('No carry operation.')
elif carry == 1:
print(carry, 'carry operation.')
else:
print(carry, 'carry operations.')

A,B=map(str,input().split())    # why bother casting strings to int? yay

if int(A)==0 and int(B)==0:
break
``````

This wonder was found within answers to a university programming test. Code as-is, comments added by me.

``````<?php
if(isset(\$_POST['csrf'])){
if(\$_POST['csrf'] !== \$_SESSION['csrf']){
return 'session expired!';
}
}``````

In all `Sama Samaneh` university and class management system from iran :)

``````try {
User.ClaimToken();
}
catch {
User.ClaimToken();
}``````
``````  \$guard = (\$vars->a_payment) + (0) * \$price;
if (\$bless >= \$guard) {
\$amount = \$bless;
}
``````

Why not to write just 1 line?! \$amount = max(\$bless, \$vars->a_payment);

``````...
if (alignEntrySize & 1)
alignEntrySize++;
if (alignEntrySize & 2)
alignEntrySize += 2;
...``````
``````string month = DateTime.Today.Month.ToString();
if (DateTime.Today.Month < 10)
{
month = "0" + month;
}
string day = DateTime.Today.Day.ToString();
if (DateTime.Today.Day < 10)
{
day = "0" + day;
}

string dateCorrect = String.Format("{0}.{1}.{2}", DateTime.Today.Year, month, day);

string dateDue = "";
if (transferFields.DueDate.SelectedDate.HasValue)
{
var dateDuearr = transferFields.DueDate.Value.Split(' ')[0].Split('.');
dateDue = dateDuearr[2] + '.' + dateDuearr[1] + '.' + dateDuearr[0];
}
else {
dateDue = dateCorrect;
}``````

Real developers don't use built in parsing and formatting methods.

``````//count to 10
#include <iostream>
#include <string>

int main()
{
int i = 0;

beginning:
if (i < 10) {
std::cout << ++i << std::endl;
goto beginning;
}
else goto end;

end:
return 0;
}``````
``````@Override
public void afterTextChanged(Editable s) {
switch (paymentType) {
case 0:
if (s.length() == 9) etPaymentAmount.requestFocus();
break;
case 1:
if (s.length() == 9) etPaymentAmount.requestFocus();
break;
}
}``````
``````/**
* Creates hash of client/customer password
* @return string MD5 hash of password with salt
*/
{
}``````
``````<?php
\$now = time();

while (\$now + 10 > time()) {

// Just chill...smoke a blunt
}

echo "Done.\n";``````
`````` foreach (Byte bajt in data ) {
BufferIndex = i++;
if (!char.IsControl((char)bajt))
MyCharacter = Convert.ToChar(bajt).ToString();//Encoding.ASCII.GetString(new[]{bajt});
else
MyCharacter = " ";

if (BufferIndex == 200)
{
int a = BufferIndex;
}

if (BufferIndex < 200)
{
sw.WriteLine("PrintBuffer1[" + BufferIndex + "] :=\t" + bajt + "\t; // " + String.Format(@"0x{0:x2}", (ushort)bajt) + "\t" + MyCharacter );
}

if (BufferIndex >= 200 && BufferIndex  < 400)
{
BufferIndex = BufferIndex - 200;
sw.WriteLine("PrintBuffer2[" + BufferIndex + "] :=" + bajt + "; // " + String.Format(@"0x{0:x2}", (ushort)bajt) + "   " + MyCharacter);
}
if (BufferIndex >= 400 && BufferIndex < 600)
{
BufferIndex = BufferIndex - 400;
sw.WriteLine("PrintBuffer3[" + BufferIndex + "] :=" + bajt + "; // " + String.Format(@"0x{0:x2}", (ushort)bajt) + "   " + MyCharacter);
}
if (BufferIndex >= 600 && BufferIndex < 800)
{
BufferIndex = BufferIndex - 600;
sw.WriteLine("PrintBuffer4[" + BufferIndex + "] :=" + bajt + "; // " + String.Format(@"0x{0:x2}", (ushort)bajt) + "   " + MyCharacter);
}
if (BufferIndex >= 800 && BufferIndex < 1000)
{
BufferIndex = BufferIndex - 800;
sw.WriteLine("PrintBuffer5[" + BufferIndex + "] :=" + bajt + "; // " + String.Format(@"0x{0:x2}", (ushort)bajt) + "   " + MyCharacter);
}
if (BufferIndex >= 1000 && BufferIndex < 1200)
{
BufferIndex = BufferIndex - 1000;
sw.WriteLine("PrintBuffer6[" + BufferIndex + "] :=" + bajt + "; // " + String.Format(@"0x{0:x2}", (ushort)bajt) + "   " + MyCharacter);
}
if (BufferIndex >= 1200 && BufferIndex < 1400)
{
BufferIndex = BufferIndex - 1200;
sw.WriteLine("PrintBuffer7[" + BufferIndex + "] :=" + bajt + "; // " + String.Format(@"0x{0:x2}", (ushort)bajt) + "   " + MyCharacter);
}
if (BufferIndex >= 1400 && BufferIndex < 1600)
{
BufferIndex = BufferIndex - 1400;
sw.WriteLine("PrintBuffer8[" + BufferIndex + "] :=" + bajt + "; // " + String.Format(@"0x{0:x2}", (ushort)bajt) + "   " + MyCharacter);
}
if (BufferIndex >= 1600 && BufferIndex < 1800)
{
BufferIndex = BufferIndex - 1600;
sw.WriteLine("PrintBuffer9[" + BufferIndex + "] :=" + bajt + "; // " + String.Format(@"0x{0:x2}", (ushort)bajt) + "   " + MyCharacter);
}
if (BufferIndex >= 1800 && BufferIndex < 2000)
{
BufferIndex = BufferIndex - 1800;
sw.WriteLine("PrintBuffer10[" + BufferIndex + "] :=" + bajt + "; // " + String.Format(@"0x{0:x2}", (ushort)bajt) + "   " + MyCharacter);
}
if (BufferIndex >= 2000 && BufferIndex < 2200)
{
BufferIndex = BufferIndex - 2000;
sw.WriteLine("PrintBuffer11[" + BufferIndex + "] :=" + bajt + "; // " + String.Format(@"0x{0:x2}", (ushort)bajt) + "   " + MyCharacter);
}
if (BufferIndex >= 2200 && BufferIndex < 2400)
{
BufferIndex = BufferIndex - 2200;
sw.WriteLine("PrintBuffer12[" + BufferIndex + "] :=" + bajt + "; // " + String.Format(@"0x{0:x2}", (ushort)bajt) + "   " + MyCharacter);
}

}``````

don't repeat yourself.. whyy we don't have PrintBufeer[i] ?

``````var list = new List<string>() { // Assume some items in the list };

for (var i = 0; i < list.Count; i++)
{
var item = list[i];
list.Remove(item);

i--;
}``````

Simple alternative to `List.Clear()`

``````int min(int a,int b,int c) //Function to return the minimum.
{
if(a < b)
{
if(a < c)return a;
else if(a > c)return c;
else return a;
}
else if(a > b)
{
if(b < c)return b;
else if(b > c)return c;
else return b;
}
else
{
if(a < c) return a;
else if(a > c) return c;
else return a;
}
}``````

This kind of things make me hate my work.

``````    function changePassword() {
if (isInputEmpty()) {
\$.ajax({
type: 'POST',
data: '...'
url: '...',
success: function (result) {
if (result.substring(0, 3) != "!!!") {
//success
} else {
//faliure
}
},
error: function () {
}
});
}
}``````

And of course,in production, it always reported success and never changed the password, because of equally bad server code.