- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- (id)init:(NSString *)score{
if (self = [super init]) {
// Custom initialization
[self initWithNibName:@"Score_View" bundle:nil];
self.total_score=[score copy];
}
return self;
}
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
−153
- (id)init:(NSString *)score{
if (self = [super init]) {
// Custom initialization
[self initWithNibName:@"Score_View" bundle:nil];
self.total_score=[score copy];
}
return self;
}
Отличная инициализация контроллера.
+142
class Program
{
static void Main()
{
A a = new A();
E e = new E();
e = (E)(D)(C)(B)(A)a; //обычная конвертация =)
}
}
class A { }
class B : A { }
class C : B { }
class D : C { }
class E : D { }
Обычная явная конвертация =)
−207
public function Square()
{
_image = new Image();
_image.smoothBitmapContent = true;
_mask = new Image();
Level.instance.addEventListener("squaresCreated", squareCreatedHandler);
}
/*
* Добавляет монстров на field по событию "squaresCreated".
* Почему эта логика не в field не ебу.
*/
private function squaresCreatedHandler(evt:Event):void
{
if (isMonster)
{
Level.instance.field.addChild(_fieldMonster);
_fieldMonster.x = this.x;
_fieldMonster.y = this.y;
}
}
Мимими, всегда бы такие комменты в коде встречать
+111
ul.conference-menu > li:first-child:hover
{
/* Люди мы не местные, есть нам нечего */
padding-left: 0px;
padding-right: 0px;
margin-right: 5px;
margin-left: 18px;
}
+142
if(selected == 3){
if(count == 1){
displayIntResult(0);
}else{
if(count == 1){
displayIntResult(0);
}else{
// код
}
}
// код
}
Надо больше спать. Обнаружено после ночи кодинга
−85
[self.navigationItem setLeftBarButtonItem:[[[UIBarButtonItem alloc] initWithCustomView:[(TANavigationBar *)self.navigationController.navigationBar backButtonWith:[UIImage imageNamed:@"ActivityNavBackButtonBackground"] highlight:nil leftCapWidth:30.0f]] autorelease]];
Однако, это печально :(
И не индус вроде
+97
If bd12tc->mes!=num_month
st_mes=num_month
Else
st_mes=bd12tc->mes
EndIf
Clipper
Перевожу на работе старую программку (писалась больше 12 лет назад) в Delphi, нашёл вот такое
+138
//
switch (cwin->cpref->shuffle) {
case TRUE:
last = g_list_last(cwin->cstate->rand_track_refs);
if ((!cwin->cstate->curr_rand_ref) || (last && (cwin->cstate->curr_rand_ref == last->data))){
path = get_next_unplayed_random_track(cwin);
if (!path)
rand_unplayed = TRUE;
}
else path = get_next_random_ref_track(cwin);
break;
case FALSE:
path = get_next_sequential_track(cwin);
if (!path) seq_last = TRUE;
break;
default:
break;
}
буль...
+100
procedure interpretation;
var
s,f:string;
i,m,v:integer;
begin
s:=#0;
for I:=0 to form9.Memo2.Lines.Count-1 do begin
s:=form9.Memo2.Lines.Strings[i];//ïðîñìîòð ñòðîê èäåò
//ñâåðõó âíèç
if s='hex' then hex;
if s='acsii' then acsii;
if (s[1]='a') and (s[2]='d') and (s[3]='d') then begin
form9.Edit6.Text:=s[5];
form9.Edit5.Text:=s[7];
peredsim;
end;
if (s[1]='s') and (s[2]='a') and (s[3]='m') then begin
form9.Edit2.Text:=s[5];
form9.Edit4.Text:=s[7];
samsimbyl;
end;
if (s[1]='d') and (s[2]='e') and (s[3]='l') then begin
form9.Edit3.Text:=s[5];
for v:=1 to length(s) do
deletesimbyl;
end;
if (s[1]='d') and (s[2]='e') and (s[3]='l') and (s[4]='s') then begin
form9.Edit3.Text:=s[6];
dels;
end;
if (s[1]='i') and (s[2]='n') and (s[3]='f') then begin
form9.Memo1.Text:=s[5]+form9.Memo1.Text;
end;
if (s[1]='f') and (s[2]='n') and (s[3]='i') then begin
form9.Memo1.Text:=form9.Memo1.Text+s[5];
end;
if (s[1]='p') and (s[2]='h') and (s[3]='e') then RapsrRedel;
if (s[1]='n') and (s[2]='a') and (s[3]='b') then PerstNO;
if (s[1]='a') and (s[2]='t') and (s[3]='s') then acsiitosim;
if (s[1]='h') and (s[2]='t') and (s[3]='s') then hextosim;
if (s[1]='h') and (s[2]='t') and (s[3]='a') then hextoacsii;
if (s[1]='a') and (s[2]='t') and (s[3]='h') then acsiitohex;
end;
end;
Нужно было быстро накодить интерпретатор, которым никто пользоваться не будет, кроме собственно автора программы, для создания простеньких скриптов (сами понимаете семантический анализатор писать, в данном случае не улыбалось). Потому получился такой МегОАдЪовый говнокод!
+71
Calendar calendar = new GregorianCalendar();
calendar.setTime(new Date(System.currentTimeMillis()));