In my C code, I use C++ keywords for my variable names whenever I can. I'll use variable names like "private" and "catch" in header files, so they can't be included in C++ code. I name my variables "old" and "new", or "this" and "that". I also deliberately skip casts in situations where they'd be perfectly ok in C but invalid in C++.
If I do have to use C++, I make sure to use every possible feature of the language. I strive to systematically piss off anyone who forces me to deal with C++, so that everyone else quits. Then, I will rewrite the entire system in straight C, cut the codebase to a quarter of the size, and make it ten times more readable.
For very large tasks, I will first design a sexp-based domain-specific language, and then proceed to write the entire project in that language. I will make sure that it is slightly different from every existing Lisp implementation, because my boss might have read somewhere that Lisp was antiquated and inefficient.
I am the programmer that employers hate.
Name:
Anonymous2010-06-13 16:39
I heard that a previous developer that left before I joined a company I once worked for had used char vectors as strings and made cunt and penis objects
Name:
Anonymous2010-06-13 16:40
If your code is efficient, and you write it fast, what is the issue?
If you get shit done, nobody should care.
Name:
Anonymous2010-06-13 16:46
If your code is efficient, and you write it fast, what is the issue?
What about correctness? If he wrote his program incorrectly, it doesn't matter how efficient it is. A bug is a bug, and trying to translate code from retarded to normal just to give yourself a chance of finding it is annoying.
Name:
Anonymous2010-06-13 16:47
>>4
I would file that under 'get shit done'. If you both do this and write bad code then you are just an asshole.
I have found that, for some reason, using a test that they didn't bother writing to show people that their code is broken tends to annoy them. It's nice, because these are the very same sort of lazy programmers that I would love to get rid of.
C with C++ keywords
Solved with a simple parser/variable renamer. abusing SEPPLES
Good job wasting your time. I hope you enjoy maintaining it, oh wait, you said you're going to rewrite it in straight C, which brings us to the first point. Sexp-based languages
Most of the code I write is in CL, I have no problem with this, but I do think it's overkill to invoke Greenspun's rule that much. Using a real Lisp will give you much better performance, not to mention that you'll be able to take advantage of existing libraries and the excellent macro support and other language features which you'd have to write from scratch.
Name:
Anonymous2010-06-13 18:18
I don't know how to write tests :| I want to learn though. I just don't understand it or something.
Name:
Anonymous2010-06-13 19:22
>>1
I lol'd.
But wouldn't extern "C" { ... } solve the problem with C++ keywords?
>>9
Refactoring tools are beyond the realm of the typical idiot code-monkeys who fawn over Sepples like it's the fucking second coming of Jesus. I'd use Scheme where applicable; it's typically not installed and beyond the realm of familiarity of those calling the shots to what gets installed and used.
$ cat main.cc #include <iostream>
extern "C" {
#include "other.h"
};
int main(int argc, char **argv) {
std::cout << other(1, 2, 3, 4) << std::endl;
return 0;
} $ cat other.h int other(int this, int that, int new, int old); $ cat other.c int other(int this, int that, int new, int old) {
return this + that + new + old;
} $ gcc -Wall -c other.c
$ g++ -Wall -c main.cc In file included from main.cc:4:0:
other.h:1:15: error: expected ‘,’ or ‘...’ before ‘this’
main.cc: In function ‘int main(int, char**)’:
main.cc:10:38: error: too many arguments to function ‘int other(int)’
other.h:1:5: note: declared here
>>20
Only by morons. If I use NTFS I can't use + in my filenames, but if I use ext3 on the exact same operating system, I can. Which filesystem makes Linux Linux and OpenBDSM OpenBDSM?