Slashdot Mirror


User: UnknownSoldier

UnknownSoldier's activity in the archive.

Stories
0
Comments
7,910
First seen
Last seen
Profile
(view on slashdot.org)

Comments · 7,910

  1. Re:Captain Obvious? on Real World Code Sucks · · Score: 1

    Of god that is so true it is not even funny. :-)

    "Politics" (and ego) is the number one reason "Real World" software sucks so much.

    --
    "If engineers built buildings the way programmers write code then the first time a woodpecker came along it would destroy civilization."
        -- Murphy's Computers Laws (Murphy was an optimist!)

    http://www.murphys-laws.com/murphy/murphy-computer.html

  2. Re:After 42 yrs programming I say... on Ask Slashdot: Do Coding Standards Make a Difference? · · Score: 3, Informative

    Yes, agree 100% !

    Simple example:

    const int SIZE = 256; // all constants are upper case
     
    #define ALIGN_DOWN(n,pow2) (n & (pow2-1)) // all macros are upper case with underscore in-between words
     
    class CContainer { // Classes are prefixed with 'C'
      int m_size;
    public:
      int getSize() const { return m_size ; } // Coding standard will mention about Brace Style and the case style. (Are one-liners getters allowed?)
    };
     
    enum EFlags { // Enums/flags are prefixed with 'E'
      FLAG_READ .= (1 << 0),
      FLAG_WRITE = (1 << 1),
      FLAG_EXEC .= (1 << 2);
    };
     
    // Ignore the periods since /. doesn't know how to keep extra whitespace in code. :-(

  3. Re:After 42 yrs programming I say... on Ask Slashdot: Do Coding Standards Make a Difference? · · Score: 1

    > Allowing mixed tab/space for indentation is a nightmare too.

    Agreed. The correct usage is:

            Spaces for indentation, Tabs for alignement, because ALL text editors are still too stupid to understand dynamic tab stops!

    > there definitely are also coding styles that are simply a terrible idea.

    I've found over the years as I've tried various coding standards that they all have _some_ merit. Usually because a programmer was trying to solve a particular problem and didn't want anybody else to fall into the same trap -- so he made a religion out of it !

    That is some of those are based on ideology instead of practicality (cargo-cult mentality.) Or said another way:

        "Any ideology taken to an extreme is usually never a good idea in the long run."

    An expert needs to balance anarchy (no rules) with structure (rules). That is, an expert, knows WHEN _to_ and when _not_ to break the rules. ;-) The reason Microsoft Hungarian notation SUCKS is because somebody went to the extreme and didn't understand what the fuck they were doing -- forcing everyone to become a partial compiler. Joel has a rant on this: http://www.joelonsoftware.com/articles/Wrong.html

    const char * pszText = "Hello World";

    What the fuck does 'sz' even add EXCEPT NOISE. You don't care that the compiler has to zero-terminate a string. We ALREADY can tell it is a string by the variable -name-. All you care is about the basic types: is it a pointer? an array? an numeric?

    Instead:

    const char *pText = "Hello World"

    Is _good_ enough. It adds SOME information without getting lost in the dogma of naming.

    I personally use a modified SHORT Hungarian notation because I deal with various graphics/math types all day long.
    i.e.
    * a Array of
    * b Boolean
    * i Iterator
    * g Global
    * m Matrix
    * n any Number / Count / Sum / Total. Why the hell do you care if it is 8-bit, 16-bit, 32-bit, or 64-bits or SIGNED or UNSIGNED ?!?!
    * p Pointer
    * s Singleton
    * r Reference
    * t table/hash/object
    * v Vector
    * q Quaternion
    * _ Member variable // Only because 'm_' is too verbose. Using a single character prefix keeps everything aligned up. ;-)

    A one character prefix (for the most part) is a good balance between conveying information and minimizing noise.

    i.e. pointless contrived example to demonstrate

    // Globals
        int gnThing; // -type- and -variable- should be aligned in columns; /. eats whitespace
        Thing gaThing[ SIZE ];
     
    // I also append an underscore in parameters so people can visually tell the arguments will be getting modified.
    int Count( int & bIsFragmented_ )
    {
        bIsFragmented = false;
     
        int .. nTotal = 0; // ingore the periods; /. sucks for code formatting
        Thing *pThing = &aThing[0];
        for( int iThing = 0; iThing < gnThing; ++pThing )
        {
            if( pThing )
                nTotal += pThing->nSize;
            else
                bIsFragmented = true;
        }
        return nTotal;
    }

    Some of the old "standards" no longer make sense today such as limiting comments to 80 chars. We all have wide-screen monitors these days and if you are too dam lazy to learn how to toggle word-wrap in your editor maybe you should consider another career.

  4. Re:Long story short... on Ask Slashdot: Do Coding Standards Make a Difference? · · Score: 1

    I agree with your points.

    I usually replace chained-conditional logic into their own separate line so that

    a) it is easier to add more conditions
    b) each line is a separate bounding condition

    i.e. This code is too hard to figure out the number of independent conditions:

    if (some(really) && long(condition) || that(extends) && miles(across(the, line)) || and(pushes, the, code, to(the), right, off, the, screen)) doShit();

    Whereas this is easier:

    if( (some(really) && long(condition) || that(extends) && miles(across(the, line))
      || and(pushes, the, code, to(the), right, off, the, screen)
      || future_edge_case( state2) // easy to add ...
    )
    {
        doShit();
        doMoreCrap();
    }

    Of course modify the brace style to fit your indent style.

  5. Re:After 42 yrs programming I say... on Ask Slashdot: Do Coding Standards Make a Difference? · · Score: 5, Insightful

    Exactly!

    After you use a few different coding standards an experienced developer doesn't care _what_ the actual standards (such as http://en.wikipedia.org/wiki/Indent_style ) , just as long as EVERYONE follows them.

  6. Re:So That's Opt In, Right? And That Goes to Chari on Facebook Test Will Let You Message Strangers For $1 · · Score: 1

    > my overworked sister-in-law who works with troubled youth?
    > Tiger Woods makes eleventy-billion times what I do.

    So someone who helps society the most gets paid the least,
    and someone who contributes nothing of lasting value get paid the most ??

    Methinks societies priorities are pretty fucked up.

  7. Re:I don't believe 1% of computers give wrong answ on Whose Bug Is This Anyway? · · Score: 1

    Ah, I could see that being one reason. Thanks!

  8. Re:First World Problems on 30 Days Is Too Long: Animated Rant About Windows 8 · · Score: 4, Insightful

    The ribbon is a horrible UI design. At least with menu (bars) you can SEE ALL your choices. WIth the ribbon if your window width is too small you don't. It also completely sucks that you can't customize it like you could with a REAL tool bar.

    With that said I actually like the Ribbon on OS X Office because I have BOTH -- menu bars AND ribbon. Forcing users to only work ONE way tells me the UI designer was an retard who doesn't understand HOW people use computers.

  9. Re:IQ was for finding children with learning..... on IQ 'a Myth,' Study Says · · Score: 1

    Fair enough. Thanks.

  10. Re:Are we any smarter than we were 2000 years ago? on Google Brings the Dead Sea Scrolls To the Digital Age · · Score: 1

    > Atheism is a fully meditative path. Too bad most atheists don't ever become conscious of this.

    Shhhh, you'll quickly get branded a heretic (i.e. original thought) by the fundamentalists -- of both sides if you keep that up! :-0 Half joking aside, would you agree that the only atheist sub-group(s) that come close to understanding this would be the Buddhists because it frees a person of all the dogma & symbology?

    It is too bad the fundamentalists of both sides are cultists -- the ONLY way is THEIR way. :-(

    I'm very curious how you were able to come to see/be the full potential of Atheism -- knowing both its strengths and weaknesses? It is very rare to find a person who has that deep grasp of the fundamentals.

    Cheers

  11. Re:Typical for safety cert programs on Whose Bug Is This Anyway? · · Score: 1

    > Most displays these days are 60Hz so having higher FPS gives absolutely nothing.

    For single player I would agree.

    For multiplayer you NEED headroom for when you have tons of explosions going off with 16 - 32+ players. This way you can STILL keep everything silky smooth.

    > even framerate across the board matters more than having high average FPS.
    That is correct, but ideally you want to guarantee an even 60+ fps for SMOOTH motion due to lack of temporal aliasing.

    If your frame rate is dipping down into the teens you have some serious optimizations problems to look into. Or you need to bring out the clue-stick for the artists/designers and see just what the hell they are doing. :-)

  12. Re:The Pretend Democracy Continues... on UK Government Changes Tack and Demands Default Porn Block · · Score: 1

    The problem is with the voting system - it reduces the "political parties" into 2 camps while not serving the majority who did NOT want them.

    These videos highlight the problem and one of the _many_ solutions:

    * First Past the Post http://www.youtube.com/watch?v=s7tWHJfhiyo
    * Alt. Vote http://www.youtube.com/watch?v=3Y3jE3B8HsE

  13. Re:Forgetting something? on TI-84+C-Silver Edition: That C Stands For Color · · Score: 1

    Yup, good times when you could program the HP-48 to "learn" the remote control. :-) The sender was good for about 4 - 5 feet IIRC.

    I was under the impression the receiver was shortened to increase the battery life. I still don't know if the the reason was technical or political reason (prevent cheating. I believe to restore the sensitivity you needed to replace a resistor and could of swore people's battery's life went done because of it.

  14. Re:IQ was for finding children with learning..... on IQ 'a Myth,' Study Says · · Score: 2
  15. Re:Detail on Carmack: Next-Gen Console Games Will Still Aim For 30fps · · Score: 1

    *sigh* Not this "I can't see more then 30 fps" crap again.

    Give users a CHOICE:

    Some want QUALITY
    Some want PERFORMANCE

    Who is right? BOTH !!

    Personally I prefer 72 to 100 Hz because in a HUGE multiplayer fight your framerate WILL drop. This "safety margin" (usually) guarantees the framerate will stay above 60 Hz.

    The second reason is that IF the game supports proper 3D then 30 FPS is not a helluva easier for the dev to do then trying to figure out what details to start dropping to get back UP to 30.

  16. Re:Are we any smarter than we were 2000 years ago? on Google Brings the Dead Sea Scrolls To the Digital Age · · Score: 1

    Ah, thanks for the term: chronocentrism

    There are two philosophies that politics like to fall into:

    * Why change, it worked for the past? (wisdom of elders)
    * The past isn't working, we need to change (flexibility of youth)

    The hard part is balancing between the two extremes!

    Your example of Buddhism is most excellent. My brother's father-in-law has this definition of religion: "Living the lifestyle necessary to prove your philosophy."

    As a mystic I would even say the same meta-concept can be applied to Theism and Atheism. There are many different paths to understanding God. Even the path of "no path" is valid (for a certain time frame.) Something the theists and atheists don't understand.

    Great post BTW!

  17. Re:Typical for safety cert programs on Whose Bug Is This Anyway? · · Score: 1

    With multi-core machines, yes, we actually have space CPU cycles again but the problem is the check needs to be deterministic time-wise. Another monkey wrench is that games unfortunately have uneven latency. Sadly not all gamers value > 60 fps. :-(

  18. Re:I don't believe 1% of computers give wrong answ on Whose Bug Is This Anyway? · · Score: 3, Interesting

    It used to, I don't know about current gen RTS's. But back ~2000 RTS typically you would run in a lock-step model. We used fixed-point to guarantee each machine was doing the _exact_ same 3D math due to the imprecision of the FPU. ANY discrepancy and your game state was boned. I believe at the time this decision was due to network implementation -- I don't know the exact reason though since I was doing rendering / optimizations.

    You also have to keep in mind the context. Back in 2000 AMD's FPU was beating the pants of the Intel's (depending on the operation as much as 1000% !!) With Intel having such a slow FPU you didn't rely on it unless you had to. Also, using C's 64-bit 'double' was prohibited for two reasons:

    a) the PS2 emulated it IN SOFTWARE !
    b) it was horrendously SLOW compared to 32-bit floats.

    Game programmers stayed as far away as possible from floats (and especially doubles!) as long as (reasonably) possible. For FPS you were forced to go the float route because while Intel hid the latency of the INT-to-FLOAT casts it was just easier to stay entirely in the float domain. That also opened the door for some clever optimizations like Carmack did with over-lapping the FPU and INT units but that was the rare case.

    On PS3 you take a HUGE Load-Hit-Store penalty if you try doing the naive INT32-to-FLOAT32 cast so fixed point has fallen out favor for lack of performance reasons.

  19. Re:Quit blaming the victim on Hacker Behind Leaked Nude Celebrity Photos Gets 10 Years · · Score: 1

    > Storing in a file is of course not that good an idea.

    If _that_ file is encrypted that is OK.

    i.e. KeyPass - then open source password manager.

  20. Re:Quit blaming the victim on Hacker Behind Leaked Nude Celebrity Photos Gets 10 Years · · Score: 1

    Thanks for the suggestion. That is exactly what I meant by bureaucracy but I said it indirectly. Maybe a better wording would be:

    " ... where having too many or too strong of policies causes bureaucracy and/or unenforceability due to inconvenience."

  21. Re:Typical for safety cert programs on Whose Bug Is This Anyway? · · Score: 1

    > Everyone says to only use error checking during development, and remove it on released code. I don't see it that way - done right, error checking has negligible impact,

    That depends on the _type_ of app. In the games industry a _debug_ build runs TOO slow to be even practical. You are forced to run optimized code if you want to have any hope of going above 1 fps.

    TINSFAAFL. Error checking costs. If I was doing software were somebody's life depended on it -- hell yeah you spot on! But for a "game" you can't afford the frame rate hit to do it "right". :-/

  22. Re:Are we any smarter than we were 2000 years ago? on Google Brings the Dead Sea Scrolls To the Digital Age · · Score: 1

    hehe ;-)

    The iPod wheel was brilliant.

  23. Re:Are we any smarter than we were 2000 years ago? on Google Brings the Dead Sea Scrolls To the Digital Age · · Score: 2

    I am quite well aware of Origen's position. :-) Sadly, too many modern-day Christians think they know the gospel better then a 2nd century scholar!

    For the benefit of other readers you are referring to:

    "What man of sense will agree with the statement that the first, second and third days in which the evening is named and the morning, were without sun, moon and stars, and the first day without a heaven. What man is found such an idiot as to suppose that God planted trees in paradise in Eden, like a husbandman, and planted therein the tree of life, perceptible to the eyes and senses, which gave life to the eater thereof; and another tree which gave to the eater thereof a knowledge of good and evil? I believe that every man must hold these things for images, under which the hidden sense lies concealed."

    - Origen - Huet., Prigeniana, 167 Franck, p. 142

    This theme is repeated over and over by those who understood the literal, allegorical, and spiritual multi-dimensional nature of the scriptures:

    Paul states that "their minds were blinded" by God, "for until this day remaineth the same vail untaken away in the reading of the old testament⦠even unto this day, when Moses is read, the vail is upon their heart" (2 Cor 3:14-15 KJV).

    Theologians Moses Maimonedes says the same thing:

    "Every time that you find in our books a tale the reality of which seems impossible, a story which is repugnant to both reason and common sense, then be sure that the tale contains a profound allegory veiling a deeply mysterious truth; and the greater the absurdity of the letter, the deeper the wisdom of the spirit"

    And more importantly, Rabbi Simeon:

    "If a man looks upon the Torah as merely a book presenting narratives and everyday matters, alas for him! Such a torah, one treating with everyday concerns, and indeed a more excellent one, we too, even we, could compile. More than that, in the possession of the rulers of the world there are books of even greater merit, and these we could emulate if we wished to compile some such torah. But the Torah, in all of its words, holds supernal truths and sublime secrets.

    "See how precisely balanced are the upper and the lower worlds. Israel here below is balanced by the angels on high, concerning whom it stands written: "who makest thy angels into winds" (Psalms 104:4). For when the angels descend to the earth they don earthly garments, else they could neither abide in the world, nor could it bear to have them. But if this is so with the angels, then how much more so it must be with the Torah: the Torah it was that created the angels and created all the worlds and through Torah are all sustained. The world could not endure the Torah if she had not garbed herself in the garments of this world. (temple of Solomon, and within us)

    "Thus the tales related in the Torah are simply her outer garments, and woe to the man who regards that outer garb as the Torah itself, for such a man will be deprived of portion in the next world. Thus David said: "Open Thou mine eyes, that I may behold wondrous things out of Thy law" (Psalms 119:18), that is to say, the things that are underneath. See now. The most visible part of a man are the clothes that he has on, and they who lack understanding, when they look at the man, are apt not to see more in him than these clothes. In reality, however, it is the body of the man that constitutes the pride of his clothes, and his soul constitutes the pride of his body.

    "So it is with the Torah. Its narrations which relate to the things of the worlds constitute the garments which clothe the body of the Torah; and that body is composed of the Torah's precepts, gufey-torah (bodies, major principles). People without understanding see only the narrations, the garment; those somewhat more penetrating see also the body. But the truly wise, those who serve the most high King and stood on mount Sin

  24. Re:I don't believe 1% of computers give wrong answ on Whose Bug Is This Anyway? · · Score: 2

    > I actually believe it. I am sure they might have think of floating point precision problem.

    I can believe it. Ten years ago on one the PC games I worked on there were significant floating-point differences between Intel and AMD. Fortunately it was an RTS so we could get away with fixed-point. If we would of been forced to deal with floats it would of been a hassle to keep them "in sync."

    Floating-point is an approximation anyways, so IMHO

    a) the server should be making the authoritative decision(s), and
    b) should be sending a quantized result to the clients.

  25. Re:Are we any smarter than we were 2000 years ago? on Google Brings the Dead Sea Scrolls To the Digital Age · · Score: 1

    Agreed with your first point 100%.

    To comment on the your second point. It is a fact that the Torah was "plagiarized" from other sources:

    * The Noahic flood comes from the Epic of Gilgamesh.
    * The 10 commandments come from the Egyptian Book of the Dead, chapter 125. That is 9 out of the 10.

    But who cares _where_ a _good_ law comes from if it is for the benefit of society. Only arm-chair critics! We have had the wheel for thousands of years but people don't get into a pissing contest about who invented / discovered it.