This forum is in permanent archive mode. Our new active community can be found here.

Random Comments

1345346348350351521

Comments

  • edited December 2012
    On the subject of coding style, what's the most common way of differentiating class variable names, and the variables used to assign them values in the constructor. Python doesn't have this problem because it uses "this.variableName = variableName" but in a language like C++, these have to be different.
    Post edited by Pegu on
  • WTF. Motif is the worst. Maybe they made the GUI bad on purpose to keep nubs from trying to use it.
    Motif may have been the worst, but it was also the first. Well, okay, except for maybe Sun's OpenLook, which really wasn't any better. Both Motif and OpenLook date to the late 80's/early 90's. GTK+ and Qt didn't show up until the mid to late 90's. As far as trying to keep nubs from using it... well... I think it was a case of just not understanding how to make a decent GUI along with a whole "GUI designed by committee" thing. Of course, even if the GUI itself sucked, the API was even worse. You needed something like 30-40 lines of C code, most of it boilerplate crap, just to put a button on screen and have it do something when you clicked on it.
    On the subject of coding style, what's the most common way of differentiating class variable names, and the variables used to assign them values in the constructor. Python doesn't have this problem because it uses "this.variableName = variableName" but in a language like C++, these have to be different.
    Where I work, we prefix class variable names with an m_ so we get things like m_numItems and stuff like that. Other alternatives include prepending with an underscore so you get _numItems or appending so you have numItems_.
  • edited December 2012
    On the subject of coding style, what's the most common way of differentiating class variable names, and the variables used to assign them values in the constructor. Python doesn't have thid problem because it uses "this.variableName = variableName" but in a language like C++, these have to be different.
    That is a great question. I tend to always just use as similar a name as possible, modifying it slightly.

    I tried to skim through Code Complete to find a solution, but it took too long. It's a large book, and the index and table of contents weren't much help. I also found this StackOverflow thread.

    http://stackoverflow.com/questions/760777/c-getters-setters-coding-style

    Which gave me an idea. What if you called the setter from the constructor? Something along the lines of this not complete code. Would this even work?
    class Foo {
    int parameter;
    Foo(int parameter){
    setParameter(parameter);
    }
    void setParameter(int newParameter){
    parameter = newParameter;
    }
    }
    Using the newParameter language in a setter function makes sense, and it would allow you to use the name of the variable as the parameter name in the constructor. The added bonus is that any code in the setter to validate the input would be triggered in the constructor for more DRY and added protection and consistency.
    Post edited by Apreche on
  • I want to grief people in Minecraft so bad now.
  • Finally realizing that 2x speed playback of podcasts is the best thing ever.
    This. There's probably an Android app that will do it, but the one I use now doesn't. I really miss it.
  • On the subject of coding style, what's the most common way of differentiating class variable names, and the variables used to assign them values in the constructor. Python doesn't have this problem because it uses "this.variableName = variableName" but in a language like C++, these have to be different.
    What if you called the setter from the constructor? Something along the lines of this not complete code. Would this even work?
    class Foo {
    int parameter;
    Foo(int parameter){
    setParameter(parameter);
    }
    void setParameter(int newParameter){
    parameter = newParameter;
    }
    }
    Using the newParameter language in a setter function makes sense, and it would allow you to use the name of the variable as the parameter name in the constructor. The added bonus is that any code in the setter to validate the input would be triggered in the constructor for more DRY and added protection and consistency.
    I tried that and it worked.
  • On the subject of coding style, what's the most common way of differentiating class variable names, and the variables used to assign them values in the constructor. Python doesn't have this problem because it uses "this.variableName = variableName" but in a language like C++, these have to be different.
    What if you called the setter from the constructor? Something along the lines of this not complete code. Would this even work?
    class Foo {
    int parameter;
    Foo(int parameter){
    setParameter(parameter);
    }
    void setParameter(int newParameter){
    parameter = newParameter;
    }
    }
    Using the newParameter language in a setter function makes sense, and it would allow you to use the name of the variable as the parameter name in the constructor. The added bonus is that any code in the setter to validate the input would be triggered in the constructor for more DRY and added protection and consistency.
    I tried that and it worked.
    Great, now I feel like I'm too clever for my own good.
  • Scott, that exact technique is taught in a few Java textbooks I've read. You're not the first. Another alternative I've seen is:
    Foo(int parameter) {
    this.parameter = parameter;
    }
  • edited December 2012
    Another alternative I've seen is:
    Foo(int parameter) {
    this.parameter = parameter;
    }
    That doesn't work.
    Post edited by Pegu on
  • Another alternative I've seen is:
    Foo(int parameter) {
    this.parameter = parameter;
    }
    That doesn't work.
    Yeah, that only works in Python and such.
  • My bad. I'm thinking Java, not C++.
  • Usually people use camelCase and PascalCase to differentiate between the two.
  • edited December 2012
    Usually people use camelCase and PascalCase to differentiate between the two.
    Interestingly enough, the Windows API was originally conceived as a Pascal API and later redone as C in the Win16 era, hence the wide use of PascalCase in it. Win32 was C-based from the start, but kept many of the conventions of Win16, including PascalCase, to allow for ease of porting.

    BTW, the absolute worst thing to come out of the Windows APIs was Hungarian notation.

    Edit: correction. Win16 actually used Pascal calling conventions to save memory (or so Microsoft claims) over C calling conventions, but was never originally written in Pascal. It was written in a mix of C and assembly.
    Post edited by Dragonmaster Lou on
  • おそらくTMBGの曲からとった名義だろう
    歌い方もどことなくJohn Fを思わせるところがある
    LSDjとギターを基調にしばしばチップゲイズ的な場面もある3分間ポップを展開

    Anyone able to translate this for me? A cool Japanese indie-pop guy wrote this about one of my songs and the Google translated version is fairly incoherent in regards to that last line.
  • If you're referring to after the LSD part, he has a weird term of "Chip gaze" (チップゲイズ). I took out gaze and it translated to this:

    Expand the pop scene for three minutes, which is also a chip (gaze) often toned guitar.
  • edited December 2012
    Yeah, that's pretty incomprehensible. The "chip gaze" part I actually know what he means, he's combining the terms chiptune and shoegaze.
    Post edited by Sail on
  • edited December 2012
    "There is a three minute pop development where the scene is very typical of chipgaze in the LSD and guitar keytone."

    That's the best I can do.
    Post edited by Omnutia on
  • Thanks! That helps.
  • OMG the Hungarian notation when I did some Visual Basic in high school. I don't even know how the Hungarians can get any code written.
  • OMG the Hungarian notation when I did some Visual Basic in high school. I don't even know how the Hungarians can get any code written.
    Fortunately for the Hungarians, only one of them actually came up with and used it. Unfortunately for everyone else, the Hungarian who came up with it was the lead programmer on the original DOS version of MS Word and wielded crazy influence at Microsoft as a result.
  • Google Apps for Individuals no longer free. Granted, this doesn't affect existing users, but it does mean that no new users will be able to get the free service.
  • Google Apps for Individuals no longer free. Granted, this doesn't affect existing users, but it does mean that no new users will be able to get the free service.
    Apparently if you sign up you can still get a free 1-user account. It used to be the free account was 10 users. Our account is so old we have even more users than that for free. I got that shit when it was still called GMail for your domain.
  • Hopefully they won't deprecate us. I sort of rely on this. If it comes to that, we will have to pay. ;^)
  • Google Apps for Individuals no longer free. Granted, this doesn't affect existing users, but it does mean that no new users will be able to get the free service.
    Apparently if you sign up you can still get a free 1-user account. It used to be the free account was 10 users. Our account is so old we have even more users than that for free. I got that shit when it was still called GMail for your domain.
    Same here. I still have something like 100 total users on my account, of which I think I'm using like 5 that I gave out to family and friends.
    Hopefully they won't deprecate us. I sort of rely on this. If it comes to that, we will have to pay. ;^)
    I'd rather not pay if it comes to this... I'll probably need to set up some sort of forwarding arrangement via my domain registrars and have things forward to straight-up Gmail accounts if that's the case.
  • Hopefully they won't deprecate us. I sort of rely on this. If it comes to that, we will have to pay. ;^)
    $50 per user per year isn't awful if we all pay individually, but I'd rather not.
  • Hopefully they won't deprecate us. I sort of rely on this. If it comes to that, we will have to pay. ;^)
    $50 per user per year isn't awful if we all pay individually, but I'd rather not.
    In my case, the people who I set up accounts for would be quite cranky if they had to pay anything for it. I mean, as you said, $50/year isn't that awful, but if you're used to free and really don't need the features other than having a stable email address that stays constant even if you change ISPs or email providers and doesn't have a jrandom23939392@gmail.com look to it, you may be better off just using email forwarding via your DNS provider.
  • edited December 2012
    I can't help but think that every time Scott says that he doesn't lie, but Rym does, it's actually just a ploy so he can lie with impunity whenever he feels it necessary.
    Post edited by Churba on
  • Being friends with Chase "AAAAAAAAAAAAAH" Gordon on Facebook is reward enough on its own, but every now and then his friends make it even more so.

    image
  • That's it, friend request sent.
  • edited December 2012
    Audition today. aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa

    If I die...Someone tell Rubin that Zax is a word and they look like this.

    Also, check this out.

    image
    Post edited by Churba on
Sign In or Register to comment.