I love shooting myself in the foot



  •  A couple of days ago, I made the mistake of going back to the student organization mentioned in my last submission. I got an e-mail a couple of days ago with a new mobile app project that sounds like fun (read: brewing WTF). The WTF in this case does not lie with the student organization this time, but with the people who submitted the app idea.

    @E-Mail said:

     This app provides people a way to comment on what they read, hear, see, or watch on news sites, using twitter as a more convenient, mobile friendly way to interact with local news. The convenience and ubiquity of twitter provides news consumers an easier way to talk about local issues. Twitter is also used fervently by younger demographics with mobile devices that can access the Internet. This app could increase the news consumption of the much-sought-after youth demographic.

    So, what's wrong here?

    1. How do you tell what news to give them? By their current location or the city they used to create their Twitter account.
    2. How is this app more convenient than say, the Share feature on most news websites?
    3. In rural areas, most people will use another way to access the internet most of the time instead of their mobile devices due to crappy reception.
    4. Third party Twitter apps have a sweet 100,000 user limit and therefore your outreach is inherently limited.

    @E-Mail said:

    How to use it:

    After viewing a news piece online users have the ability to comment on it using a built in twitter posting system. This system will generate location-based hashtags determined by state, then city. Once the hashtags are generated, users can either add more tags or simply compose the rest of their tweet. The goal of this system is to make local news more accessible by improving organization and making searches more efficient.

    How it will work:

    Users will login to their twitter profile before commenting on a story. Once logged in, the URL of the story, and the location hashtags will generate. Users can then post their comment, sending the comment to both the news site’s page and twitter.

    Soooo, why do we need to post to both the site's comment feed and Twitter at the same time? Why not have a unique story hashtag and only post to Twitter or selectively share comments to Twitter?

    So here's where the fun begins.

    @E-Mail said:

    After the $media_conference the $org_name $group_name was brought on to develop the ideas featured in the $app_name app. One of the more innovative ideas developed in these discussions was a service that makes commenting on local news easier. Many local news services rely on clicks and comments to measure the reach of their stories. Unfortunately, the discussions on these comment boards are not always concise or relevant to the subject matter. This problem is seen frequently on local news sites. 

    Unfortunately people can be extremely polarized in their views and will not be able to always be concise or relevant in their comments, since we all know that MICROSOFT WINDOWS IS THE GR8EST OS EVAR MADE!!!!11!1!1 (note: this does not reflect my views. We all know Linux is better.)

    @E-Mail said:

    Users will write their comment just as they always do on a news site. However, the author of the story will designate two hashtags, one location tag i.e. #LNKNE, and another that would describe the overall subject of the story i.e. #heatwave. These tags will be generated into each comment made by users. Users can add more tags if they choose or they can simply write their post. A link to the story will also be generated if they choose to share their post to social media. After the post is written users can choose from two different options, share to Facebook, and share to twitter. If they choose to post to twitter their post will be cut off at 140 characters.

    Don't want to post to Twitter? That's okay, we support Facebook as well. I think we are starting to venture into [url="http://thedailywtf.com/Articles/The_Complicator_0x27_s_Gloves.aspx"]complicated glove[/url] territory. Also, I didn't know my phone has the ability to perform unstructured content analysis and provide a concise hashtag to describe said content. Even if done server side, it's still overly complex and insane. To top that all off, who doesn't like uncompleted s

    @E-Mail said:

    Each comment made using this system will automatically go into an offsite feed where users can search tags and see what other comments are being posted locally. This feed will be on its own website. The generated hashtags and story link will be the categorization system for the site. So, if users want to see other things people are commenting on locally, this site is the best place to do so. Along with searching posts, users can comment within the site on both stories and other users' comments.

    This system makes local news more relevant by making it more integrated with mobile, social media. The comment hub site will also be designed mobile first so that it's more accessible to people away from the desktop. Unfortunately not every news outlet will have a mobile site where commenting is easy so this comment hub would be a good place to go if you're looking for a quick way to browse local news stories.

    Sooo, sounds like we got some Not Invented Here syndrome going on here. Why not search Facebook or Twitter for the hashtags? Why not have the feed in the mobile app as well? I can see the website for devices that don't have a mobile app and for the desktop.

    What's that you say? Mobile first for the website? Oookay, since most mobile users either have Android or iOS, why not use the mobile app instead of the website on those devices? Don't leave out uses who use laptops and desktops, not to mention tablets.

    @E-Mail said:

    This service is currently being developed by myself, a student coder, and a student journalist. We’ve wireframed both the commenting system, and the comment archive and will start the design process later this week.

    THAT explains everything and why that this app, if it could shoot an arrow or a gun, couldn't hit the broad side of a barn. With a laser sight. At point blank range. I know that we don't denigrate students here, but seriously, three college students and not one ounce of "Do we even need this?" I think I posted this because it took a while for me to understand it and wanted people to know why most of our managers are like this and why this circle will never end.



  • If I understand correctly they basically want to motivate students to read more news by allowing them to "join the global conversation" using the social media they know and love to comment on the news.

    I guess there is a business case to be made but at the same time it's somehow depressing that allowing the much-sought-after youth demographic to post comments is the best way to motivate them to read the news. That's the Bartender Approach: listen to their babbling and they will keep drinking.



  • @Ronald said:

    If I understand correctly they basically want to motivate students to read more news by allowing them to "join the global conversation" using the social media they know and love to comment on the news.

    I guess there is a business case to be made but at the same time it's somehow depressing that allowing the much-sought-after youth demographic to post comments is the best way to motivate them to read the news. That's the Bartender Approach: listen to their babbling and they will keep drinking.

    I understand that part about wanting students to read the news more, but the direction of the app isn't clear. It seems like they want to do everything at once, as if the mentality of the .com bubble never went away.

     



  • @HuskerFan90 said:

    I understand that part about wanting students to read the news more, but the direction of the app isn't clear. It seems like they want to do everything at once, as if the mentality of the .com bubble never went away.

     

    Understanding which part of the client's approach is a business requirement and which part is a proposed solution is often the key to lead them away from the cliff but it's tricky because they don't make the distinction themselves. Having a feeling that they want to do everything is a typical symptom of solutions-infected business requirements.

    From the email you quoted it appears to me that most of the WTFs are in the "proposed solution" column. Maybe you just want to share the WTFs but if you are looking for a way to help them build this thing I would advise you to become knowledgeable about the Spiral Model and to become an advocate of that model for this project as it appears to be a good fit. Spiral is all about risk management and is fully compatible with most development methodologies (such as Agile) and will typically be an easy sell to people who are comfortable with a prototyping approach (such as your guy who created wireframes).

    You are part of an organization that apparently is motivated to build things. Maybe you dislike their lack of experience but it's an interesting environment. If at some point you find yourself working in an organization that always try to buy a SAP or Oracle package whenever they discover a new need you will see how bleak things can be in IT. Real life example: last year I spent almost two months writing a plugin to sanitize the data exchanged between an old SAP R/3 system and the "bleeding edge" AquaLogic DSP. I'd take the unclear direction of a new app over that any time*...

    * if the pay was decent, which is sadly never the case.



  • @HuskerFan90 said:

    @E-Mail said:
    Users will write their comment just as they always do on a news site. However, the author of the story will designate two hashtags, one location tag i.e. #LNKNE, and another that would describe the overall subject of the story i.e. #heatwave.
    So, if I understand this part correctly, they have to get participation from a whole lot of local news writers before their system is useful. In addition to all the other WTF. Sure...

     



  • @Ronald said:

    @HuskerFan90 said:

    I understand that part about wanting students to read the news more, but the direction of the app isn't clear. It seems like they want to do everything at once, as if the mentality of the .com bubble never went away.

     

    Understanding which part of the client's approach is a business requirement and which part is a proposed solution is often the key to lead them away from the cliff but it's tricky because they don't make the distinction themselves. Having a feeling that they want to do everything is a typical symptom of solutions-infected business requirements.

    From the email you quoted it appears to me that most of the WTFs are in the "proposed solution" column. Maybe you just want to share the WTFs but if you are looking for a way to help them build this thing I would advise you to become knowledgeable about the Spiral Model and to become an advocate of that model for this project as it appears to be a good fit. Spiral is all about risk management and is fully compatible with most development methodologies (such as Agile) and will typically be an easy sell to people who are comfortable with a prototyping approach (such as your guy who created wireframes).

    You are part of an organization that apparently is motivated to build things. Maybe you dislike their lack of experience but it's an interesting environment. If at some point you find yourself working in an organization that always try to buy a SAP or Oracle package whenever they discover a new need you will see how bleak things can be in IT. Real life example: last year I spent almost two months writing a plugin to sanitize the data exchanged between an old SAP R/3 system and the "bleeding edge" AquaLogic DSP. I'd take the unclear direction of a new app over that any time*...

    * if the pay was decent, which is sadly never the case.

    The reason why I titled the post the way I did is because I tried to push a unified team effort on the last project that failed to minimize risk. I tried to analyze all the requirements as I was the only person to have any experience dealing with the creation of a mobile app in a professional setting. The project failed because they tried to do too much in too many different directions in a short amount of time. Also they were attracted to buzzwords like moths to a bug zapper, which is quality entertainment to rednecks so I'm told.

    The mobile app I created, sure it was an internal LOB, took three months for the Android version with two people working on it and having feedback from the users with me and the other dude providing support. That was us choosing a direction and sticking with it.

     Also, you couldn't pay me enough to work back there where I built that LOB app. I had to aggregate data from an AS/400 system using convoluted REST/SOAP-like XML services, an ESB, with some ASP.NET SOAP Web services for an extra dose of WTF. I ended up writing a Java proxy that abstracted all that crap away. Made our SOAP Web services code (we didn't want to use SOAP, but the Architects required it) a lot more sane. Took me six hours of coding without a test environment and three weeks to fully round it off.

     



  • @HardwareGeek said:

    @HuskerFan90 said:

    @E-Mail said:
    Users will write their comment just as they always do on a news site. However, the author of the story will designate two hashtags, one location tag i.e. #LNKNE, and another that would describe the overall subject of the story i.e. #heatwave.
    So, if I understand this part correctly, they have to get participation from a whole lot of local news writers before their system is useful. In addition to all the other WTF. Sure...

     

    The problem with this is that most local news writers work for some news agency (e.g. newspapers, your local TV station, etc.) That instead brings the question: "Are the local news agencies going to be on board?" Of course, the simple answer to this question also happens to be another question: "Will we get revenue from your app?" which then leads to: "How do we make money from our app to pay the news agencies so there is content in our app so people will use our app?" Sadly, I don't think they thought of this because the e-mail lacks a "Monetization" section. I want to say "ads in the app" is the likely answer to this conundrum, but seeing as these are college students who may hate ads in apps, I can only hope.

     


  • Discourse touched me in a no-no place

    @HuskerFan90 said:

    I want to say "ads in the app" is the likely answer to this conundrum, but seeing as these are college students who may hate ads in apps, I can only hope.
    Maybe they just hate ads because they're the wrong ads. Not much point in advertising geriatric care to students, whereas places that sell cheap kegs of beer…



  • @Ronald said:

    Excel is the new Emacs

     

    That's it. Now somebody'll have to create a new VI, so we can have some nice flamewars again.



  • @dkf said:

    @HuskerFan90 said:
    I want to say "ads in the app" is the likely answer to this conundrum, but seeing as these are college students who may hate ads in apps, I can only hope.
    Maybe they just hate ads because they're the wrong ads. Not much point in advertising geriatric care to students, whereas places that sell cheap kegs of beer…

    Doesn't matter what kind of ads appear in the app, if they have no way to generate revenue to pay the news agencies this app is going to fail harder than the Surface RT.



  • @Mcoder said:

    @Ronald said:

    Excel is the new Emacs

    That's it. Now somebody'll have to create a new VI, so we can have some nice flamewars again.
    OpenOffice.org Calc can be the new vi.

     



  • @Mcoder said:

    @Ronald said:

    Excel is the new Emacs

     

    That's it. Now somebody'll have to create a new VI, so we can have some nice flamewars again.

    In Excel it's not possible to know when a user clicks on a scroll bar. However it is possible in Quattro Pro using PerfectScript since the DialogShow method will send the WM_VSCROLL Windows message on such event.



  • @Ronald said:

    @Mcoder said:

    @Ronald said:

    Excel is the new Emacs

     

    That's it. Now somebody'll have to create a new VI, so we can have some nice flamewars again.

    In Excel it's not possible to know when a user clicks on a scroll bar. However it is possible in Quattro Pro using PerfectScript since the DialogShow method will send the WM_VSCROLL Windows message on such event.

    Detect Scroll

    (Mostly because I was amused by the "Using a technique called "subclassing", you can detect when the user scrolls in a worksheet window. Subclassing is a complicated topic" part. Which, admittedly, is likely true for the intended target audience.)



  • @Ronald said:

    Quattro Pro

     



  • @Ronald said:

    In Excel it's not possible...
     

    That's quite a dangerous statement to make about something you just called "the new emacs".

    Anyway, I think neither OO Calc nor Quatro Pro would classify as Excel's nemesis. It must be somethng that works in a completely non-intuitive but "simple once you get it" way, and that is powerfull in a completely non-related way... Maybe Perl would be it.


  • Considered Harmful

    @El_Heffe said:

    @Ronald said:
    Quattro Pro

     




  • @Mcoder said:

    @Ronald said:

    In Excel it's not possible...
     

    That's quite a dangerous statement to make about something you just called "the new emacs".

    Anyway, I think neither OO Calc nor Quatro Pro would classify as Excel's nemesis. It must be somethng that works in a completely non-intuitive but "simple once you get it" way, and that is powerfull in a completely non-related way... Maybe Perl would be it.

    What about the VLC HTTP Interface?

    The award-winning RPN* evaluator comes to mind:

    @VLC said:

    RPN may look strange but it's a fast and easy way to write expressions. It also avoids the use of ( and ).

    Instead of writing ( 1 + 2 ) * 5 you just use 1 2 + 5 *.

    The idea behind it is: if we have a number or a string (using ''), push it on the stack. If it is an operator (like +), pop the arguments from the stack, execute the operators and then push the result onto the stack. The result of the RPN sequence is the value on the top of the stack. A step by step explanation of the sequence 1 2 + 5 * is shown below, to illustrate this process:

    Stack Contents Word Action taken on the stack
    empty 1 1 is pushed on the stack
    1 2 2 is pushed onto the stack, 'above' 1
    1 | 2 + The plus operator results in removal of 1 and 2 from the stack, then write 3 onto the stack
    3 5 5 is pushed on the stack
    3 | 5 * The multiplication operator removes 3 and 5 and writes 15 onto the stack.
    15 Final result.

    I'm pretty sure it's possible to rewire human DNA using this technology.

    * yes it means Reverse Polish Notation



  • @Ronald said:

    What about the VLC HTTP Interface?

    The award-winning RPN* evaluator comes to mind:

     

    Looks like a winner.

     


  • BINNED

    @VLC said:

    RPN may look strange but it's a fast and easy really painful way to write expressions (and good luck reading it later).
    Fixed for people who don't work in marketing.



  • Here is what I missed in the OP's description of the project:

    There is a lot of talk about "how" but not "why". Certainly, the app could be written; and almost certainly, it would work as described. BUT why? As in, WHY would anyone want to use this?


    I'm watching TV; I hear some story. I immediately go to my phone then:

    Launch this app

    Log in to twitter

    Make up two hashtags (a location tag, as if anyone knows what "#LNKNE" is; and a hashtag for the story)

    Type in my comment

    Switch over to twitter to see if my comment made it there

    Switch over to facebook to see if my comment made it there

    Open up a browser and navigate to the TV site and, after a lot of fumbling, go to see if my comment made it there

    Go back to twitter and see if anyone read my post, and read what others wrote

    Go to the "offsite feed" website to see what, if anything, anyone else said

    Vs: Have twitter running on my phone; as I'm watching the news, I post a note to twitter; and follow up with everyone else that I follow who happens to comment on that story.


    I just don't see any compellling reason for anyone to USE this app to post a comment. I don't see any compelling reason for a news organization to accept posts from this app.



  • @DrPepper said:

    Here is what I missed in the OP's description of the project:

    There is a lot of talk about "how" but not "why". Certainly, the app could be written; and almost certainly, it would work as described. BUT why? As in, WHY would anyone want to use this?


    I'm watching TV; I hear some story. I immediately go to my phone then:

    Launch this app

    Log in to twitter

    Make up two hashtags (a location tag, as if anyone knows what "#LNKNE" is; and a hashtag for the story)

    Type in my comment

    Switch over to twitter to see if my comment made it there

    Switch over to facebook to see if my comment made it there

    Open up a browser and navigate to the TV site and, after a lot of fumbling, go to see if my comment made it there

    Go back to twitter and see if anyone read my post, and read what others wrote

    Go to the "offsite feed" website to see what, if anything, anyone else said

    Vs: Have twitter running on my phone; as I'm watching the news, I post a note to twitter; and follow up with everyone else that I follow who happens to comment on that story.


    I just don't see any compellling reason for anyone to USE this app to post a comment. I don't see any compelling reason for a news organization to accept posts from this app.

    I have a better idea: a QR code that does the twitter post for you. You simply point your mobile at the QR code on the tv screen, you choose one of the 3 categories (OMG, WTF, LOL) and instantly a 140 character summary of the story would be posted under your twitter account, adding the category hashtag. This works with 96% of Twitter use cases.

    The free version of the app would cook a 70 characters summary of the story and use the remaining characters for ads.

    #OMG Apple unveils lighter iPad Air. Earn 2000$ a month working from home www.homezwork.com. 
    


  • @Ronald said:

    You simply point your mobile at the QR code on the tv screen, you choose one of the 3 categories (OMG, WTF, LOL) and instantly a 140 character summary of the story would be posted under your twitter account, adding the category hashtag.

    Pssh. If you knew anything about college students, you'd know to let them choose all three categories. All the time. By default, even.



  • @Arnavion said:

    @Ronald said:
    You simply point your mobile at the QR code on the tv screen, you choose one of the 3 categories (OMG, WTF, LOL) and instantly a 140 character summary of the story would be posted under your twitter account, adding the category hashtag.

    Pssh. If you knew anything about college students, you'd know to let them choose all three categories. All the time. By default, even.

    You guys forgot about YOLO.



  • @PedanticCurmudgeon said:

    @VLC said:
    RPN may look strange but it's a fast and easy really painful way to write expressions (and good luck reading it later).
    Fixed for people who don't work in marketing.

    What was wrong with what they said originally?  Or are you one of the people that has never used RPN and thus assume that it has to be complicated to use?


  • BINNED

    I have used RPN, and Forth, and Factor (a new object-oriented Forth). RPN is very easy to read for the computer. I prefer either infix or prefix with parens.



  • @locallunatic said:

    @PedanticCurmudgeon said:

    @VLC said:
    RPN may look strange but it's a fast and easy really painful way to write expressions (and good luck reading it later).
    Fixed for people who don't work in marketing.

    What was wrong with what they said originally?  Or are you one of the people that has never used RPN and thus assume that it has to be complicated to use?

    RPN for a variable is one thing. RPN for an expression is a totally different story:

    Instead of writing ( 1 + 2 ) * 5 you just use 1 2 + 5 *.
    

    If you call that anything but painful you must be German.



  • @Ronald said:

    RPN for a variable is one thing. RPN for an expression is a totally different story:

    Instead of writing ( 1 + 2 ) * 5 you just use 1 2 + 5 *.
    

    How is that painful?  Values, step, values, step.  It's rediculously simple.



  • @locallunatic said:

    @Ronald said:

    RPN for a variable is one thing. RPN for an expression is a totally different story:

    Instead of writing ( 1 + 2 ) * 5 you just use 1 2 + 5 *.

    How is that painful?  Values, step, values, step.  It's rediculously simple.

    Fascinating. You must be one of those bright stars who entertain and educate people at dinner parties with their extensive knowledge of how mail delivery could be optimized by switching to 6-digit zip codes or why still water can reach a temperature below the freezing point without freezing.



  • @Ronald said:

    What about the VLC HTTP Interface?

    The award-winning RPN* evaluator comes to mind

    I'm pretty sure it's possible to rewire human DNA using this technology.

    * yes it means Reverse Polish Notation


    Sheesh! Kids these days.

    Haven't you heard of the Forth language, or ever used or programmed an HP calculator????



  • @OzPeter said:

    @Ronald said:

    What about the VLC HTTP Interface?

    The award-winning RPN* evaluator comes to mind

    I'm pretty sure it's possible to rewire human DNA using this technology.

    * yes it means Reverse Polish Notation


    Sheesh! Kids these days.

    Haven't you heard of the Forth language, or ever used or programmed an HP calculator????

    I think you misunderstand the context. VLC is a media player and not only does it come with a proprietary web server (for people who want to remotely start movies) but it also has a proprietary language for creating web pages for that proprietary web server, and someone even implemented a RPN expression evaluator for that proprietary language. W. T. F.


  • Discourse touched me in a no-no place

    @locallunatic said:

    @Ronald said:

    RPN for a variable is one thing. RPN for an expression is a totally different story:

    Instead of writing ( 1 + 2 ) * 5 you just use 1 2 + 5 *.

    How is that painful?  Values, step, values, step.  It's rediculously simple.

    It's painful because they're not used to it, and - from the looks of it - don't want to become used to it. I can't see what's problematic about it either; that said I put some effort into learning about it when I first came across it.

  • Considered Harmful

    @PJH said:

    @locallunatic said:

    @Ronald said:

    RPN for a variable is one thing. RPN for an expression is a totally different story:

    Instead of writing ( 1 + 2 ) * 5 you just use 1 2 + 5 *.

    How is that painful?  Values, step, values, step.  It's rediculously simple.

    It's painful because they're not used to it, and - from the looks of it - don't want to become used to it. I can't see what's problematic about it either; that said I put some effort into learning about it when I first came across it.
    Genuine question: can you push more than two values on the stack at a time? And possibly then have multiple operators.
    If not, how is it different from using traditional syntax other than strict left-to-right order of operations?

  • Discourse touched me in a no-no place

    @joe.edwards said:

    Genuine question: can you push more than two values on the stack at a time? And possibly then have multiple operators.
    You mean like:

    1 2 3 4 5 + * / -

    Which would conventionally (though perhaps not minimally) be represented by:

    (((4+5)*3)/2)-1



    If so, yes. If not, can you give an example of what you mean?



  • @joe.edwards said:

    If not, how is it different from using traditional syntax other than strict left-to-right order of operations?

    Did you people not learn about RPN in school? (Genuine question.) Writing an RPN calculator is like a standard high-school compsci exercise (in where I come from) since it teaches stacks (the data structure).

    Anyway RPN is implemented via a standard stack. Each operand gets pushed. Each operator pops two operands from the stack, applies the operator, pushes the result. At end of input, you pop the stack and that's your final result.


  • Discourse touched me in a no-no place

    @Arnavion said:

    Did you people not learn about RPN in school? (Genuine question.)
    I didn't. First time I came across it was when I was around 27 and I was writing a parser for a config file.



  • @joe.edwards said:

    Genuine question: can you push more than two values on the stack at a time? And possibly then have multiple operators.
    If not, how is it different from using traditional syntax other than strict left-to-right order of operations?
    HP calculators, at least back when I used to use one regularly, supported a 4-deep stack. Supposedly, this is sufficient to evaluate an arbitrarily complex expression, at least if you do the operations in the right order. If there are any tricks to ordering the operations so they fit in the stack, I've long-since forgotten them.

     



  • @PJH said:

    @joe.edwards said:
    Genuine question: can you push more than two values on the stack at a time? And possibly then have multiple operators.
    You mean like:

    1 2 3 4 5 + * / -

    Which would conventionally (though perhaps not minimally) be represented by:

    (((4+5)*3)/2)-1


    Sure about that one? I would have guessed that the operator would follow operands, not be put in the end, like they do in their example.

    So this:
    (((4+5)*3)/2)-1
    would be this:
    4 5 + 3 * 2 / 1 -

    But nowadays I'm mostly a PowerPointer so maybe I'm missing something.


  • Discourse touched me in a no-no place

    @Ronald said:

    @PJH said:
    @joe.edwards said:
    Genuine question: can you push more than two values on the stack at a time? And possibly then have multiple operators.
    You mean like:

    1 2 3 4 5 + * / -

    Which would conventionally (though perhaps not minimally) be represented by:

    (((4+5)*3)/2)-1


    Sure about that one? I would have guessed that the operator would follow operands, not be put in the end, like they do in their example.

    So this:
    (((4+5)*3)/2)-1
    would be this:
    4 5 + 3 * 2 / 1 -

    But nowadays I'm mostly a PowerPointer so maybe I'm missing something.

    Maybe - I'd just woken up and probably misremembered something....

  • Discourse touched me in a no-no place

    @PJH said:

    @Ronald said:
    @PJH said:
    @joe.edwards said:
    Genuine question: can you push more than two values on the stack at a time? And possibly then have multiple operators.
    You mean like:

    1 2 3 4 5 + * / -

    Which would conventionally (though perhaps not minimally) be represented by:

    (((4+5)*3)/2)-1


    Sure about that one? I would have guessed that the operator would follow operands, not be put in the end, like they do in their example.

    So this:
    (((4+5)*3)/2)-1
    would be this:
    4 5 + 3 * 2 / 1 -

    But nowadays I'm mostly a PowerPointer so maybe I'm missing something.

    Maybe - I'd just woken up and probably misremembered something....
    But this would indicate not.

  • Considered Harmful

    @Arnavion said:

    @joe.edwards said:
    If not, how is it different from using traditional syntax other than strict left-to-right order of operations?

    Did you people not learn about RPN in school? (Genuine question.) Writing an RPN calculator is like a standard high-school compsci exercise (in where I come from) since it teaches stacks (the data structure).

    Anyway RPN is implemented via a standard stack. Each operand gets pushed. Each operator pops two operands from the stack, applies the operator, pushes the result. At end of input, you pop the stack and that's your final result.

    I had not heard of it before. It doesn't seem that hard to work out, I just wasn't sure about there being a canonical form, or if you could move all the operators to the end if you wanted. That seems cleared up now; couldn't have been a very tough class!

  • BINNED

    @Ronald said:

    @PJH said:
    @joe.edwards said:
    Genuine question: can you push more than two values on the stack at a time? And possibly then have multiple operators.
    You mean like:

    1 2 3 4 5 + * / -

    Which would conventionally (though perhaps not minimally) be represented by:

    (((4+5)*3)/2)-1


    Sure about that one? I would have guessed that the operator would follow operands, not be put in the end, like they do in their example.

    So this:
    (((4+5)*3)/2)-1
    would be this:
    4 5 + 3 * 2 / 1 -

    But nowadays I'm mostly a PowerPointer so maybe I'm missing something.

    Your expression is correct, but in general the operator doesn't always have to directly follow the operands. Also, the fact that PJH is having trouble with this relatively simple expression proves my point.


  • @joe.edwards said:

    I just wasn't sure about there being a canonical form, or if you could move all the operators to the end if you wanted.

    Ah. Well there's no canonical form. The benefit of RPN is that your calculator doesn't need to be complicated enough to understand parentheses since it offloads the burden of resolving order of operations to the user. In general it's not always possible to have all operands at the start and then all operators at the end: (1 + 2) * (3 + 4) must be written as 1 2 + 3 4 + * Also most RPN calculators invert the intuitive order of non-commutative operators (-, /, etc.) to allow inversion of the operator using an operand later in the sequence. Eg: a - b is usually computed via b a - instead of a b - because this allows you to write a - (huge complicated expression) as (huge complicated expression) a - instead of requiring "a" to be in the stack the whole time. (*) The same for division.

    *: (huge complicated expression) - a can be computed as (huge complicated expression) a - 0 - which again doesn't require "a" to be in the stack the whole time.



  • @joe.edwards said:

    Genuine question: can you push more than two values on the stack at a time? And possibly then have multiple operators.

    Yes! It tends to get confusing. Infix (with parentheses) is easier to grep, but RPN is quite easy to write or evaluate once you're used to it. Not so much easy to see the whole expression without atually evaluating it (for instance, trying to do algebra with RPN would be miserable).

    @PJH said:
    @joe.edwards said:
    Genuine question: can you push more than two values on the stack at a time? And possibly then have multiple operators.
    You mean like:

    1 2 3 4 5 + * / -

    Which would conventionally (though perhaps not minimally) be represented by:

    (((4+5)*3)/2)-1

    ...no. You mean this:

    1 - (2 / (3 * (4 + 5)))

    You evaluate it as follows:

    1 2 3 4 5 +
    1 2 3 9 *
    1 2 27 /
    1 0.07407407407407407 -
    0.9259259259259259

    The expression you wrote...

    (4 + 5) * 3 / 2 - 1

    looks like this in RPN:

    4 5 + 3 * 2 / 1 -

    ...which evaluates to 12.5.



  • @anotherusername said:

    The expression you wrote...

    (4 + 5) * 3 / 2 - 1

    looks like this in RPN:

    4 5 + 3 * 2 / 1 -

    ...which evaluates to 12.5.

    What he wrote originally is also fine. The difference between your and his interpretation is how you order the operands for non-commutative operators. Both are valid interpretations but of course yield different results.



  • @Arnavion said:

    What he wrote originally is also fine. The difference between your and his interpretation is how you order the operands for non-commutative operators. Both are valid interpretations but of course yield different results.

    If he was ordering the operands backward (2nd operand <operator> 1st operand), he should have written:

    (((5 + 4) * 3) / 2) - 1

    Yeah, I know that addition is commutative, but let's be consistent here...



  • @anotherusername said:

    @Arnavion said:
    What he wrote originally is also fine. The difference between your and his interpretation is how you order the operands for non-commutative operators. Both are valid interpretations but of course yield different results.

    If he was ordering the operands backward (2nd operand <operator> 1st operand), he should have written:

    (((5 + 4) * 3) / 2) - 1

    Yeah, I know that addition is commutative, but let's be consistent here...

    I wrote the reason in an earlier post, but there is a genuine reason calculators order operands backwards for non-commutative operators; it's not a stylistic choice. That doesn't mean you *always* order operands backwards (or even try to for the sake of "consistency").

    PJH's original post

    @PJH said:

    @joe.edwards said:
    Genuine question: can you push more than two values on the stack at a time? And possibly then have multiple operators.
    You mean like:

    1 2 3 4 5 + * / -

    Which would conventionally (though perhaps not minimally) be represented by:

    (((4+5)*3)/2)-1



    If so, yes. If not, can you give an example of what you mean?

    claimed that the string "1 2 3 4 5 + * / -" is a valid RPN sequence, and it is. He also claimed it would evaluate to (((4+5)*3)/2)-1, which is indeed one of the ways it can be evaluated as.



  • @Arnavion said:

    That doesn't mean you always order operands backwards (or even try to for the sake of "consistency").
    I'm afraid we'll just have to disagree. Multiplication is commutative too; you could just as easily write ((3 * (5 + 4)) / 2) - 1 and the answer would be the same but the RPN expression would be different.@Arnavion said:
    the string "1 2 3 4 5 + * / -" is a valid RPN sequence
    I'm not arguing that point.@Arnavion said:
    it would evaluate to (((4+5)*3)/2)-1
    Only by luck, since the addition operator is commutative. Okay, if you want to be sloppy and don't care about the order of operands as long as it parses and evaluates to the equivalent meaning of what you should have written... well, a shit out yourself knock, I give like. Not any of debugging code your I'm.



  • @anotherusername said:

    Only by luck, since the addition operator is commutative. Okay, if you want to be sloppy and don't care about the order of operands as long as it parses and evaluates to the equivalent meaning of what you should have written... well, a shit out yourself knock, I give like. Not any of debugging code your I'm.
    Your word soup makes me wonder if one's native language makes any difference in how easily one groks RPN. Some languages (e.g., English) use sentences with subject-verb-object (infix) structure, while others (e.g., Greek) use subject-object-verb (postfix) or object-subject-verb structure. I suspect it takes very little education/experience to overcome a bias toward infix or postfix preference, but I wonder whether anyone has ever studied whether that bias exists in the first place.

     



  • In past times, this entire thread would have been a great blakeyrant honeypot.



  • @anotherusername said:

    I'm afraid we'll just have to disagree. Multiplication is commutative too; you could just as easily write ((3 * (5 + 4)) / 2) - 1 and the answer would be the same but the RPN expression would be different.

    PJH's post was converting RPN to infix, not the other way around.

    @anotherusername said:

    Only by luck, since the addition operator is commutative. Okay, if you want to be sloppy and don't care about the order of operands as long as it parses and evaluates to the equivalent meaning of what you should have written... well, a shit out yourself knock, I give like. Not any of debugging code your I'm.

    var next = input.read()
    
    if next is an operator
    	var1 = stack.pop()
    	var2 = stack.pop()
    
    	switch next:
    		case "+": result = var1 + var2
    		case "-": result = var1 - var2
    		case "*": result = var1 * var2
    		case "/": result = var1 / var2
    
    	stack.push(result)
    

    The input is 1 2 3 4 5 + * / - What is the operation performed when the + is encountered? The addition of 4 and 5. What is the operation performed when the * is encountered? The multiplication of 3 and 9. What is the operation performed when the / is encountered? The division of 27 by 2. What is the operation performed when the - is encountered? The subtraction of 1 from 13.5. The result is 12.5. The final computation is equivalent to the infix "(((4 + 5) * 3) / 2) - 1" which performs the same steps in the same order as the RPN.

    Your objection has no merit.


Log in to reply