Why not introduce a "but" condition?

Hi,
why not introduce a "but" condition into the Java language?
Here's an example:
if(earth.isUnderAttack()){
���go to 10
}but if(earth.getAttack().getAttacker().equals("alien") && earth.getStatus().equals("nice place")){
���go to 20
}else{
���go to 30
Doesn't it look nicer, rather then doing it like this?
if(earth.isUnderAttack()){
���if(earth.getAttack().getAttacker().equals("alien") && earth.getStatus().equals("nice place")){
�������go to 20
���}else{
�������go to 10
���}
}else{
���go to 30
Cheers,
Alexander H�glind
[email protected]

ok... I'll try to explain it on more time...
If the first "if" condition is true AND the "but if" condition is true then excecute "but if". But if the first "if" condition is true and the "but if" condition is false then excecute the first "if".
If the first "if" condition is false, then we don�t have to test the "but if" condition.
At the momement the only way to do that is like this:
if (isTrue){
if(isTrue)
doCommand(2)
else
doComand(1)
My idea is this:
if(isTrue)
doCommand(1)
but if(isTrue)
doCommand(2)
Remember, this is only an idea I got when I was programming and the code was hard to read.
shrink_laureate said something about Perl having it implemented in some kind of way. If they have, then for sure there�s a reason, don�t you think....?
And you should also be careful to imply that there is some universal idea of how programming code should look like. And for whatever it�s worth saying it... don�t you think that Java or C etc. is reflecting the structure of the language that you speak more than assembly does?
Alexander H�glind
[email protected]

Similar Messages

  • I do not use wireless, but get wireless errors, why?

    I do not use wireless, but get wireless errors, why?

    Hi Clarence,
    I'm using an i Mac O sx 10.6.8  Even though I'm using wired ethernet access, I can turn airport on and let it run while using the wired connection.  I suppose that condition may cause the errors you're getting.  Is it at all possible that you have your Airport wireless in your Mac Pro turned ON?

  • Why can't i update itunes on windows xp? It says update server could not be contacted but internet is working fine. I'm trying to go from itunes 10 to itunes version 11

    why can't i update itunes on windows xp? It says update server could not be contacted but internet is working fine. I'm trying to go from itunes 10 to itunes version 11

    Windows System Requirements
    PC with a 1GHz Intel or AMD processor and 512MB of RAM
    Windows XP Service Pack 2 or later, 32-bit editions of Windows Vista, Windows 7, or Windows 8
    64-bit editions of Windows Vista, Windows 7, or Windows 8 require the iTunes 64-bit installer
    400MB of available disk space
    Broadband Internet connection to use the iTunes Store
    See Here  >  http://support.apple.com/kb/TS3125
    From Here  >  http://www.apple.com/support/itunes/troubleshooting/

  • Running iTunes 10.7 on Mac OS X 10.8. Downloaded but can't install iTunes 11.0.2. Why not, can I

    Running iTunes 10.7 on Mac OS X 10.8.2. Downloaded but can't install iTunes 11.0.2. Why not, how can I & should I?

    Welcome to the Apple Support Communities
    The latest iTunes version is 11.0.1 version. 11.0.2 does not exist. Have you tried opening Apple menu > Software Update and install iTunes 11.0.1? If it doesn't show up, you have already iTunes 11.0.1

  • The synchronisation of my iphone on my mac is during so long, why? before it was not so long but now the 3rd step is very long (it's synchronisation of buys)

    he synchronisation of my iphone on my mac is during so long, why? before it was not so long but now the 3rd step is very long (it's synchronisation of buys).
    thank you

    Contact the carrier... ability to receive government alerts is controlled by the carrier settings.
    Does TMO even officially support the iPhone 4?

  • Why is the payment for e.g. a song in the itunes store proceeding not at once but after indefinite time?

    Why is the payment for e.g. a song in the itunes store proceeding not at once but after indefinite time?

    If you are using your account's balance then the price of the song should be deducted from it immediately, if you are using a credit card then it may take a day or two for it to appear on your card's statement

  • Why can I receive but not send emails

    Why can I receive but not send emails on my i pad?

    Perhaps the outgoing mail server settings are incorrect or incomplete.
    Settings>Mail, Contacts, Calendars>Your email account>Account>Outgoing mail server - tap the server name next to SMTP and check in the primary server and make sure your username and password are entered and correct - even if it says that the password is optional.

  • Why can I receive but not send mail?

    Why can I receive but not send mail?

    With sparse information you give I would venture that you have not set up the correct Outgoing Mail Server settings in Mail>Preferences>Accounts. Contact your ISP for their set up.

  • Why not my laptop can't to pronounce the sound,but flash player can?

    why not my laptop can't to pronounce the sound,but flash player can?
    my app VLC can't make sound,but firefox by flash player can make sound ~~
    sorry  my english not wil   *_*!
    #lsmod | grep "snd_.*"                                      [0]
    snd_hda_codec_hdmi     24487  1
    snd_hda_codec_conexant    47158  1
    snd_hda_intel          26180  0
    snd_hda_codec          98033  3 snd_hda_codec_hdmi,snd_hda_codec_conexant,snd_hda_intel
    snd_hwdep               6300  1 snd_hda_codec
    snd_pcm                75167  3 snd_hda_codec_hdmi,snd_hda_codec,snd_hda_intel
    snd_page_alloc          7217  2 snd_pcm,snd_hda_intel
    snd_timer              18934  1 snd_pcm
    snd                    59989  7 snd_hwdep,snd_timer,snd_hda_codec_hdmi,snd_hda_codec_conexant,snd_pcm,snd_hda_codec,snd_hda_intel
    #alsamixer                                                  [0]
    cannot open mixer: 无效的参数

    VLC plugs directly into pulseaudio, while the firefox flash plugin uses ALSA to play sound.  Do you have the pulseaudio-alsa package installed?
    I have had a similar problem before.  Sound would occasionally be controlled by ALSA and occasionally be controlled by pulse (the pulseaudio-alsa package did nothing).  As far as symptoms, sometimes other applications would not produce sound while a flash video was playing and vice versa.  Ultimately, I just removed everything pulse/ALSA-related, deleted (and backed up) my configuration files, and installed all related packages anew.  It works now.  I still don't really know what the problem was.

  • Why C# is not statically typed but F# and Haskell are?

    There was a talk given by Brian Hurt about advantages and disadvantages of static typing.
    Brian said that by static typing he don't mean C#, but F# and Haskell.
    Is it because of dynamic keyword added
    to C#-4.0? But this feature is relatively rarely useful. By the way, there are ⊥ and unsafeCoerse in
    Haskell which obviously are not the same, but something that could blown your head off in runtime similarly like exception thrown as a result of dynamic.
    Finally, why F# and Haskell could be named a statically typed languages and C# couldn't?

    I'm addressing the overlap between Haskell and F#'s type systems. The part they share is known sometimes as System F. F# by necessity provides bits and pieces of C#'s type system, but this isn't what the speaker was talking about.
    Both C# and Haskell/F# are statically typed, but they're two different flavors.
    Subtyping
    Specifically, C# is a statically typed language with subtyping. This means that if you look at the typing rules for C# there's one like
    Env |- x : T, T' <: T
    Env |- x : T'
    Which means that any well typed term has more than one potential type. This in not the case in (vanilla) Haskell or F#. Every type has a single most general type, a principal type. This has a few benefits like total type inference.
    Expressions Everywhere
    Besides this, Haskell and F# have a greater emphasis on expressions, expressions have types, but statements don't. This means that in C#, the compiler is checking less of your code, because less of your code has types. In Haskell, everything has a real, checkable
    type.
    In substantive terms, every single node on a Haskell AST has a type or kind (or sort). The same cannot be said of a C# one.
    Sum Types
    Beyond this, Haskell and F# have what are known as sum types.
    data Bool = True | False
    This is how a boolean is defined in Haskell. This provides a few different guarantees than in C#. For example, when there are a discrete number of things in C#, like say, an AST. We can model this with an inheritance hierarchy, but these are open. Anyone can
    come along and add something to it. We can use an Enum,
    but then there's no sane way to attach data to each tag uniformly. This is what's called a tagged union, and it's up to you to implement/use it correctly, the compiler ain't gonna help.
    This makes it very hard to ensure that we've covered all possible nodes of an AST. For example, say you have a function
    doStuff :: AST -> AST
    doStuff (SomeExpr ..) = ...
    doStuff (SomeStatement ..) = ...
    --// doStuff (SomeIf ...) = Oh noes, we forgot a node
    The compiler can warn you because it can prove exactly how many nodes there are, ever. In C#, the equivalent would have to be done with downcasting, and then, since the set of nodes in our hierarchy is open, there's no way to issue compile time warnings.
    A company, Jane Street, raves about how useful this feature is in their large OCaml code base. Watch a few of their talks,
    they talk quite a bit about how using OCaml impacts them in the Real World.
    Soapbox
    Now I've outlined quite a few differences over System F over many mainstream type systems, but they're all still static type systems. It does bother me when people call Java/C#/C++ "not statically typed" they are. And they certainly give you
    more compile time guarantees than say, Python. So it's a bit unfair to dismiss them out right.

  • TS3195 I am able to see my iphone 4 as a drive on my win8 pc, but am not able to see my ipad air. This allows me to copy files from my iphone to my pc. Why not?

    When I plug my iphone inot a USB port on my windows 8 computer, it apperars as a device and I am able to see and select photos co copy to my win8 pc.  When I connect my new ipad air, it does not appear.  Why not?

    Thanks again.
    I had photos taken with the ipad air on the ipad air.
    I followed the instructions in the link you gave, for Windows 8 PC
    Step 5 says to right click on the logo for my device.
    I could not find a logo for the ipad air and was unable to click on "improt pictures and videos", since there was no logo.
    Below are two screen captures.  The first is for my ipad air and the second is for my iphone.  It looks like my Windows 8 OS can see the iphones as a portable device, but cannot see the ipad air in the same way.

  • The Mac is not playing DVDS but why?

    Any reason why the imac is not playing DVDs  (movies) . I have older DVDS that will play but anything recent that I borrow from my local library it spits it out.

    As I said, I am not 100% sure, but it could be - if you have a little DVD player, see if that same DVD plays there. I also noticed another way they protect themselves: I use Roxio Toast to burn my homemade movies; the other day I wanted another copy of one and set it up to copy/burn a second copy from a previously burned DVD. As it was reading the DVD, a popup showed with something like "legal content" and "click to copy" - so even the burn software has something built in to check if there is copyright protection or not.

  • Why can I send  but not receive them?

    Why can I send  but not receive them?

    Macrumors posted a solution for this.  I used it and it seems to have worked for me.
    Here's what they said:
    1. Turn off iMessage in Settings > Messages
    2. Reset networking settings in Settings > General > Reset
    3. Reenable iMessage in Settings > Messages
    Source:
    http://www.macrumors.com/2013/09/30/resetting-network-settings-may-fix-imessages -not-working-in-ios-7/

  • I have just had a large set of updates to my CC Apps, why have InDesign CC, Illustrator CC, Photoshop CC, Dreamweaver CC and Muse CC NOT been updated but a new version has been installed (2014)?

    I have just had a large set of updates to my CC Apps, why have InDesign CC, Illustrator CC, Photoshop CC, Dreamweaver CC and Muse CC NOT been updated but a new version has been installed (2014)?

    http://blogs.adobe.com/jkost/2014/06/installing-the-2014-release-of-creative-cloud.html
    -This messages says (at least some) CC 2014 programs use NEW plugins https://forums.adobe.com/thread/1499663
    -so do not uninstall the older CC programs if you use plugins in your programs until you are sure you have plugins that work in CC2014
    If you are sure you don't need the old CC programs
    -http://helpx.adobe.com/creative-cloud/help/install-apps.html to install or uninstall

  • Set up home sharing between macbook pro and desktop pc. tried to sync music in library but ipod is not syncing the library. why not?

    I set up homesharing between macbook pro and desktop pc.  I have attempted to sync songs on my mac and pc, but the ipod will not sync the full library.  why not?

    Hey harold WD!
    You will want to consolidate your entire library onto one computer using Home Sharing in order to sync all of these items onto your iPod. Use the following article to help you accomplish this:
    iTunes 11 for Mac: Use Home Sharing to import items from another iTunes library
    http://support.apple.com/kb/PH12286
    Thanks for using the Apple Support Communities. Have a good one!
    -Braden

Maybe you are looking for

  • Ken Burns effect flickering in burned idvd

    I have put together a movie in imovie6 and included still photos. The burned dvd looks fine except for the photos where i used the Ken Burns effect. What is causing this?

  • Pages/Numbers export pdf to (iBook)

    Since my iPad is basicly my new computer I got Pages and Numbers for it. Now everything works fine somfar, but I am missing one small thing. I did not buy 3G model, just Info on that part. When I work with different docs, I love to save them as .pdf,

  • Best practice for long term maintenance ??

    still busy with the long term maintenance requirement. when maintaining a building my client wants to register the following - long term maintenance (like 15 till 25 years) - short term is already in preventive maintenance - the long term maintenance

  • Configure SAP WAS 640 / 620 for sending mail

    Hi I have a WEB 640 system, and i need to send SMTP mails to yahoo and other internet smtp adresses via Lotus Domino server which is on the Internet. Steps done to send mail: 1. In RZ10, Instance profile :- icm/server_port_1 with value: PROT=SMTP,POR

  • Query regarding characteristics and key figures

    Hi All, Can anybody pls tell me in what scenarios a key figure can be used as a attribute of a characteristic? what are the scenarios in which each type of DSO can be use?