87 points

Nevermind using such frivolous things as a file system.

permalink
report
reply
26 points

Using a file system is much less bad than dynamically allocating memory, at least as long as you keep a predefined set of files.

permalink
report
parent
reply
36 points

I hate to alarm you but… What is a file system except dynamically allocated memory. ;)

permalink
report
parent
reply
30 points

It’s a persistent dynamic memory allocation that’s accessed by multiple processes! :)

permalink
report
parent
reply
2 points

And indeed, with memory mapped files the distinction almost disappears completely.

permalink
report
parent
reply
3 points

a predefined set of files

…with predefined sizes located in predefined regions of storage.

permalink
report
parent
reply
3 points

Yeah, that’s what I was implying, just didn’t want to write a whole novel about it.

permalink
report
parent
reply
79 points

For real though I have wanted for years to know, the person that took this picture; what the hell did they say to get everybody to look like that?

permalink
report
reply
103 points
*

It’s not quite as interesting as you might hope:

On November 12th, 2012, YouTuber LifeAccordingToJimmy posted a video titled “Don’t Stop the Music,” a skit based on the awkward moments caused when the music stops at a party and a story one is telling is overheard by others. In the sketch, the music stops as the main character says something particularly strange, causing the partygoers to stare at him. The video gained over 4.2 million views (shown below).

https://youtu.be/DHQEJoqKiBg?t=1m8s

Source

permalink
report
parent
reply
41 points
*

Oh shit you’re right. That was really lame.

Edit. Okay, I click the link before you edited it and I just watched the whole video and that was actually kind of funny but still not as cool as I hoped.

permalink
report
parent
reply
11 points

“Where are the blue cups?”

permalink
report
parent
reply
46 points
*

Years ago, older C programmers told me you don’t know C unless you use dynamic memory management. I ended up rarely writing any C, but when I do, it’s usually on microcontrollers where dynamic memory management isn’t even supported out of the box.

Jokes on you, greybeards!

permalink
report
reply
9 points

Though as a non-embedded dev who has interviewed embedded candidates I like to ask them to talk about the issues around C vs C++ for embedded and the first point 8 out of 10 of them make is C++ is bad because dynamic allocation is bad. And while they could expand to almost sort of make their point make sense, they generally can’t and stumble when I point out it’s just as optional in each.

permalink
report
parent
reply
5 points

Yeah, I get where they’re coming from–in typical use cases, C is often used with static allocation (correlated with minimal/embedded devices) while C++ is often used with dynamic allocation (correlated with enterprise/GUI applications).

Of course you can use either for either purpose, but that pattern seems more common. That being said, I’d be concerned with applicants who don’t understand that.

permalink
report
parent
reply
3 points

Can you give some examples of what you consider to be the issues?

My professor said that C++ embedded compilers used to be very buggy but have matured quite a lot as of ~10 years ago while C was stable a lot longer.

Another thing I could think of is the language complexity causing higher resource usage, e.g. by including large libraries though I’m not sure about that since most of the unused stuff should theoretically get optimized out.

I guess if you don’t know roughly how the internals of some C++ data types work it could cause you to accidentally use dynamic memory allocation when using strings or vectors.

On the other side, C++ style casts provide more safety as compared to C style casts and allows for usage of references instead of raw pointers to make the code generally safer.

permalink
report
parent
reply
0 points

Joke’s* on you

permalink
report
parent
reply
12 points
*

DON’T YOU DO IT!

DON’T YOU FUCKING DO IT!

KEIL ALREADY REQUIRES A BLOOD SACRIFICE YOU’RE KILLING US ALL YOU FOOL!

permalink
report
reply
2 points

It’s funny because it’s true…

permalink
report
reply

Programmer Humor

!programmer_humor@programming.dev

Create post

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

  • Keep content in english
  • No advertisements
  • Posts must be related to programming or programmer topics

Community stats

  • 2.1K

    Monthly active users

  • 1.1K

    Posts

  • 39K

    Comments