Which will probably be never.

You are viewing a single thread.
View all comments View context
13 points
*

default variables to null or something

That is such a bad idea. Better to have the compiler warn you about it like in Rust, or have the linter / IDE highlight it.

permalink
report
parent
reply
1 point

If it’s going to compile without any warnings I’d rather the app crash rather than continue execution with rogue values as it does now.

There is so much room for things like corrupted files or undocumented behavior until it crashes. Without the compiler babysitting you it’s a lot easier to find broken variables when they don’t point to garbage.

permalink
report
parent
reply
3 points

Just enable all compiler warnings (and disable the ones you don’t care about), a good C compiler can tell you about using unassigned variables.

permalink
report
parent
reply
1 point
*

Still learning, they just covered compiler flags in cs. They didn’t go into detail yet though.

Edit: I’ve used python for years and they have something equally dumb. You can have a function in a massive application that is broken and the moment it’s called, the application crashes.

At any other point the application will just run as if nothing is wrong even though python evaluates everything at runtime. I’m sure they can’t do much because the initial launch would be slow.

permalink
report
parent
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

  • 3.7K

    Monthly active users

  • 810

    Posts

  • 13K

    Comments