I++ vs i+=1


  • BINNED

    @abarker said:

    only developer

    Hello, my name is Onyx and I'm the only dev.

    That is the truth, not (only) a joke



  • Got it. Ticks and no code.

    Sorry.


  • FoxDev

    Hello, my name is Accalia and I'm a developer.

    /me sits down in the folding chair as everone else in the circle says "Hello Accalia" and the person to my left stands


  • FoxDev

    @accalia said:

    sits down in the folding table

    :wtf:


  • FoxDev

    had a braino. fixed.



  • If you're actually paying me to write code for you, then fine, put whatever bullshit hoops wherever you like and I'll jump through them, and if that slows down my rate of development, so be it. You're the boss, and while I might try to point out from time to time that your coding standard sucks and needs to be changed, I'll do my best to conform with it (as long as it's not actively detrimental to the code quality...)

    If you're an open source project and you reject my patch that I donated to you in my spare time out of the goodness of my heart because of some petty bullshit, well, then you just lost the chance to receive any more patches, I'll go find some other project to work on where the quality of my contribution depends on what the code does, or what bugs it fixes rather than waste time trying attain some arbitrary cosmetic ideal.



  • @accalia said:

    Hello, my name is Accalia and I'm a developer.

    You're in the wrong circle. This circle is for developers who don't have any developer cow-orkers.


  • FoxDev

    oh..... 😦

    well i belonged in this circle for all of January..... then the new kid showed up.



  • i have a junior so green he needs mowing. does that excludes me from the circle?



  • @Jarry said:

    i have a junior so green he needs mowing. does that excludes me from the circle?

    Yes.


  • Discourse touched me in a no-no place

    @accalia said:

    oh.....

    well i belonged in this circle for all of January..... then the new kid showed up.

    You can come and join us over in the circle for software engineers, except there's nobody actually there because this is yet another Belgium­ing meeting and this is one they can skip out of for a change and they're not going to miss that opportunity to actually get some work done…


  • Java Dev

    @dkf said:

    You can come and join us over in the circle for software engineers, except there's nobody actually there because this is yet another Belgium­ing meeting and this is one they can skip out of for a change and they're not going to miss that opportunity to actually get some work done…

    QFT



  • One thing I forgot to mention the other day about automated source checking. I did look into the feasibility of running astyle as a pre-commit hook so that any code under source control is formatted suitably. In theory at least, you have one commit where all the code is initally run through the formatter, and from then on, you get absolutely clean and pure diffs forevermore...

    (The main problem I ran into was that there were a couple of situations where I couldn't quite get the formatting just right, and while it'd be fun to patch astyle to work perfectly, I felt that my time would be better spent writing code for my project instead.... it's still on my todo list though...)

    Basically the main difference between what was suggested upthread is that all formatting and layout issues in the code are delegated to the machine. But any decisions about the content and expression of the code are resolved by humans during code review, and once you have human sign off on the code, you don't have to suffer the indignities of having your code rejected by robots because you used the wrong kind of addition.

    Seems like the perfect system to me: humans do all the hard, interesting work defining the semantics of the software, and the computers do all the boring drudge work like making sure all the {}s line up...


  • FoxDev

    @tar said:

    Basically the main difference between what was suggested upthread is that all formatting and layout issues in the code are delegated to the machine.

    I think i follow what you're going for here, but i've got to ask... what's the other option? we have between upthread suggestion and what?

    I have a feeling i'm going to facepalm on the answer but right now this is really confusing me grammatically.


  • Discourse touched me in a no-no place

    @tar said:

    (The main problem I ran into was that there were a couple of situations where I couldn't quite get the formatting just right, and while it'd be fun to patch astyle to work perfectly, I felt that my time would be better spent writing code for my project instead.... it's still on my todo list though...)

    The main problems usually come with getting comments formatted sensibly when they contain ASCII art that explains something particularly tricky. Changing the spaces there can so easily turn something that explains into something that obscures.



  • @dkf said:

    ASCII art
    I always thought it would be cool to be able to put graphics in comments, some analogue of an <img> tag.

    For a while I really was tempted to make an emacs minor mode that would pull dot graph descriptions from comments, render them, and embed the results. I'm not working on the project I was then though (an automaton library), and with it the need has largely passed.



  • @dkf said:

    The main problems usually come with getting comments formatted sensibly when they contain ASCII art that explains something particularly tricky. Changing the spaces there can so easily turn something that explains into something that obscures.

    The obvious solution would seem to be leaving whitespace in comments the hell alone, which I'm pretty sure you can configure astyle to do (if that isn't it's default behaviour in the first place...)


  • Discourse touched me in a no-no place

    @tar said:

    The obvious solution would seem to be leaving whitespace in comments the hell alone

    Obvious, but not necessarily right either. Most comments aren't ASCII art and can be reformatted just fine. It's nice to have software clean that sort of thing up for you.

    I'm currently just manually using Shift+Cmd+F before saving in Eclipse for this sort of thing. Imperfect, but works.



  • I guess you could do whatever Doxygen does to indicate ASCII art...



  • My awesome pipe dream idea that probably wouldn't work well in practice is to not reject commits that don't meet some formatting requirements, but just format them at that point.

    Developers could set up a post-update hook script to format them in whatever way they want, edit it to their heart's content in that manner, and then commit and it would be returned to the standard format.


  • Java Dev

    Until you have to look over the shoulder of that one guy who likes single-space indents and full-hd fullscreen terminals at 10pt to explain something to him.

    No thanks.


  • Discourse touched me in a no-no place

    @PleegWat said:

    Until you have to look over the shoulder of that one guy who likes single-space indents and full-hd fullscreen terminals at 10pt to explain something to him.

    No thanks.

    I've seen someone write Java like FORTRAN. Old school. Indented 7 columns. As much in ALL CAPS as possible.

    😖


  • Considered Harmful

    ++i.

    @dkf said:

    I've seen someone write Java like FORTRAN

    I've seen someone write JSP like PL/SQL.


  • Trolleybus Mechanic

    What's better?
    i = i - 1

    or

    i--

    ????



  • @accalia said:

    var q = (++i + 4) * (i++-1);

    so i forbid ++ and -- in projects i have control over. it's not that big a deal and it means you can't pull that shite on me.

    I hate this type of code, and I hate being forbid doing stuff. I don't know which side I'm on this one.



  • @accalia said:

    i'm not a fan of them, no. that one wouldn't pass code review,

    Help, help, I'm being opressed



  • @Lorne_Kates said:

    What's better?i = i - 1

    or

    i--

    ????

    The first expression evaluates to the value i has after the operation, while the second one evaluates to the value i had before the operation. Since they're not equivalent, I don't see why anyone would think they are interchangeable. Neither is better than the other, they do different things.



  • I'm late...very late, but ...

    i=i+ONE; // increment by ONE

    Because every machine operation must be explicit in the code. Also, we must use a define because magic constants are bad, which is another reason why i++ is absolutely unacceptable--it implies a magic constant. Also, you know, comments!


  • Trolleybus Mechanic

    @CoyneTheDup said:

    I'm late...very late, but ...

    i=i+ONE; // increment by ONE

    Because every machine operation must be explicit in the code. Also, we must use a define because magic constants are bad, which is another reason why i++ is absolutely unacceptable--it implies a magic constant. Also, you know, comments!

    #define ONE 1.00000000001

    Edit:
    #FUCK YOU DISCOURSE
    ##FUCK YOU DISCOURSE
    ###FUCK YOU DISCOURSE

    Edit 2:
    Wait, adding more # makes it smaller**?!?!?!?!!!**

    😰

    Edit 3:
    Somehow the ?!?!??!!??! overtook the "strong text", but still left the 4 asterisks in between? Am I ever going to be able to sleep tonight, or will be I be constantly doing "edit: possehose bug x+1"



  • @Lorne_Kates said:

    Wait, adding more # makes it smaller****?!?!?!?!!!

    Yes. # == <h1>, ## == <h2>, etc.


  • BINNED

    @Lorne_Kates said:

    Am I ever going to be able to sleep tonight, or will be I be constantly doing "edit: possehose bug x+1"

    You mean possehose bug++?



  • @accalia said:

    In the second example, you have:var q = ((3+1) + 4) * (4 - 1) = 24

    Wrong. In the second example you have nasal daemons.


  • Discourse touched me in a no-no place

    @Lorne_Kates said:

    Wait, adding more # makes it smaller****?!?!?!?!!!

    That's a normal markdown thing; # is like a <h1>, ## is like a <h2>, ### is like a <h3>, etc.

    And use ``` (on a line on its own) to make code blocks. You put them both before and after the code, like this:

    #define ONE 1.00000000001
    

    Your schtick about refusing to learn the tools is getting old. Like a more recalcitrant Canadian version of Blakey…


  • Discourse touched me in a no-no place

    [quote="Planar, post:382, topic:9028]
    In the second example you have nasal daemons.

    [/quote]

    1. You don't know what language was being used. Not all of them invoke rhinodemons.
    2. @accalia did say it wouldn't pass code review…


  • i-- is better. But don't you dare try any of that --i garbage.



  • i-- saves the pre-value of i, implying that you're going to do something with it.


  • Trolleybus Mechanic

    @dkf said:

    Your schtick about refusing to learn the tools is getting old. Like a more recalcitrant Canadian version of Blakey…

    It isn't refusal. It's counterintuitive.

    No # = normal text
    One # = bigger text, bolder text

    Therefore adding # makes text bigger and bolder. Adding a second # should make it biggerer and bolderer

    And if a "user friendly" markdown language requires using a backtick-- a key 99.9999% of users don't even know exists on their keyboard-- that markdown language has failed and failed hard.

    #Look this is inside a "code block"


  • @Lorne_Kates said:

    It's counterintuitive.

    For anything other than simple bold and italic, yes, I agree, mostly.

    @Lorne_Kates said:

    And if a "user friendly" markdown language requires using a backtick-- a key 99.9999% of users don't even know exists on their keyboard

    Backtick is only required for code blocks, and users who are going to be pasting code snippets to a forum probably should know more than the average user about punctuation symbols on their keyboards.


  • Trolleybus Mechanic

    @HardwareGeek said:

    Backtick is only required for code blocks, and users who are going to be pasting code snippets to a forum probably should know more than the average user about punctuation symbols on their keyboards.

    Discourse isn't for developers.

    Also, if a markdown language requires people to use BACKSLASH-- which, again, 99.999999% of end-users have never even touched because http://-- markdown language fail etc.

    #hashtag joke


  • Trolleybus Mechanic

    This post is deleted!


  • @Lorne_Kates said:

    Discourse isn't for developersanyone.

    But :moving_goal_post:; we were taking about markdown in general, not specifically about discomarkbbhtmlcodedown.


  • BINNED

    @HardwareGeek said:

    Backtick is only required for code blocks, and users who are going to be pasting code snippets to a forum probably should know more than the average user about punctuation symbols on their keyboards.

    Expecting users to know stuff is Doing It Wrong™. 🚎


  • Trolleybus Mechanic

    @HardwareGeek said:

    @Lorne_Kates said:
    Discourse isn't for developersanyone.

    But :moving_goal_post:; we were taking about markdown in general, not specifically about discomarkbbhtmlcodedown.

    Until anyone can show that my complaints are about markdown in general, and not specifically about discomarkbbhtmlcodedown, I stand by my statement.

    Also: I refused to learn Discourse as a tool out of principal in the beginning. Now I'm not going to bother to learn a tool with a (thankful) limited amount of life remaining.



  • @Lorne_Kates said:

    I stand by my statement.

    I'm not disagreeing with your statements, just generalizing them.



  • @Lorne_Kates said:

    principal

    ITYM principle, unless Discourse has suddenly become the head administrator of an educational facility, which would certainly be a sinister development.



  • @tar said:

    >Discourse as a tool out of principal

    ITYM principle, unless Discourse has suddenly become the head administrator of an educational facility, which would certainly be a sinister development.

    Well, I think we'd all agree Jeff is the principal tool.


  • Trolleybus Mechanic

    @HardwareGeek said:

    I'm not disagreeing with your statements, just generalizing them.

    IStatement

    ILorneStatement : IStatement


  • Trolleybus Mechanic

    @HardwareGeek said:

    Well, I think we'd all agree Jeff is the principal tool.

    Jeff is a pane in the ass.



  • I'd post a screenshot of that one iconic scene from Secret of Evermore now, but I couldn't find one on the internet.


    Filed under: pane in the glass



  • @Lorne_Kates said:

    Until anyone can show that my complaints are about markdown in general, and not specifically about discomarkbbhtmlcodedown, I stand by my statement.

    Just read them: they start with if a markdown langage... not with if discourse's markdown language...

    Also, I think they are completely backward. A markdown language should use for its markup the characters that are most seldom used to write normal text, not the ones that people use all the time to write text.


Log in to reply