Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Search - "programming poetry"
-
Dear Programming Languages,
if you only support weakly typed constructs, I wish you a special place in hell.
Dear Fellow Developers,
if you use a language that allows strong typing with weak typing, the next time we will meet after I have to fix a shitty bug due to that I will play piano on your teeth, and a melody you won't like.
And yes, that means PHP as well. PHP allows for strict types since php7.
So. Just. Fucking. Use. It.
There are no excuses!
I don't care if you don't see the benefit or find it "annoying" and tedious to write it out. Use a decent editor and it will be mostly code-completion anyway.
I just don't want to fix your fuckups. And if your fuckup is due to a typing issue that "slipped" by, you are part of the problem.
If you write software, it should be clear what type each and every variable or object has.
There are no excuses but your laziness.
If you want to be ambiguous, try poetry.23 -
Craziest prep for interview :
Step 1 : Given sufficient time for the scheduled interview by any company, start by searching "How to prepare for Google interviews". Awe at the information before you and get all pumped up to jump in.
Step 2 : Starting with Algorithms, study each one and try not to mix any of them in confusion. In case you are stuck in whiteboard coding, close your eyes, take deep breath and visualize Don Kunth. If that doesn't help, well you are ruined anyway.
Step 3: Practice coding without internet connection, till you are able to write code while you talk about how the weather is really great today. Libraries and methods should flow like poetry. SO is sin.
Step 4: The X programming language which you added to your resume because you can write Hello World, head over to Wikipedia and read more about it just in case.
Step 5: Read some xkcd comics so you can impress the interviewer with some humor. You can try Dilbert too. -
(I'm not completely sure of what I'm saying here, so don't take this too seriously)
Settling on a language to write the api for ranterix is hard.
I'm finding a lot of things about elixir to be insanely good for a stable api.
But I'm having a lot of gripes with the most important elixir web framework, phoenix.
Take a look at this piece of code from the phoenix docs:
defmodule Hello.Repo.Migrations.CreateUsers do
use Ecto.Migration
def change do
create table(:users) do
add :name, :string
add :email, :string add :bio, :string
add :number_of_pets, :integer
timestamps()
end
end
end
Jesus christ, I hate this shit.
Wtf are create, add and timestamps. Add is somehow valid inside the create, how the fuck is that considered good code? What happens if you call timestamps twice? It's all obscure "trust me, it works" code.
It appears to be written by a child.
js may have a million problems. But one thing I like about CJS (require) or ESM (import) is that there's nothing unexplained. You know where the fuck most things come from.
You default export an eatShit() function on one file and import it from another, and what do you get?
The goddamn actual eatShit function.
require is a function the same way toString is a function and it returns whatever the fuck you had exported in the target file.
Meanwhile some dynamic langs are like "oh, I'll just export only some lang construct that i expect you to specify and put that shit in fucking global of the importing file".
Js is about the fucking freedom. It won't decide for you what things will files export, you can export whatever the fuck you want, strings, functions, classes, objects or even nothing at all, thanks to module.exports object or export statement.
And in js, you can spy on anything external, for example with (...args) => debugger; fnToSpyOn(...args)
You can spoof console.log this way to see what the fuck is calling it (note: monkey patching for debugging = GOOD, for actual programming = DOGSHIT)
To be fair though, that is possible because of being a dynamic lang and elixir is kind of a hybrid typed lang, fair enough.
But here's where i drop the shit.
Phoenix takes it one step further by following the braindead ruby style of code and pretty DSLs.
I fucking hate DSLs, I fucking hate abstraction addiction.
Get this, we're not writing fucking poetry here. We're writing programs for machines for them to execute.
Machines are not humans with emotions or creativity, nor feel.
We need some level of abstraction to save time understanding source code, sure.
But there has to be a balance. Languages can be ergonomic for humans, but they also need to be ergonomic for algorithms and machines.
Some of the people that write "beautiful" "zen" code are the folks that think that everyone who doesn't push the pretty code agenda is a code elitist that doesn't want "normal" people to get into programming.
Programming is hard, man, there's no fucking way around it.
Sometimes operating system or even hardware details bleed into code.
DSLs are one easy way to make code really really easy to understand, but also make it really fucking hard to debug or to lose "programming meaning".7 -
I don't have a cs degree (my degree is in aerospace engineering). However, I think the question is valid for any degree. The answer depends on the field. When sitting in on interviews over the years, the type of degree for programming jobs never seemed that important if there were experience involved. So, if the job description required 2 yrs exp. in X, then that experience trumped the degree type. If the job was for a junior dev right out of college, then degree type becomes one of the most important factors. So, for that first job, it's important that you've got a degree (any degree) because it shows that you can accomplish that chunk of work. Having a cs degree at that point does provide a distinct advantage over those with medieval romantic french poetry degrees. That's the game, and don't fret if 95% of the material you study in college you never use again. The point of studying it wasn't to use it immediately (go learn a trade if that's your bent), it was to both test you and to expose you to specialties that you might want to do later.
-
I am particularly guilty of this, embedding non-constructive comments, code poetry and little jokes into most of my projects (although I usually have enough sense to remove anything directly offensive before releasing the code). Here's one I'm particulary fond of, placed far, far down a poorly-designed 'God Object':
/**
* For the brave souls who get this far: You are the chosen ones,
* the valiant knights of programming who toil away, without rest,
* fixing our most awful code. To you, true saviors, kings of men,
* I say this: never gonna give you up, never gonna let you down,
* never gonna run around and desert you. Never gonna make you cry,
* never gonna say goodbye. Never gonna tell a lie and hurt you.
*/
I'M SORRY!!!! I just couldn't help myself.....!
And another, which I'll admit I haven't actually released into the wild, even though I am very tempted to do so in one of my less intuitive classes:
//
// Dear maintainer:
//
// Once you are done trying to 'optimize' this routine,
// and have realized what a terrible mistake that was,
// please increment the following counter as a warning
// to the next guy:
//
// total_hours_wasted_here = 42
//1 -
Today I build a box.
With a beautiful lid.
I wanted to put something in my box.
I forgot the case.
My reaction when I tried to put values in an uninitialized list. 😫