Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Bad Programming Practices

Name: Anonymous 2010-10-19 0:35

Each post must contain one bad programming practice to add to the list. I'll start:

In C++, overload library functions by using #define. That way it looks like you are using a familiar library function where in actuality you are using something totally different.

Name: Anonymous 2010-10-19 0:42

putting a { on the same line that a function is declared

Name: Anonymous 2010-10-19 0:43

Coding in C++

Name: Anonymous 2010-10-19 0:46

Posting on this board.

Name: Anonymous 2010-10-19 0:47

Never write comments - good code (that is *my* code) explains itself

Name: Anonymous 2010-10-19 0:49

>>5
good programmers should be able to trace through a program no problem and discover what it's doing without comments, now if you're learning the language then the examples should have them, but unless you're a retad you probably don't need comments k

Name: Anonymous 2010-10-19 0:53

Everything >>6-chan codes.

Name: Anonymous 2010-10-19 3:54

Using a language other than C++, C#, Java, or Visual Basic.Net.

Name: Anonymous 2010-10-19 3:56

Hax my anus.

Name: Anonymous 2010-10-19 5:00

>>2
Wait really?
Why? I'm not good at this and I've been doing it.

Name: Anonymous 2010-10-19 5:08

>>10
Doing that increases the velocidensity of the sector of your hard drive where the file is stored, which in turn means that there will be less velocidensity available for your music files. If you use lossy compression you won't notice the difference, but your FLAC files will gradually lose information.

Name: Anonymous 2010-10-19 5:15

void.h

Name: Anonymous 2010-10-19 5:25

>>11
Oh that makes sense.

Name: Anonymous 2010-10-19 5:30


Type *p = (Type *)malloc(n * sizeof (Type));

Name: Anonymous 2010-10-19 6:01

sub show_post($$$$$$$$$$$){
  my($num,$thread,$time,$name,$trip,$link,$comment,$ip,$file,$filename,$deleted)=@_;
  if($deleted){

%>

  <div class="post">
   <p class="deleted"><%= S_DELETEDPOST %></p>
  </div>

<% }else{ %>

   <div class="post">
    <p class="postheader">
     <span class="postnum"><%= $num %></span>
     <%= S_NAME %>

<% if($link){ %>

     <a href="<%= $link %>">

<% } %>

      <span class="postername"><%= $name %></span>
      <span class="postertrip"><%= $trip %></span>

<% if($link){ %>

     </a>

<% } %>

     : <span class="posttime"><%= $time %></span>
     <%= S_ID %><span class="id"><%= $link=~/sage/?'Heaven':make_id($thread.$ip) %></span>
    </p>
    <div class="postbody">

<%

    if($file){
     my @fileparts=split /\./,$file;
     my $ext=pop @fileparts;
     my $file=join '.',@fileparts;

%>

     <div class="image">
      <a href="<%= expand_filename("src/$file.$ext") %>">

<% if($ext =~ /^(?:jpg|gif|png|svg)$/){ %>

       <img src="<%= expand_filename("thumb/$file.gif") %>" alt="<%= $filename %>" title="<%= $filename %>" />

<% } else { %>

       <span class="nothumb"><%= S_NOTHUMB %>:<br /><%= $filename %></span>

<% } %>

      </a>
     </div>

<%

    }

%>

     <div class="commenttext">
      <%= $comment %>
     </div>
    </div>
   </div>

<%

  }
 }

Name: Anonymous 2010-10-19 7:41

Using + for string concatenation

Name: Anonymous 2010-10-19 8:07

Using anything but Scheme

Name: Anonymous 2010-10-19 8:11

int RandomInt(int r){
     return 4;
}

Name: Anonymous 2010-10-19 8:13

>>18
Go away.

Name: Anonymous 2010-10-19 8:15

>>16
Would you say that the + operator is a bad practice in base1 as well then?

Name: Anonymous 2010-10-19 8:28

>>16
Please learn about monoids, thank you.
(+) is a natural candidate for the monoidal operation because it is always associative and usually commutative.

Name: Anonymous 2010-10-19 8:31

>>18
Fuck off ``Randall.''

Name: Anonymous 2010-10-19 8:36

Overloading operators.

Name: Anonymous 2010-10-19 8:39

>>21
You're just an idiot who read the definition of a monoid and thinks his babbling is relevant to the problem of str1 + str2. You make me so angry.

Name: Anonymous 2010-10-19 8:52

It is relevant, fucktard.
Fuck off.

Name: Anonymous 2010-10-19 8:53

Doing stupid Code Golf tricks like: using the ternary operator inline where an if/else would make the flow easier to follow.

Name: Anonymous 2010-10-19 9:01

Singleton and Factory design patterns. In fact, most 6design patterns9.

Name: Anonymous 2010-10-19 9:04

perl

Name: Anonymous 2010-10-19 9:30

>>16
get out.

Name: Anonymous 2010-10-19 9:58

>>3,17,27,28
These men speak the truth

>>2
DIE FAGGOT DIE

Name: Anonymous 2010-10-19 10:22

>>22
CHOSEN BY A FAIR DICE ROLL

HAHAHA FUCK YOU NIGGER

HAVE YOU READ YOUR XKCD TODAY

Name: Anonymous 2010-10-19 10:36

>>31
The exit is on your left. Do not enter this establishment again.

Name: Anonymous 2010-10-19 11:04

>>32
Fuck you I won't do what you tell me.

Read xkcd everyday -- it makes the /prog/fags more annoying.

Name: Anonymous 2010-10-19 11:05

Perl 5 is pigu disugasutingu.

Using it is a programming error.

Why is
sub proc{my @arr=('a','b','c');return @arr};print( (proc())[1] );,
possible, but not
sub proc{my %h=('a'=>'b','c'=>'d');return %h};print( (proc()){'a'} );

UNLIMITED IRRITATION WORKS

Name: Anonymous 2010-10-19 11:16

>>34
Because you touch yourself at night.

Name: Anonymous 2010-10-19 11:28

>>34
Because fuck you that's why

Name: Anonymous 2010-10-19 11:58

>>34
Because perl only has scalar and list contexts.
Use return \%h; and proc()->{a}, no True Programmer uses anything but references.

Name: Anonymous 2010-10-19 11:59

>>35
>>36
butthurt perl ``faggots''

Name: Anonymous 2010-10-19 13:02

>>34
I was going to say what >>37 did.

Also, it works exactly as you have it in Perl 6. Try it: http://try.rakudo.org/

>>37
no True Programmer uses anything but references.
Refs are a pain in perl5. It's the only time sigil variance causes problems (indirectly) for me. OTOH in Perl 6 refs are implicit most of the time, and during assignment you use the binding operator instead of taking a ref and assigning that.

Name: Anonymous 2010-10-19 15:28

magic numbers

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List