Jump to content
  • Advertisement


  • Content Count

  • Joined

  • Last visited

Community Reputation

103 Neutral

About landlocked

  • Rank
  1. I don't really care what you think of my attitude. About getting "too deep" you should be pushing simple succinct solutions that meet the need rather than trying to be "spiffy" or clever. I write my posts here knowing that someone, anyone, might come along and take what I say and run with it. So, when someone proposes solutions I know to be overly engineered for the problem that was described I will directly counter it and say so.
  2. This makes me dubious but I'll check it out. It is my understanding StringBuilder took individual strings and just stored them in an array and then ToString simply did one big concatenation instead of doing it incrementally as you added elements (which is why that class exists in the first place). From day one though everything I've read about .NET has touted the immutability of strings so I can't just take your word at this.
  3. No. Strings are immutable. The CLR handles the string creation process, tracking memory allocation and references and collection when all references fall out of scope. "This is a string" is a string that will be entered into the CLRs string tables. Any "change" to that creates a new string. Let's say you want to "add" a period. "This is a new string." is now a fresh new string in the CLRs string tables along side the string "This is a string". As soon as all references to the first string are out of scope the CLR wipes out the string slot and waits for something else to store there. In the following scenario there are 3 strings created and stored in the CLR: string s = "This is a string."; s = s.Remove(s.Length - 1); s = s.Insert(s.Length, ' '); //insert space However, even though three strings are created the CLR sees that after the first string is modified to remove the last character there are no more references to the string "This is a string." and wipes it out. The same is true for the .Insert line. The CLR creates the new string "This is a string " and wipes out the string "This is a new string" as there are no more references to it. The CLR never manipulates the strings themselves. In this way all strings are immutable and not even the CLR itself modifies strings. You are wrong. CLR handles immutability in that it tracks the references of string locations and as soon as there are no more references to a string it gets wiped out. Doing this you never have to worry yourself with strings themselves and can focus entirely on doing what you need to do.
  4. landlocked

    Problem dealing with float numbers

    Yarr decimal data type
  5. The too deep part was advising the OP to use a char[] or a StringBuilder object when it's just as performant for all intents and purposes say s = s.Replace(args). You were advocating more complexity than is necessary.
  6. OK, then show me how to modify a string without creating a new one. [/quote] I didn't say you could. I said the CLR takes care of it for you and unless you're storing entire tomes in a single string object that you really won't notice a performance hit doing a few concatenations. You even quoted me saying such. STFU.
  7. landlocked

    HTML5 or Java?

    I haven't played this and can't right now as I'm at work but the screenshot provided alludes to this one have some nifty effects: Missile Fleet http://glimr.rubyforge.org/cake/missile_fleet.html For 3D: http://www.benjoffe.com/code/games/torus/ Several others: http://www.casualgirlgamer.com/articles/entry/28/The-Best-30-HTML-5-games/
  8. landlocked

    HTML5 or Java?

    My performance comment centers more-so around simplicity for the end-user and if I didn't word it correctly to communicate such I do apologize. You're right the plug-ins can take full advantage of native code. However, each successive update claims faster and faster gains. This is typically true for each successive browser release however you'll get a better experience overall if all they have to be concerned about is the browser instead of their browser and all the plug-ins they need to keep updated as well and can ensure a better experience if you stick to a standard specification that is more likely to be supported automatically by browsers released after the specification is published rather than an ever evolving set of features, some good some not so good, and making a crap shoot if your users have the plug-in required by your game and requiring your users to install said plug-in. Given the fact that HTML 5 is supported by the latest version of every major browser I see no reason why new projects should be written in anything else, assuming all other things are equal. A browser that doesn't have to handle plug-ins is typically a more performant one as well which has direct gains that can be used by native HTML 5 apps. Also, I find Flash to be terrible with performance as it was never meant to be a game platform. All it was meant to do was handle small animations. I find the performance of most flash games appalling but havent' seen an HTML 5 game choke in my browser yet.
  9. I did a test one time with StringBuilder, string.Concat and + sign concatenation in loops with a million iterations. While StringBuilder was slightly faster (by mere MS) at the end of the day it really doesn't matter. This is one place where micro-optimization is fail and people worry about it too much. Also, if you keep building the same large string over and over you are doing it wrong. DRY (don't repeat yourself) applies here perfectly. While traditionally when people talk about DRY they are speaking in reference to code but it applies to data as well. If you are constantly generating the same string over and over then you should just store the entire string somewhere and check for the proper conditions with which it should appear. If it's a template string ("You inflicted x damage to y creature.") then use the .NET formatting characters and store the template string instead ("You inflixed {0} damage to {1}") and consume said template using string.Format.
  10. landlocked

    HTML5 or Java?

    Pick one and tell me how I'm wrong.
  11. landlocked

    HTML5 or Java?

    Go HTML 5, honestly. It's a native framework to the browser and your users won't be bound to proprietary plug-ins. Also, your markup will run about as fast as the browser allows rather than the efficiency of the plug-in developers. With a few AJAX calls to get the objects you need to draw I honestly can't see any cleaner and simpler way to get a game like environment in the browser. Your overhead will increase with the other plug-in languages as well. Basically, for the time it takes to get something on screen, HTML 5 is the best way to go. Only thing flash and Java improve upon is that it's plug-ins are supported on older browsers.
  12. Dude, way too deep here. Strings are immutable but the CLR takes care of all that stuff in the background. Unless you've got a thousand page book stored in a string and are duplicating said string several times you won't really notice anything performance wise. Moe is right about Trim taking off the trailing space. Remove the call to Trim() and use Remove and Insert to modify the string. These will return strings so you will have to capture the result. Simply calling s.Remove(...) won't really do anything. You'll need s = s.Remove(...) followed by s = s.Insert(...). Or in your case s would be oldmassiveoutput.
  13. landlocked

    Cost of Hosting a Simple Web Game?

    The system requirement of the physical box are easy enough to figure out. What will kill you is bandwidth. Even if you optimize every bit sent back and forth from client to server, if you have a "small" user base playing regularly of, say, 5,000 people, your monthly transfer amount is going to be huge unless it's a text only game. Any host offering you unlimited anything is lying to you. If a host can't give you hard limits then don't deal with them because everyone has limits and as soon as the host gets hit with huge transfer bills I can guarantee they'll try to come after you or they'll just disconnect your service.
  14. landlocked

    What do you think about the Revelation?

    Why are we always on the cusp of the end times? The Bible contains several passages about Christs return. 1) The last days will be as the days of Noah (lawless). As society progressively seeks to expand its civil liberties there is an every increasing perception that it has to be right around the corner. 2) The Bible tells us that Christ will return like a thief in the night meaning he will show up when we least expect it. So maybe we think we can prevent his return or even "catch" him if we're always ready?? I don't understand why people stay hyped up over this one reasoning. 3) There is a passage saying his return will be as two men walking in a field when suddenly one of them is missing and only one remains behind. This gives the perception that it could happen at literally any minute. 4) There is another passage that describes how only those who "keep their oil filled" will be allowed in upon his return so this means we have to always be ready for this return. Why can't we kick it down the road a few thousand years? The Bible says no man knows the day nor the hour of Christs return not even Christ himself but only the Father knows. Also the Bible tells us to tarry till he returns meaning just to carry on as usual but to remain ready should it happen. People who get so absorbed in the fact Christ could return any second are actually not doing what the Bible says and may very well be acting out of fear, which the Bible describes to be the first class of people thrown into the lake of fire at the last judgement (the fearful). Why can't Satan just go to a bookstore and read how he's going to fail and change his plan? There is a passage in Revelation that Satan knows he only has a short time on Earth and therefore justifies him trying to do as much damage as possible. Satan knows he can't assume the throne of God. His ONLY goal is to prevent people from knowing God as father and thus being unable to accept salvation. So he's just trying to drag as many people down with him as possible before his ship sinks.
  15. landlocked

    Which should I...?

    C# or Java, if you're the bastard demon spawn of Satan I kid I kid haha
  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!