The Mezunian

Die Positivität ist das Opium des Volkes, aber der Spott ist das Opium der Verrückten

DIJO QUE LLEVA EL NUEVO DISPARAN AL TIEMPO PRIMO

a

b

a • a

c

a • b

d

a • a • a

b • b

a • c

e

a • a • b

f

a • d

b • c

a • a • a • a

g

a • b • b

h

a • a • c

b • d

a • e

i

a • a • a • b

c • c

a • f

b • b • b

a • a • d

j

a • b • c

k

a • a • a • a • a

b • e

a • g

c • d

a • a • b • b

l

a • h

b • f

a • a • a • c

m

a • b • d

n

a • a • e

b • b • c

a • i

o

a • a • a • a • b

d • d

a • c • c

b • g

a • a • f

p

a • b • b • b

c • e

a • a • a • d

b • h

a • j

q

a • a • b • c

r

a • k

b • b • d

a • a • a • a • a • a

c • f

a • b • e

s

a • a • g

b • i

a • c • d

t

a • a • a • b • b

u

a • l

b • c • c

a • a • h

d • e

a • b • f

v

a • a • a • a • c

b • b • b • b

a • m

w

a • a • b • d

c • g

a • n

b • j

a • a • a • e

x

a • b • b • c

d • f

a • a • i

b • k

a • o

c • h

a • a • a • a • a • b

y

a • d • d

b • b • e

a • a • c • c

z

a • b • g

A

a • a • a • f

b • c • d

a • p

B

a • a • b • b • b

C

a • c • e

b • l

a • a • a • a • d

D

a • b • h

c • i

a • a • j

b • b • f

a • q

d • g

a • a • a • b • c

e • e

a • r

b • m

a • a • k

c • c • c

a • b • b • d

E

a • a • a • a • a • a • a

b • n

a • c • f

F

a • a • b • e

d • h

a • s

b • b • b • c

a • a • a • g

G

a • b • i

H

a • a • c • d

b • o

a • t

e • f

a • a • a • a • b • b

c • j

a • u

b • d • d

a • a • l

I

a • b • c • c

J

a • a • a • h

b • b • g

a • d • e

c • k

a • a • b • f

K

a • v

b • p

a • a • a • a • a • c

d • i

a • b • b • b • b

L

a • a • m

b • c • e

a • w

M

a • a • a • b • d

f • f

a • c • g

b • b • h

a • a • n

N

a • b • j

c • c • d

a • a • a • a • e

b • q

a • x

O

a • a • b • b • c

P

a • d • f

b • r

a • a • a • i

c • l

a • b • k

e • g

a • a • o

b • b • b • d

a • c • h

Q

a • a • a • a • a • a • b

R

a • y

b • c • f

a • a • d • d

S

a • b • b • e

T

a • a • a • c • c

Posted in Poetry, Programming, What the Fuck Is this Shit?

But Lispers Are Worse

Last week I made fun o’ Ruby for the crime o’ being used by idiots who don’t e’en know why they like it.

But Lispers are hilariously crazy. Just read through the “SmugLispWeenies” pages on C2Wiki, a TV Tropes for programming that bewilderingly has e’en fewer standards & civility.

Just look @ this:

Most “commercial grade” coders are little better than faeces hurling monkeys randomly bashing at their terminals and making the odd primitive grunt in the machine’s general direction. Really, it’s an insult for a computer to have to tolerate some of the shit I have seen spewed at them by their neuronally challenged masters. Go away and learn to actually reason about code before you start the “Language X is superior to language Y” pissing competition; otherwise you just look like a pack of nitwits. I can shoot a stream of piss much farther than you can, but that’s because I’m standing on top of a mountain. Keep that in mind next time you think it’s raining.

Remember this next time somebody tells you programmers are geniuses. This is them when the cameras aren’t rolling, just like your grampa talking ’bout the black folks ( Well, ’less your grampa’s black & not that black KKK member from that Dave Chappelle sketch ).

That italic ( er… non-italic now, since it’s in a usually-italic blockquote ) is someone else jutting their text into someone’s paragraph. It’s quite common on this site & makes reading it feel like reading the raving rants o’ a schizophrenic. I’m not e’en sure which is the Lisper & which… ¿isn’t? ¿Maybe they both are? Maybe some drunk guy just randomly stumbled on this site & decided to post this & nobody e’en realized ’twas irrelevant.

Just afterward we get a nice paragraph ’bout some Lisper fantasizing ’bout being God & using his totalitarian powers to banish object-oriented programming & Java, the Lisper’s greatest enemy, from all schools & that people with such “prior exposure” “should be considered mentally mutilated beyond all reasonable hope of recovery and should simply be shot on compassionate grounds”.

Hilariously ’nough, 1 guy who labels himself a smug atheist ( ¿isn’t that a redundancy? — hur, hur ) goes on some anal-retentive tangent ’bout how that guy’s comparison to banning OOP & Java to banning heroin from pre-schools is inaccurate, <squeaky voice>since it’s truly the Federal government that bans it everywhere, which simply cascades down to the state level & schools, Sir</squeaky voice>. He then goes on to say that he still understands that other person’s “pain & suffering” & “largely agree[s] with what [he’s] communicating”. The guy wanted to make a eugenics system for people who learned Java in college. It wasn’t e’en particularly people who liked Java — anyone who was e’en “exposed” to Java in college was incurably infected & fit only for the gas chambers.

I mean, I hate Java people now, too, & take back all the nice things I said ’bout Clean Code & its writer’s creepy threat to heathens who don’t recompile & redeploy ’cause I made the mistake o’ taking their advice to refactor my game project based on their super-serious OOP rules that, as it turns out, aren’t exactly consistent in detail ( “Single Responsibility Principle” is hopelessly vague & contradicts “Law of Demeter”, & “Uncle Bob” should go back to writing large books for me to read while I’m on the shitter ) & only made things a bigger hassle & messier. But e’en I think that’s too far. Punishing them by forcing them to make banal business programs for the rest o’ their lives is fine ’nough.

My favorite part ’bout crazy online communities is the conspicuous lack o’ any voice that says, “I’m sorry, ¿but is it me, or are you guys all crazy?”

Man, I joke ’bout language fanatics; but if there e’er was a programming language that’d actually inspire programmer to strap a bomb onto his back & blow up a building, I think it’d be a Lispers. These fuckers are crazy. You don’t fuck with them. Somebody please make them some half-decent GUI libraries so they don’t have to use C++ & break all their fingers on all the colons & angle brackets to make Steam games. Our safety depends on it.

Posted in Programming, What the Fuck Is this Shit?

10 Reasons this Post is No Ruby

Since I’m sick o’ political bickering, I’ll focus on the much mo’ important issue o’ programming language wars.

The most interesting thing ’bout programming languages is how their quality is inversely related to the quality o’ the people who use them. While I’ve found nobody who defends PHP beyond “it’s faster” & “it’s convenient”, & it’s design is so laughably inept, one wonders if ’twas an intentional joke, PHP developers tend to be much better people to be round, since they focus mo’ on actually accomplishing things than whining & scribbling rants ’bout conspiracies gainst the public caring mo’ ’bout practicality o’er their language. Languages like Ruby & Lisp1, meanwhile, were quite elegantly designed, but is filled with some o’ the most socially inept douche bags e’er who have this amusing tendency to try demanding things o’ people o’er whom they have no authority. “¡Just quit whining ’bout [ insert flaw in language ] & just use it!” while whining ’bout flaws o’ some other language. The logic is that if you can’t deal with some absurdity in their language, you’re just too dumb, e’en though the fact that one can remember the quirk ’nough to complain ’bout it should be proof that one can understand it; but if they can’t handle some absurdity in some other language, it’s ’cause it sucks.

To be fair, the 1 exception is the guy who made Ruby himself, Yukihiro Matsumoto, who sounds like a very nice person who seemed to make Ruby for incredibly unpretentious reasons, & e’en said, “I tried to make Ruby perfect for me, but maybe it’s not perfect for you. The perfect language for GuidoVanRossum is probably Python”, which is the inspiration for all my Matsumoto / Rossum slash fics.

I almost get the sense that Google hits get mo’ from attention-grabbing, contentious posts than those that are actually useful. While I’d like to get some useful info on Ruby, ’stead I get some incoherent rant, & now the rest o’ you get to suffer for it. ¿Curious, right? Wink, wink. ( Fuck you. )

{ // Braces, just to further rile Rubyists ( e’en though Rubyists do use braces for hashes — shhh ).

’Nother fun idiotic debate ’mong Rubyists & other people:

“Man, Ruby & Rails have no good documentation. Just this drugged-out shit. Face it, programming is ruined”;

“There’s plenty o’ documentation. Get off your ass & look”

“¿Could you provide some evidence?”;

“Find it yourself. Do something yourself for once”

Nothing better than expecting people to prove a negative.

I can, however, prove that the official Rails guide is so shitty that it actually caused me errors ’cause o’ a dumbass typo:

¡Looks like your prettyful Apple computer couldn’t help you now, DHH, whom I know totally wrote this guide! ( ¡Stop whining & just get off your ass & pay thousands o’ $ on o’erpriced garbage hardware already or I won’t hire you for my shitty company! )

}

This writer, whose job description is apparently “Converting beer to code since 2004” ( ¡& now he’s converting writing to beer for me! ¡How nice! ) wrote an article called “10 reasons not to use Ruby”, which sounds like a drunken rant ’bout how lame Ruby is, man, but is actually a drunken rant gainst people who make ’scuses for not using Ruby, man.

1. Ruby isn’t as mature as Java or PHP

My grandmother has also been around longer than Ruby, but I don’t go about using her to build Web apps every other day.

Maturity == age.

Speaking o’ maturity, that’s an argument a fucking child would make — c’mon. “If PHP’s so great, ¿why don’t you use it to drive to work?, huh”.

2. Ruby isn’t as performant as .NET or Java

That’s true, & is ’specially a problem in web programs, where people are particularly impatient, already have to deal with loading resources ( essentially downloading software as they’re trying to use it ), & likely to be on much slower architecture than the o’erpaid web developer who should probably be doing mo’ to deserve their high pay than worrying ’bout whether their language is fun to use. ( ¡Stop whining ’bout my slow website & just use it, customers! God, ¿why do I e’en let you idiots give me money? )2 Considering how bewilderingly slow websites still are e’en with modern technology, this should be a big issue.

You’re right. Ruby is also slower than Erlang, Lua and C++ but you don’t go about writing Erlang or C++ code every day, do you?

Um, yes, plenty o’ people do.

It’s good to see that we’re still sticking to the sullen technique o’ twisting reasonable arguments to extreme non sequitors. This argument is essentially, “Nothing’s perfect, so any depths o’ quality is acceptable”. Awesome.

Web development isn’t all about code performance.

It’s 1 o’ the most objective ( note, I said “most”, for e’en benchmarks are questionable ) criteria — certainly mo’ than “fun to use” & quickness o’ development.

Your new shiny Web app doesn’t have a million users a day for day one. You need to code it, test it, release it, rinse and repeat, and you need to do that quickly.

Keep in mind that this person is telling you you should experiment with new programming languages — ’cause nothing is quicker than learning new things.

Hiding behind the “performance” argument is not only cowardly, it’s plain wrong, because instead of focusing on releasing your app as quickly as possible, you’re focusing on the unknown promise that one day you might have to worry about scale.

Fucking performance pussies, man.

So, it’s wrong ’cause it’s not important in this writer’s opinion — ’cause nothing’s worse than wasting your time preparing for the future. It’s much mo’ professional to only focus on spewing out shitty software as quickly as possible.

¿Aren’t Ruby programmers s’posed to be smart? & I must say, it’s probably mo’ “cowardly” to change topics to development speed to avoid actually addressing the issue.

3. Well, Ruby apps scale as well as .NET or Java apps.

“I say so, therefore it’s true”.

We all end up there, clench our teeth and handle it like adults.

So that’s how you optimize Ruby. You can’t really blame detractors for not understanding such an obscure — & I must say unorthodox — method.

“Handl[ing] it like adults” apparently means bitching ’bout imaginary critics online & making appeals to extremes.

We might do it differently, but we do it all the same and usually begin at the DB level rather than the application level. Curious, right?

You’ll have to show a bit mo’ cleavage 1st, Sir.

4. Ruby doesn’t work well on Windows

¿It doesn’t? Worked fine for me. Not sure what magic allowed Compass to work all those years I used to have Windows.

Instead of banging your head against the wall, complaining that you’re used to Windows and all that jazz, just take a deep breath, install Linux and get on with life. Technology is about learning new things, not staying in your comfort zone forever.

“Just quit whining & setup a whole ’nother operating system just so you can fulfill my language fetish”.

I have a better idea: how ’bout you guys quit whining & make Ruby work well with Windows.

’Cept Ruby works fine for Windows, so maybe you should just stop arguing with idiots — worse, strawman idiots you made up in your schizophrenic head. I can imagine all the ghostly voices dragging him down to his knees — echo 'use $PHP…'; echo 'use $PHP…'; puts you.leave_alone! me

5. Ruby isn’t as popular or commonly used as PHP

Perhaps a less stupidly-circular argument based on true concerns is Ruby’s lack o’ easy compatibility with existing services, such as MySQL or common hosts. For example, my host doesn’t have Ruby installed, so using Ruby would be an absolute no for any o’ my websites ( a’least for distribution — in development, all bets are off3 ), as much “funner” it is to use than lame ol’ PHP & it’s dumbass error-handling or “echo” function. Rubyists would tell me that I need to change my entire host & go with some obscure, o’erpriced alternative, ’cause shared hosts are, like, a “ghetto”, or something.

( Or maybe that’s Rails — all ’cause Shaw hates a bunch o’ people he had to work with & ’cause dumbass DHH had to restart his server a lot, I guess. )

Technology isn’t a popularity contest, otherwise we would all be developing Websites in Javascript (currently the most popular language on Github).

Um, we are all making websites in JavaScript ( well, we’re making lowercase websites in camel-case JavaScript, a’least ). For instance, Rails, which I’m sure this guy uses, uses JavaScript, e’en if it has to compile a superfluous cheap knockoff into it 1st for no good reason. That’s ’cause JavaScript is the defacto language o’ browsers.

Technology is means to an end.

That end being feeling cuddly when one types code rather than ensuring compatibility ’tween their code & their architecture or not spending days trying to get a compatible architecture running.

Popularity is a warped factor that tries to measure adoption rate and community activity to help people gauge production-readiness, code stability and support level.

¡Those fiends!

Here’s a novel idea for you then – Try checking production-readiness, code stability and support level on a per-technology basis, rather than throwing popularity figures into the thinning air.

That’s quite hard, considering “per-technology” is vague. “Technology” is anything related to computers. ¿Does he mean software? ¿Hardware? ¿Types o’ software one is making or types o’ software in which one is working? Considering the points ’bout Ruby being slower than PHP & its ilk & the problems o’ compatibility, one could still make good arguments gainst Ruby.

6. The Ruby community is condescending and snobbish

No… That couldn’t be.

Well, yeah, and the Java community is stubborn, the .NET community is closed-minded, the Perl community is quirky and the C++ community is a bunch of middle-aged, pipe-smoking elves.

Though I have nothing to do with the community, he is right that I’m an elf who likes to take a Tolkien toke on the leaf now & then.

Since Ruby is relatively young, and tends towards early adoption of many technologies, Rubyists have a relatively easy life when it comes to trivial stuff like tests, deployment, integrations with 3rd parties and so on. So when a Rubyist is “boasting” that things are easier in the Ruby world, they’re not looking down at you, but merely suggesting there’s a simpler, more pragmatic way of doing things.

See, here’s where we hit the true problem. Languages usually have advantages & disadvantages. Nobody can seriously argue that C isn’t faster than most other languages; they just try to argue that that factor isn’t important. & there’s something to be said ’bout the universality o’, say, JavaScript. Meanwhile, C++’s balance o’ efficiency & high-level abstraction, with a focus on things, makes it great for video games & heavy GUI programs, but probably obnoxious for anything else.

Ruby is I guess a nice-looking language, & it can certainly be used to make well-working software just like other languages. But when Rubyists say that the Ruby “life” o’ deployment & integrations for web development are easy, they’re just straight-up wrong. It’s an ol’ joke that in order to get Ruby frameworks working, you have to jump through a billion hoops — mainly ’cause, as he mentions, they love using obscure tools with li’l compatibility. ¿Why use JavaScript, which works right out o’ the browser, when you could use CoffeeScript, just so you could compile it back into JavaScript? You’d have to be a cave-dweller to not be able to make a program in JavaScript when 10-year-ol’s all o’er the world have been making “¿Which DBZ character are you?” quizzes for years; but that’s not sexy, so let’s add extra complexity ’cause we’re bored. Ruby prefers PostgreSQL e’en though apparently nobody on the internet knows how to use it ’cause all o’ the info I find online is just flat-out wrong ’bout what it’s e’en called in Linux’s terminal, all ’cause MySQL has some obscure imperfections that are immensely rare; web hosts prefer MySQL. & that’s not e’en getting into how you actually get your project off your local computer & onto an actual online host. Apparently you’re just s’posed to use Heroku, which is a lame limitation. It’s so bad that e’en the official Rails guide ne’er bothers to teach you how to put your Rails project online, as if a newbie should be satisfied being able to look @ their shiny Rails project on just their localhost. Ironically, preferring Unix was the 1 thing Ruby did right.

In fact, it’s strange that they make fun o’ PHP for being simple-minded, but also somehow too much o’ a fuss, e’en though on most hosts it works right out o’ the box. Literally all you have to do to get PHP working on a Linux computer is go to the software center & install Apache & PHP & put your files in /var/www/html. To get it working on any host, just upload PHP files to the file system & it works. When one complains ’bout PHP’s language design being half-assed, they’re probably right, as subjective as that may be; but to claim that Ruby is easier to deploy than PHP is nonsense.

In fact, sometimes Rubyists criticize PHP for being too simple — ¡e’en though that’s what Ruby’s s’posed to be good @ in the 1st place! “True developers” apparently don’t just upload files to a file system, e’en if using FTPS, — which doesn’t e’en exist, fingers; keep it up & it’s off to the grill — but [ insert 1 o’ many convoluted, unintuitive methods that hardly anyone uses & is surely incompatible with the vast majority o’ web hosts ]. They claim that performance isn’t an issue for start-ups ( ’cause all programming is for start-ups, & start-ups that are likely to fail are a great source o’ stable, profitable careers ), ’cause hardly anyone visits, ¿but you do need to worry ’bout 1 o’ those nobodies hacking you as you upload files? Rubyists can’t e’en decide what they like ’bout Ruby.

Strangely, this writer ne’er brings up the issue o’ security, which may be the 1 objective advantage Ruby might have o’er PHP. O, wait, maybe it’s a good idea not to bring up security with Ruby.

It’s funny, ’cause there’s so many arguments this guy could make that he doesn’t. There are entire websites dedicated to showing how shitty PHP is. It’s creator has a delightful nonchalance & seems to agree that PHP was just some hack garbage he puked out on 1 drunken evening & looks like he stumbled out o’ 18th-century Britain. It’s like this blog poster is an attorney for a victim o’ Charles Manson & is losing.

7. Ruby is too opinionated and takes away my freedom to do things my way

All languages do this. That’s like complaining ’bout English demanding you to use punctuation. Communication is based on consistent info. This applies just as well ’tween computers & people as ’mong people.

My only problem is the whitespace requirements, which are terrible, & is why I still prefer C-style braces & semicolons — though I think Ruby would work fine with just line-ending punctuation, since block-starters & “end” are just as specific as braces. I hate it ’cause I oft want to break up long lines o’ code & it’s much harder to do than in, say, C++, which lets you break code however you want & will always know where the line ends thanks to the semicolon, & thus saves its ugliness for stds & HTML-tag container templates.

¿Wanna know how an associative array o’ #s looks in C++?

std::unordered_map<std::string, int> gorgeous_list_;

¡What beauty!

( Yes, I know I can use “using std”. If I like namespace poisoning — ¡you revolting savage! )

Then ’gain, maybe Ruby’s better @ breaking up lines, since it does seem to be able to break up ’tween commas. I remember I had trouble breaking up lines in Python once & the solution was apparently to put some god-awful “\” or something & I’m like, ¿isn’t this s’posed to be better-looking than C++?

Let me ask you this – How many ways are there to write an HTTP routing component for a Web app or an image manipulation library?

I ne’er did it without biting: ask Mr. Owl.

Convention over configuration, best practices and clear codings standards don’t take freedom away from developers.

See, this is something I’d agree with, but Ruby doesn’t actually succeed well. For instance, Ruby has a radically different syntax from the C-style convention, including their bizarre use o’ “def” for “function” & “elsif” ( which is the stupidest bastardization o’ English since “RESTful” ) & having object members have a “@” in front o’ them & having static class members have 2 “@”s in front o’ them — ’cause that makes sense. Granted, PHP has those dumbass “$”s. ¿What the fuck is wrong with you people? ¿What e’er happened to the idea that code’s s’posed to be as comprehensible as feasible? ¿What made anyone think that $s & @s aided understanding in any way whatsoe’er?

The truth is that JavaScript’s better than all o’ them, ’cause they call variables “var” & functions “function”. ’Cause that’s what they fucking are. Then they fuck up block scoping & lose all their points.4 Good job.

& though I’m not exactly an expert in programming, despite my smugly pretending like I do throughout this post, I do know a lot ’bout web design standards, & know that Rails violates it in the most ridiculous ways possible. ¿Why didn’t they use that convention o’er configuration idea when deciding to make post, article, whatever entries use the primary key ’stead o’ an automatically-generated slug in the URL & not force me to use some hack that’s apparently been deprecated, but is, as far as I could find out, the only way to do so, & is e’en the way done by the most popular plugins? ’Cause, duh, ¿what’s SEO? ¿Why would anyone want to have the primary key in the URL? The user shouldn’t e’er e’en know ’bout the primary key — it’s there purely for the computer. This is a case where it’d be perfectly safe for Rails to automatically change this & it’d be the best for everyone. ¿Where’s that convention?

Rails also loads a bunch o’ empty JavaScript files for every Controller, e’en if they’re empty, which is a hilariously waste o’ server requests. This is in contrast to the common web-design convention o’ combining common files to minimize the # o’ server requests.

Yeah, I know I can fix these problems. But that’s my point: it’s configuration. Whenever anyone says, “¡But it gets rid o’ tedious configuration!” it always turns out to be bullshit, ’cause as it turns out, the software maker didn’t actually know what I wanted — definitely not ugly #s in my URL or empty JavaScript files clogging my pages’ headers, Rails.

Ruby’s opinionated and convention-driven approach helps developers not only to become more productive, but also to adhere to community-driven standards that aim to reduce boilerplate code to a minimum. Many people can chant the “KISS & DRY” paradigms, yet not as many adhere to it.

It fails. Ruby code has boilerplate code, just like any other language. Read any Rails tutorial & see all the code you’re s’posed to copy & paste. As we’ll both talk ’bout later, Ruby makes you do manual type-checking, which comes automatically in Java & C++ compilers. Also, e’en if you’re not making code everyone else has already made, there’s a good chance you’ll probably need to take just as much time looking up the code to understand how it works, which is why “reinventing the wheel” is actually useful in programming as a learning experience.

The funny thing is that Ruby is one of the only languages I know that lets you change absolutely anything, anytime, anywhere.

Your ignorance o’ Lisp isn’t that funny, nor something to be proud o’.

To be fair, this is the 1 good point Ruby has ’bove PHP. Not JavaScript, though, which also lets you change just ’bout everything… which shows how bewilderingly ignorant he is ’bout JavaScript.

Yet, people seem to be happy to adhere to its standards and conventions because it makes them more productive, without compromising their ability to innovate and be creative.

“Ruby’s best advantage is that it has a feature that nobody uses”. So we see ’gain: Ruby’s great, it’s programmers aren’t.

Curious, right?

Stop trying to get into my pants, you smarmy bastard.

8. Ruby isn’t as reliable as Java and .NET

¿Java & .NET are reliable?

Windows isn’t as secure as NetBSD. Oh No!!! I should dump my shiny new Windows for a NetBSD installation.

You just said earlier that I should dump Windows for Linux. Great. Now apparently I’m an idiot for doing so & have to waste ’nother afternoon deleting Linux from my hard drive. You’re truly making me mo’ productive.

While static languages offer a performance boost in relation to dynamic languages, due to their compiled nature, and a strict mechanism to ensure private and public APIs are adhered to, lets be blunt – How many bugs, in your history as a programmer, were the direct result of a wrongly-typed variable?

You’d be surprised.

I know a lot o’ bugs can be caused by functions getting bad parameters, ’specially when dealing with user input online, which is why JavaScript’s lack o’ type-safety is annoying. It’s just a way for me to have to manually check parameters to ensure they’re valid strings or #s rather than have the compiler do it for me, like in C++.

Ensuring a method can only accept variables of predetermined types doesn’t ensure sound and bug-free code.

It sure helps.

If anything, it adds noise to an otherwise clean code in case you do have to cast variables or read compiler complaints about wrong types.

The former is rare, & can be handled rather cleanly with generics ( in C++, a’least; don’t know ’bout Java or .NET ); the latter wouldn’t happen till you fix the problem ’cause the compiler would refuse to compile till you fixed it.

Ruby’s way of solving this conundrum is to promote testing as a culture. In other words, your code is as reliable as your tests, not as reliable as your method signatures.

Ruby’s solution is to make you do extra tedious work that compilers do automatically. But it’s much mo’ convenient, DRY, & enjoyable to work with — not to mention how much cleaner your code is with all those tests. ’Cause nothing’s mo’ enjoyable than writing tests.

8. Ruby lacks entreprise-level support

¿Is this a fancy way o’ saying “not a lot o’ rich people are paying people for this kind o’ programming”?

Sure, if you’re an enterprising ant working for a bunch of bureaucrats who consider COBOL to be cutting edge stuff.

Yeah, maybe if you’re 1 o’ those fucking conformists working for the man, ¿am I right? True radicals smash capitalism by using unpopular programming languages. That’s what Emma Goldman would do.

Ever heard of Engine Yard? No? But they offer fantastic enterprise-level Ruby support.

“Just take my word for it”.

I’m going to admit, I have no idea what argument’s going on in this point. He goes on to rant ’bout how big corporations’ll try to hide security flaws in their code out o’ greed, which is possible, I guess, — I wouldn’t put it past them — & then mocks developers for being so “incapable that the mere threat of being left alone ‘unsupported’ deters you from choosing a piece of tech”. That sounds mo’ like love advice ( ¿Curious, right? Wink, wink ), if anything else ( ¿or should that be “elsif anything”? ).

In an era where technological innovation goes hand-in-hand (and is often driven by) open source code, choosing a closed-source, monopolised, technology for the sake of support is choosing to stay one step behind everyone else. Just take a look at companies like Basho, RedHat, Canonical, 10gen, Cloudera and Engine Yard, who all offer open-source technologies as well as enterprise-level paid support.

I literally have no idea who any o’ those people are, ’cept that Basho is the god o’ haiku ( though I prefer Issa ). Hilariously, the link to Basho is broken, so clearly these companies aren’t doing that well.

9. Ruby doesn’t scale well

This is just a repeat o’ “¡But Ruby’s slow!”

Man, I’m noticing mo’ & mo’ that this writer would make a shitty lawyer. He acknowledges Twitter’s scaling problems due to using Rails, but uses that to praise Ruby for an irrelevant subject he already talked ’bout, & then goes on to talk ’bout other technologies that don’t use Ruby — 1 being C++, which he implied earlier was a ridiculous choice for web development. I guess he’s saying that lots o’ people use obscure ( well, for web development, if we’re including C++ ) programming languages to make web programs, so you should use Ruby, ’cause… ¿it’s a special not-all-that-obscure language?

He then says this:

Since no two Web apps are exactly alike, one should learn from battle-hardened experience of successful Web apps, rather than proclaim one technology is superiorly scalable than another.

But it seems that the “battle-hardened experience” indicates that some languages do scale better than others & that one should learn from the mistakes o’ Twitter & think ’bout scaling issues before it becomes a problem.

10. It’s a lot harder to find experienced Ruby developers in today’s market

“¡There’s fewer workers to exploit!”

¿Aren’t these programmers talking? ¿Why would a programmer complain ’bout a smaller supply? ¿Are they that ignorant o’ economics? “¡I’ll have fewer people to compete with! ¡That’s awful!”

That’s actually true, depending on where you are in the world. In Israel, for example, where .NET and PHP are more widely used, finding good Ruby developers is harder.

The true source o’ all the strife ’tween Israel & Palestine is that Israelis are ASP-fanatics, but Palestinians are hard-core Pythonistas.

I’m quite sure PHP & .NET are the most widely used all o’er the world. Ruby isn’t e’en close. That’s ’cause PHP comes embedded in Apache, the standard for Unix servers, & .NET is Microsoft’s pet, & we always need to leave room for their useless shit.

But, you know what? It’s also harder to find experienced Javascript developers.

( Laughs. ) ¿What? You literally know nothing ’bout JavaScript, ¿do you?

For fuck’s sake, you can’t e’en spell its name correctly.

In my mind, that’s a clear indicator that a certain segment of the market is in demand, and is on the rise, which is definitely a good thing.

This literally means nothing: “To me, that means some vague this is doing well. The fact that some things are doing well is certainly good”.

He then basically tries to say that there are mo’ experienced Ruby developers ’cause they’re smarter than PHP developers, which I doubt, but OK. If anything, developers would need to be smarter to work through PHP’s nonsense. But calling PHP’s documentation “fragmented” is ironic, since it’s commonly known that Ruby’s documentation is terrible & that documentation is the 1 thing PHP did well. E’en fans o’ Ruby admit it.

So, instead of shying away from a good thing because it’s hard, why not train Ruby developers yourself? I mean, if you agree it’s the right technology to use, why not invest in it?

¡But you’ve yet to prove that Ruby is a good thing! If this were a debate class, you’d fail terribly.

¿& weren’t you saying that Ruby is easier than PHP? ¡Gah! ¡Logic! ¡BOOM!

So… the take’way is that Ruby’s advantage is that it’s faster & easier for programmers, e’en if it’s less efficient, computer-wise… but there’s a good chance I’ll need to invest extra money & time into learning it, & is actually hard, but a good thing.

Pretty long article to just say, “Well, I like Ruby, so fuck you”.

I don’t know why we’re having all these debates. Everyone knows the best programming languages are C & Lisp, & that everything else is crap. But we still have to use C’s dipshit nephew, C++; C++’s douchie brother, Java; Java’s ultra-douchie younger cousin Ruby; idiot-savant JavaScript; & that alcohol-fetal-syndrome victim, PHP, ’cause we’re too stupid to understand C, & Lisp isn’t useful for making anything actually productive, ’cept for academics & shitty Yahoo e-stores. Better to be bitching ’bout not being able to use Ruby or Haskell or Brainfuck or whatever in 50-100K-a-year jobs than worrying ’bout losing a finger on the cutting machine used to make 1K a year.

’Sides, languages are ne’er based on logic, but just arbitrary history & popularity. ¿Will this guy try telling me that English is the most common language in the world — & the lingua franca o’ the programming world — ’cause ’twas well-made? ( ¡Just stop bitching & learn Esparanto already! )

Also, ¿don’t you hate those pushy listicles with titles that say something ’long the lines o’, “Why you need to do this thing right now”. Fuck you. I’d trust my plumber to teach me anything, e’en technological, ’fore I’d trust some idiot who writes listicles.

Strange Fun Fact ’bout Ruby

In 1 o’ my many waking comas where I’d just think ’bout random subjects for hours without e’en realizing it ’stead o’ doing anything productive I came up with this bizarre idea o’ a C++ / Ruby lovechild called “Crystal”, which would purportedly have the elegance o’ Ruby & the efficiency o’ C++.

Then I happened to notice “Crystal” in the list o’ languages in my notepad program & looked it up the find out, not only does it exist, but it pretty much fits my C++ / Ruby idea, as well.

They were right when they said people were spying on me…

Posted in Programming, Yuppy Tripe

An Inquiry into the Proposition in Regards to Economics Utilizing Programmic Language ( or: Economists Should Use Programming Languages ‘Stead o’ Math Language )

A common criticism gainst economics is that it uses incomprehensible math language to describe itself, as if that’s the true reason a bunch o’ rich academics prefer philosophies that benefit rich academics. ‘Cause we know from the Tea Party Movement that plain ( AKA sloppy ) language ne’er leads to sloppy economics ( i.e. economics I don’t believe in ).

Mo’ wary economists acknowledge that math language isn’t necessary for economics, but has 2 benefits:

  • It’s mo’ rigorous than plain language, & thus harder to make invalid statements ( though it’s still possible — not to mention that this does nothing to protect gainst inaccuracy ).

  • Economists being, well, economists, can understand it better than your human language with all its gooey emotions.

There’s something to say ’bout the 1st point. Austrian-schoolers famously claim that math language isn’t necessary ( though can’t argue why it’s necessary not to have it ), & then hurt their cause by having a much sloppier logical system1 with vague language, logical jumps, & outright inaccuracies ( despite Mises’s claim that praxeology only makes abstract logical statements )2.

So I’m recommending a different solution: replace math language with programming language. Economists can’t claim the 1st point gainst this solution: the fact that computers can run off programming language is proof that it’s mathematically rigorous. But I’d also argue that it’s much mo’ readable than math language, if done right.

Indeed, unlike math, programmers take the readability o’ code very seriously. This is ’cause o’ a fact ’bout programming that most people probably don’t realize: that it’s aimed @ writing for humans, not computers. This makes sense: programmers rather quickly realized that they can create computer programs — “compilers” or “interpreters”, depending on how it’s used — that can translate text into machine code.

Now, this obviously has limits.3 ‘Cause human languages are vague, plain English can’t be used; but different languages heavily inspired by English can be used, albeit with much stricter grammar & diction rules than human languages.

Keynes.js

I’ll use Keynes’s General Theory as an example, since ’twas what 1st inspired this view. Keynes, like any economist, loves incoherent math formulae. I’ll go through its primary flaw: wording.

Calculus has this odd pattern o’ using single letters, or e’en Greek letters, to represent concepts & values & a letter plus a letter in parentheses afterward to represent functions. This has greater advantages than being incomprehensible to anyone who doesn’t memorize them: they’re also super hard to position & configure on computers. ¿Isn’t smothering characters in some big E with angled ends — called “Sigma E” — much mo’ elegant than boring ol’ “function SumOFunctionOutputsFromInputInterval( first_number, last_number, function )”.4

It’d be nonsense to argue that economists can’t use words ’cause they’re too vague, but that they can use just letters & symbols, which are e’en less meaningful. The fact that computers can run logically-consistent programs with words proves that economics can, too, so long as it uses these words as precisely & consistently as programs.

The trick is to set off variable names ( function names should already be easy to distinguish from plain English ), — maybe bold them — define them precisely when 1st using them ( in programming, we call this “initialization” ), & ne’er use them for anything else. Don’t use them in the description text @ all; treat doing so as trying to create ‘nother variable with the same name, which would create a compilation error.5

To give an example, let’s take the formula from the beginning o’ Book III o’ General Theory:

Cw = χ(Yw) or C = W * χ(Yw)

I want to point out that this formatting in my copy is so bad that I’m not e’en sure if I got this formula accurate. I’m not sure if that asterisk is s’posed to be there or if it’s some obscure math meaning ( using the same symbol for different functions is less common in math than one might expect from such a rigorous science ) or if it’s just a printer smudge. It’s slightly off-center, which is suspicious. Also, Keynes just mashes “I can’t believe it’s not χ” & the parenthetic expression next to it to form multiplication earlier, ¿so why not just mash W & χ together?

Basically, I’m going to want to append this image next to Keynes’s formula:

Yeah, this is called a “coding horror”. If you click that link you may see an article that proves that, though economists should talk like programmers, programmers probably shouldn’t talk ’bout politics, ’cause they might look silly ( yes, I could totally imagine a programmer with no experience in politics winning a local election based purely on his disgust with the current president — as if that’s a rare commodity — & his inability to tell that election system from Stack Overflow )6. Anyway, this icon is actually from a book called Code Complete, by some other guy & is used to set out particular awful pieces o’ coding, much as blogs set out particularly awful wording with bold. I’d recommend reading that book, since it talks ’bout the comprehensibility issues I’m talking ’bout in greater depth. I’d recommend Clean Code & Cleaner Code e’en mo’.

Anyway, let’s make this fomula not suck:

Let’s start by noticing that these 2 formulae are probably the same, ‘cept spelled-out in needlessly opaque ways. Cw is “consumption based on `wage units'” Let’s ignore that the “propensity for consumption” is apparently based mainly on lowly wages & just focus on translating. C is just “consumption”, & is = to the same thing, but multiplied by uppercase W. If one reads “The Choice of Units”, which I don’t recommend, one will learn that W is — surprise — “wage units”, which I believe is the average wage money per worker. ( I just know it’s some form o’ “wages” / some # o’ workers. Keynes is terrible @ specifying domains, but common sense tells me he’s talking ’bout a country’s economy. Since none o’ this is backed by any evidence or data, it doesn’t matter anyway. It could apply to the Gusty Glade Galaxy for all we care. ) So… basic math tells us that Cw = C/W. So, Cw must be average consumption per average wage.

Thus we have our 2 functions:

function AverageConsumptionPerAverageWages( χ, Yw )

function TotalConsumption( average_wage, χ, Yw )

Already, things are looking much mo’ coherent.

Thankfully, these 2 functions share the same 2 variables. As it turns out, I realized that these weren’t 2 variables being multipled together, but 1 other function with Yw as an argument. These are the kind o’ parsing errors you still have to look out for in programming. For instance, in C++, it’s still possible for a compiler to mistake the initialization o’ a variable through parentheses with the initialization o’ a function.

So… ¿I guess Cw & C are variables to functions? Good thing that works perfectly for JavaScript:

var AverageConsumptionPerAverageWage = function( Yw ) {};

var TotalConsumption = function( average_wage, Yw ) {};

Let’s just appreciate how much easier it is to understand the word “function” o’er a cheap knock-off version o’ the letter “χ”.

Now we just need to figure out Yw. I’ve figured it out: it’s “income in terms o’ wage units”, which is a weird way o’ saying “income per wage unit”, which is a weird way o’ saying “income per average wage”.

Thus, now we have:

var AverageConsumptionPerAverageWage = function( income_per_average_wage ) {};

var TotalConsumption = function( average_wage, income_per_average_wage ) {};

Note that average_wage & income_per_average_wage could be described as functions, too:

var AverageWage = function( total_wages, total_number_of_employees) {};

var IncomePerAverageWage = function( total_income, AverageWage ) {};

Now, we still need to define the implementation o’ these functions. We already know AverageWage & can easily discern IncomePerAverageWage through that:

var AverageWage = function( total_wages, total_number_of_employees )
{
    return total_wages / total_number_of_employees;
};

var IncomePerAverageWage = function( total_income, average_wage )
{
    return total_income / average_wage;
};

Thus, we’d call IncomePerAverageWage thus:

var income_per_average_wage = IncomePerAverageWage( total_income, AverageWage( total_wages, total_number_of_employees ) );

In contradiction to my core claim in this article, there’s a difference ‘tween total_income in this function call & in the function definition earlier. In programming, this is known as “scope” ( sort o’ like my namespace point made in a footnote down below ). The total_income in the function definition only exists for the duration o’ that function call & is set to whatever is pushed to it through this call. This call, meanwhile, references a specific variable whose scope we’ll deal with later.

Anyway, we have 2 mo’ functions to define:

var AverageConsumptionPerAverageWage = function( income_per_average_wage )
{
    return income_per_average_wage;
};

‘Course, this 1 is pointlessly redundant ( & a wrong assumption ).

var TotalConsumption = function( average_wage, income_per_average_wage )
{
    return average_wage * income_per_average_wage;
};

Interestingly, we could redefine AverageConsumptionPerAverageWage in a ( slightly ) mo’ meaningful way.

var AverageConsumptionPerAverageWage = function( total_consumption, average_wage )
{
    return total_consumption / average_wage;
};

‘Course, comparing these 2 functions & understanding basic math will allow one to see that total_consumption / average_wage will inevitably = income_per_average_wage — which is, ‘course, the whole point ( mo’ on this later ). That average_consumption isn’t a particularly meaningful value — better median_consumption — is beyond our scope.

Here we can see all the pieces together:

var TotalConsumption = function( average_wage, income_per_average_wage )
{
    return average_wage * income_per_average_wage;
};

var AverageConsumptionPerAverageWage = function( total_consumption, average_wage )
{
    return total_consumption / average_wage;
};

var AverageWage = function( total_wages, total_number_of_employees )
{
    return total_wages / total_number_of_employees;
};

var IncomePerAverageWage = function( total_income, average_wage )
{
    return total_income / average_wage;
};

var total_income = 16770; // In billions. // These 2 must be
var total_wages = 157.5; // In billions. // in the same unit.
var total_number_of_employees; = 124.73    // In millions.

var average_wage = AverageWage( total_wages, total_number_of_employees );
var income_per_average_wage = IncomePerAverageWage( total_income, average_wage );

var total_consumption = TotalConsumption( average_wage, income_per_average_wage );

console.log( total_consumption ); // Prints 16770 to browser debug console.

Mo’ Fun

You’ve probably noticed by reading the comment after the final statement or running this code yourself ( you can make the debug console pop up in most browsers by pressing F12 ) that total_consumption = total_income. While just following the logic o’ the functions & understanding basic math shows this, familiarity with economics & basic pattern-recognition was mo’ an asset.

But with programming languages, we have 1 tool we can use to test this a lot: conditionals.

To simplify, let’s wrap up the code outside o’ functions in the previous program into 1 big function & have it return a value:

var TotalConsumptionFromIncomeWagesAndEmployees = function( total_income, total_wages, total_number_of_employees )
{
    var average_wage = AverageWage( total_wages, total_number_of_employees );
    var income_per_average_wage = IncomePerAverageWage( total_income, average_wage );

    return TotalConsumption( average_wage, income_per_average_wage );
};

This’ll abstract ‘way all these connections so we don’t have to go through them ‘gain.

Let’s add 2 mo’ functions. The 1st is a simple helper function:

var RandomNumber = function()
{
    var MAX = 99999999999999;
    return ( Math.random() * MAX );
};

JavaScript’s built-in random function is odd: it returns a random # ‘tween 0 & 1. This function increases that to 99.9… trillion.

The next function is the main focus o’ this program:

var TestThatConsumptionEqualsIncome = function( iterations )
{
    var total_income;
    var total_wages;
    var total_number_of_employees;
    var total_consumption;
    
    var consistent = true;

    if ( isNaN( iterations ) ) // isNaN: Not a #
    {
        iterations = 999; // Default
    }
    
for ( var i = 0; i < iterations; i++ )
{
    total_income = RandomNumber();
    total_wages = RandomNumber();
    total_number_of_employees = RandomNumber();
    
    total_consumption = TotalConsumptionFromIncomeWagesAndEmployees
    (
        total_income,
        total_wages,
        total_number_of_employees
    );
        
    if ( total_consumption != total_income )
    {
        consistent = false;
    }
}
    if ( consistent )
    {
        console.log( “¡Our math formulae are pure!” );
    }
    else
    {
        console.log( “¡Economics is a failure! ¡Abort!” );
        SmashCapitalism();
    }
};

1 major flaw o’ JavaScript is its lack o’ argument defaults ( values that the argument becomes if nothing is sent to the function in its place ). This is bewildering, since just ’bout every language has them, including the languages that were JavaScript’s main inspiration.

In this case, the need to manually check for a given argument isn’t too bad, since we need to ensure that it’s a #, anyway — which can’t be done automatically without static typing.

Anyway, now we just need 1 statement @ the end:

TestThatConsumptionEqualsIncome();

Run & let’s see the magic:

Math is a lie.

( Also, Firefox shows a hilarious depth o’ social knowledge with that line, “ReferenceError: SmashCapitalism is not defined”. )

All right, calm down. I tested this program a bit & realized that a’least 1 kind o’ math is a lie: floating-point #s. Try to ne’er use floating-point #s if you can; they can’t seem to understand such obscure, arcane concepts o’ equality. Looking @ the values gotten, total_consumption & total_income vary by .00000000001 or so. But e’en if they didn’t, they could fail equality, ’cause floating-point #s. This is the case wherein JavaScript’s loose typing is a pain — just like how I have to be careful doing math in Python so it doesn’t try to trick me into thinking 8 / 5 = 1. In C++ or Java I wouldn’t have this problem, ’cause they demand you specify the type. Then ‘gain, C++ also automatically converts types without you knowing, so it kind o’ sucks, too.

The problem is, trying to fix this is mo’ complicated than just wrapping Math.round() round every division. In my tests, ’twas strikingly common for these divisions to give 0 values ( which makes sense, since it’ll be common for the values to be close ‘nough that division would give some value below .5 ) & when a # was divided by 0, which every mathematician knows is kosher, it gives “Infinity”. & when that’s multiplied, we get “NaN”. In that case, we’re guaranteed to get an economic disaster, since NaN isn’t equal to anything — e’en itself. Now, this is what I call a well-designed programming language.

Obviously I can’t just do bounds-fixing for 0, since that would change data, which could cause values to go out o’ sync & cause the same capitalism-destroying problem. Also, fixing our “model” by just “fixing” the data is both hilariously wrong & yet hilariously right for an economist.

Thankfully, I have a much mo’ elegant way to move the goalposts — 1 that’s, if I say so myself, much saner: we’ll just change the definition o’ “=”:

var AbsoluteDifference = function( one, two )
{
    return Math.abs( one – two );
};

var CloseNough = function( one, two )
{
    // I said, “¡Hey! ¿Are we doing government work here?”
    return AbsoluteDifference( one, two ) < 1;
};

By the way, if you e’er hope to get a job programming, I highly recommend you fill your functions with silly comments that reference songs & memes & stuff. I can guarantee your boss’ll think you have the utmost professionalism.

Interestingly, the new ES6 standard apparently has some Number.EPSILON variable that is s’posed to be used for comparing floating-points, rather than using a better # system. ‘Cept, that # doesn’t seem to work with my program ( probably ’cause o’ all the divisions that lead to further impurities ).

& now we change change the conditional statement:

if ( !CloseNough( total_income, total_consumption ) )
{
    consistent = false;
}

Let’s see how it works now:

( Holds breath ).

¡Capitalism is saved!

¿Why’d I waste my time on this horse-piss ‘gain?

Posted in Politics, Programming

Let’s Code a Crappy 2D Platformer Like Millions o’ Other People on the Internet & Lose Interest & Give Up Only a Few Months In, Part XVI

Mart Cart Madness:

This was a level I’ve been sitting on for a while, & I finally got round to finishing it — which mainly meant drawing all the graphics.

I still worry that the level may be unfair. I make it look easy in the video; but I’ve played this level a’least 100 times as I tested it, ‘specially recently, & wary-eyed viewers should be able to spot that I’m jumping before any fresh player should know what’s coming. In truth, I just have this level burned into my memory & was just jumping on pure muscle memory.

The problem is, your character goes so fast & the level’s still so cramped that you have to be tight with your timing. It’s very easy to nick a wall with your very edge down in the warehouse area near the start. But I don’t want to slow your character down, & adding extra space would require me to significantly redo much o’ the level, since I’d have to push the rest o’ it back.

That said, it’s not too much o’ a problem: dying is just a snap o’ a rubber band: you lose 2,500₧ in a level that nets you o’er 10,000 on a single victory, & the level’s short. This is why I wanted you to go fast: auto-moving levels are boring as boards when they take too long & go so slowly. You know you screwed up when the player is holding the forward button futilely trying to speed things up. I can a’least say that I doubt a player would do so in this level.

Interestingly, the warehouse part near the end has much mo’ room for error: thanks to the walls being all springs, you don’t lose any health or die from the vast majority o’ errors, allowing for unlimited errors. This probably could’ve worked better earlier in the level; then ‘gain, maybe it’s better to have such a parachute near the end, when you’ve got mo’ to lose. I do like the calmness o’ this section.

Beating the level is simply the player cart sprite checking if the player has gone past the right side o’ the level, which could probably be exploited somehow. Due to a quirk o’ how maps are laid out, I had to align the end with a space on the far left side o’ that Y position so the player wouldn’t bump into anything on the left. Similarly, to make the cart start past the left side o’ the level, I had to put empty space on the far right o’ the starting Y-position, which is luckily just a large clump o’ solid blocks that should ne’er be seen by the player in-game. If you look @ the map in Tiled ( in the Github project: resources/maps/land-shop-1.json ), you can see the seemingly arbitrary down near the lower-right.

The way the player’s cart sprite works is simple: it just checks if it has a horizontal direction & automatically moves in that direction. The springs change your sprite’s direction. The upward springs down in the 1st warehouse area nullifies your cart’s horizontal direction & ‘stead sets your cart’s vertical direction to “UP”. With that, your cart automatically moves upward till it reaches a hard-coded Y-position, & then nullifies its vertical direction & sets its horizontal direction to “RIGHT”. It’s not friendly for reuse in other levels, but I don’t plan to make ‘nother cart level. Remember the wise words o’ Programmer TV Tropes ( ¿Computer Tropes? ): YAGNI. The sprite also checks if you collide with anything to the side or ‘bove & damages you if so. Springs aren’t solid, so they don’t count as collisions.

Palette changes are simply done by placing graphics-less blocks in select spots, which activate when onscreen.

The next level will probably be a sky level I’ve been working on for a while…

Posted in Boskeopolis Land, Programming

Let’s Code a Crappy 2D Platformer Like Millions o’ Other People on the Internet & Lose Interest & Give Up Only a Few Months In, Part XV

Soupy Sewers

@ 1st I had qualms ’bout the sloppy inconsistency o’ the sewer hole monster’s frames, but I’ve come to appreciate it in a Ren & Stimpy kind o’ way. It actually made me curious ’bout the prospect o’ an entire game animated that way.

I actually hadn’t lost interest, but was spending copious time on insignificant twiddling.

I rather radically refactored the block system, levels, & palette system so that they loaded JSON files automatically so that I don’t need to manually add them directly into the code. Unfortunately, due to the weird way RapidJSON handles objects, making it impossible for me to push its objects into other functions, this code is messy as hell. But a’least it’s all isolated & probably won’t need to be touched much. Meanwhile, the creation o’ levels, block types, & palettes is through clean JSON files.

I also finally split the block system into tilesets that vary by map ( ‘cept the added “universal” set which applies to every level ), though I had to simplify blocks so that they just took 16 x 16 graphics ‘stead o’ 4 8 x 8 graphics. The filesize saved through extra reuse o’ graphics wasn’t much, & wasn’t worth the tedium o’ redoing so many blocks.

I also changed the sprites so that I can now see what they are on Tiled maps. Tiled doesn’t allow you to have multiple tilesheets use the same #s, e’en if used for separate layers, & I unthinkingly made the sprites use 0 & onward, which the block types also use, since sprites & blocks use completely different lists. I changed it so that sprites start @ 401 & lengthened the tileset graphic files so that they & the universal tileset graphic add up to 400 blocks in Tiled. Then I just add the sprites tileset last & it handles 400+. I just need to hope that none o’ my tilesets need mo’ than 336 blocks ( 64 being taken for the universal set ).

None o’ this probably made any sense & probably sounds like a hungo’er mess.

Find sloppy source code @ GitHub

Posted in Boskeopolis Land, Programming

Let’s Code a Crappy 2D Platformer Like Millions o’ Other People on the Internet & Lose Interest & Give Up Only a Few Months In, Part XIV

Warm Up:

I probably thought o’ the basic concept ’hind this level—survive a certain ’mount o’ time—before I e’en started this particular version o’ the project; but this particular implementation was made just this day. Other ideas I had were staying on ladders & avoiding Bullet-Bill equivalents; but this one looks much better, & is probably less clunky. Though it may sound rather shallow, aesthetics do make mo’ importance than some people give credit, & I feel the fiery theme o’ this level makes it a li’l less lame than just a “keep from dying for 30 seconds” level. Plus, I like having stories ’hind levels—in this case, somehow Autumn has ended up in a furnace & is being baked ’live.

Mo’ surprising, though I had so much trouble in practicing this level that I doubted I’d be able to record a winning run, I was able to do this well on my 1st try. I only missed 1 gem. Though these beams have quite a bit o’ leeway,—their hitboxes are a few pixels smaller than their graphics, & they only hurt you when they’re all the way on—it’s still quite easy to accidentally bump into 1 by a pixel or so when o’er-correcting movement on the conveyor belt. Worse, it can be easy to bump your head when jumping to the right side & fall to your death. I considered leaving mo’ space, but decided I liked the challenge. It’s not as if you need to jump o’er the hole, anyway, ’less you want to get a high gem score. E’en getting the diamond is pitifully easy when one considers that the game saves the diamond e’en if one dies. It’s truly only my anal-retentive obsession with having a good-looking video that made this level hard for me.

I’m still working on 2 cloud levels & have ideas for 2 other factory levels. Hopefully it won’t take too long to have something presentable from them. I also still have “Sawdust Crush” & “Hot Shop” to finish up so I can show those off.

Source code

Posted in Boskeopolis Land, Programming

Let’s Code a Crappy 2D Platformer Like Millions o’ Other People on the Internet & Lose Interest & Give Up Only a Few Months In, Part XIII

& now for something completely different: a top-down maze level that blatantly rips off Pac-Man, but without the fancy voice clips o’ someone swearing whenever they die.

Like Pac-Man, there are 4 antagonists that chase you, in this case eyeballs, ’cause ’twas a convenient graphic I had lying round. They can sort o’ be distinguished by their shade—a limitation due to my insistence on 6-color monochrome palettes; however, this isn’t that useful, anyway, due to a twist I added: every 15 seconds, the eyeballs switch roles. So, to use Pac-Man terminology, imagine after 15 seconds Blinky starts acting like Pinky, Pinky starts acting like Inky, & so on. They don’t change their current position or appearance, just their behavior. They continue cycling down the types every 15 seconds, returning to their original type after 1 minute.

The eyeball chasers do act like the Pac-Man ghosts, with 3 out o’ 4 o’ them having AI based on ghost behavior. They target a certain tile & test each possible tile they can move to next to see which is closer to that target tile in terms o’ the distance based on a straight line. The top-left eye follows the player, like Blinky; the top-right aims for the tile 4 blocks in front o’ your player, sort o’1 like Pinky; & the bottom-right eye aims for the player, ’less it’s 8 blocks nearby, in which case it aims for the bottom left corner, like Clyde. The bottom-left eye is the only exception: rather than the immensely obtuse method2 Inky uses, it just aims for a random tile every tile it moves. Though part o’ me kind o’ liked the o’ercomplicated nature o’ Inky’s pattern, it requires knowing Blinky’s pattern; & in my game, it’s actually, I’ve just thought o’ a simple way I could do it, ne’er mind.

Truth told, I feel like I’ve ripped off Pac-Man too much. I wanted to add mo’ eyeballs with my own made-up patterns, since it seems like a fun exercise to try, but I felt that’d make the game too hard. Maybe I’ll change the Clyde equivalent, since its pattern is kind o’ dumb, anyway. 1 idea I had was a sort o’ smarter version o’ Blinky. As Birch notes, due Blinky’s distance check for tiles is simply a straight line that ignores solid blocks, there’s a chance it’ll take a less efficient route if the player is to 1 side o’ it but the quickest route is in the other direction. A smarter algorithm would involve using recursive tile searches throughout the whole maze to see which path that ends with the player takes the fewest tiles.

Other than the eyes shifting types & speeding up after 15 seconds, & the Blinky equivalent speeding up after a minute, these eyes’ AI is actually simpler than the original Pac-Man’s, with no “scatter” behavior, &, ’course, no power-pellet or fleeing behavior. This isn’t truly s’posed to be an exact copy o’ Pac-Man, &, if anything, could use a bit mo’ originality.

I suck @ Pac-Man, & as the video shows, I wasn’t able to beat it, e’en with 4 hearts in the corners o’ the maze. You’ll have to take me by my word that collecting all 669 gems beats the level. I’m thinking o’ having this be a bonus level, since it has a high reward o’ 66,900₧, which is mo’ than 3 times the max collectible in any other level. I thought ’bout making the maze smaller, which may ease the difficulty, but I kind o’ like the huge maze. Maybe I should just make ’nother maze level that’s smaller.

Reminder: this game’s sloppy source code can be found @ Github.

Also, I converted project from Code::Blocks to plain Make, since Code::Blocks has this tendency to crash randomly & I prefer the less cluttered interface o’ using text document programs & folders, rather than having the thin bar on the left all the time & having to scour it for the files I want.

The 1 downside—though, now that I think ’bout it, it’s pretty neat, actually—is that Make causes bizarre glitches sometimes when changing header files quite a lot & making without clearing out all the objects. I was lucky ’nough to get a video:

This isn’t a dire problem, since it can be solved simply by running “make clean” before it happens. It just wastes extra time, since I have to recompile the whole program afterward.

Posted in Boskeopolis Land, Programming

“HTML5 Games” Is a Stupid Term

There. I said it. Bring on the hate, mannnnnn.

“¿What the fuck are ‘HTML5 games’? I don’t want to hear you talk ’bout that shit—go back to talking ’bout Game Boy Advance games & writing Spanish haikus ’bout suicidal moons.”

Fuck you, reader. Don’t tell me how I do what I do. Nobody gets to.

HTML5 games are JavaScript games. The vast majority o’ programming is done in JavaScript. HTML5 just contributes the canvas tag. Big whoop. Calling those “HTML5” games is like calling 3DS Games “LCD” games ’cause that’s what the screen’s made o’. That’s like calling Flash games “HTML” games, ’cause the vast majority o’ Flash games are played on HTML websites.

Look @ these dipshits @ “Tutorialzine”:

30 Amazing Games Made Only With HTML5

Damn. That is impressive.

O, wait:

HexGL is a futuristic, fast-paced racing game built on HTML5, JavaScript and WebGL. [emphasis mine].

Huh. I must’ve forgotten how English works, ’cause I’m pretty fucking sure “only” means “not including fucking JavaScript & WebGL, you fuckers.”

& unlike laissy libertarians—god, ¿remember when they were still a thing?—I looked this shit up in a dictionary:

Posted in Programming, Web Design