Re: New switch/case idea

new topic     » goto parent     » topic index » view thread      » older message » newer message
euphoric said...
DerekParnell said...

I think that if you do some analysis you will find that the majority of switch usage is non fall through, so we have made that the default setting and this will mean less typing to do.

Jeremy argued at one point that switch with fallthru as default was the norm for many other languages. I wonder then, if we're to introduce and welcome those programmers into the Euphoria community, we shouldn't have fallthru be the default, to keep things somewhat similar to them and lessen the learning curve a bit. Yes, I voted for "without fallthru" as default, but I'm having voter's remorse. I think the option "without fallthru" will satiate the dissenters who don't want fallthru as default.

Just throwing that out there for consideration. I don't care one way or the other. smile

I agree that some programmers new to Euphoria are going to assume fallthru by default and end up writing a lot of redundant 'break' statements. And sometimes when they expect something to fall through and it doesn't, they will scratch their head. Hopefully they can read the manual to find out what's going on. The simple solution to that situation is to add the "with fallthru" to their code. No biggie and I think that over time, once they grok the default, they will appreciate not having to write so many damned "break" statements (and not having to worry about forgetting the write 'break' too).

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu