News:

Herr Otto Partz says you're all nothing but pipsqueaks!

Main Menu

Write in C (song) - I laughed a lot!

Started by Cas, January 10, 2021, 07:21:26 AM

Previous topic - Next topic

Cas

I have to share this with you, guys. I was looking up about languages that are not OOP (I hate OOP), languages that I didn't know about. I know the first answer is always C, but C is ambiguous about graphics so this is a problem that goes on forever. Anyway, in a forum, somebody had asked this same question and I started reading and somebody else just replied by posting these lyrics:

When I find my code in tons of trouble
Friends and colleagues come to me
Speaking words of wisdom
Write in C

As the deadline fast approaches
And bugs are all I can see
Somewhere someone whispers
Write in C

Write in C, write in C
Write in C, write in C
LISP is dead and buried
Write in C

I used to write a lot of FORTRAN
For science it worked flawlessly
Try using it for graphics
Write in C

If you just spent nearly 30 hours
Debugging some assembly
Soon you'll be glad to
Write in C

Write in C, write in C
Write in C, yeah, write in C
Only wimps use BASIC
Write in C

Write in C, write in C
Write in C, write in C
Pascal won't quite cut it
Write in C

Write in C, write in C
Write in C, write in C
Don't even mention COBOL
Write in C

And when the screen is fuzzing
And the editor is bugging me
I'm sick of ones and zeroes
Write in C

A thousand people swear that
TP7 is the one for me
I hate the word "procedure"
Write in C

Write in C, write in C
Write in C, write in C
PL/1 is '80s
Write in C

Write in C, write in C
Write in C, write in C
The government loves Ada
Write in C

;D  While I disagree about C being good for graphics, these lyrics are just genius!
Earth is my country. Science is my religion.

dreadnaut

Oh, that song brings me back ;D  It might be as old as Stunts at this point, so back then C was great for graphics, at least compared to the alternatives.

QuoteI was looking up about languages that are not OOP (I hate OOP)
I wonder if you hate "OOP" (such a loaded term) or you hate the enterprise software pattern that certain languages—coughJava—enable, and the some industries love.

Most languages support objects today, but they also support functional constructs and streaming. That means you can pick any big hybrid language (say Python, PHP, Ruby, JavaScript, gah, even Java) and write in the paradigm you prefer. Or you can "pick and mix", but you need to look at each paradigm and understand what it is good for, and what's better done in a different way.

As a recent entry, you might enjoy Rust, which is fairly low-level and is trying to be a better C (more safety via compiler checks, and less pointer madness, as far as I understand)

That said, you can write good and bad software in any language. If I can pass along the smallest principle that makes the larger difference, I would say:

write code that looks like this:

a = calculateSomethingWith(7)
b = calculateSomethingElseWith(a)
output(b)

calculateSomethingWith(x) {
  return x*2
}

calculateSomethingElseWith(y) {
  return y - 3
}

instead of code that looks like this

n = 7
doSomething()

doSomething {
  a = n*2
  outputSomethingElse(a)
}

outputSomethingElse(z) {
  b = z-3
  output(b)
}


Go wide, not deep. Avoid global state. Get back a result as soon as possible and then work from there.

Cas

Yes, precisely!  I wouldn't be annoyed if OOP in languages were just support for some particular structures... That's fine for me. What I don't like is this fashion that everything has to be in the object or class and you add a layer of abstraction every single time you have the chance. It's much better to create a set of functions and use them; that's it. Then there's also some very "insulting" syntax for the eye of the logic-lover, ha, ha. The simplest example is...

Why would one write: John.give(money, Peter)... when you can write: Give(John, money, Peter)?

But however horrible that looks, I have to admit that bit is purely a matter of taste... I mean, there're people who like roast chicken with plum juice and that's OK.

Most languages that include OOP possibilities let you use whatever paradigm you want, but a few make a very strong effort to force you to use OOP, like is the case of Java. That is truly annoying. Still, in FreeBasic, that I use very much, OOP is just something they added so that people wouldn't complain, so I can make my programs fully OOP-free, but the problem is I get to their forum and half the programmers write everything OOP, so I can barely read their code. I don't know if it's just as difficult for people who are accustomed to OOP to read procedural code as it is for us to read OOP, but I have the feeling that it's easier for them. It takes me a very long time to "translate" in my mind when I come across OOP code.

So Rust... I'm going to take a look at it. Haven't heard of it before. Thanks!!
Earth is my country. Science is my religion.