Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
Modern Pragmatist
Aug 20, 2008
I have a question about decompilation of a debug version of a dll. I have a dll compiled with debug symbols and I know and have the source code for the framework that was used to design this software. Is there any way to incorporate this known source code into a decompiler to help decompile the debug dll? I feel like I have 99% of the pieces necessary but I'm just not sure what tools to use to piece them all together.

Adbot
ADBOT LOVES YOU

Strong Sauce
Jul 2, 2003

You know I am not really your father.





Vanadium posted:

That wouldn't stop someone with a spoofed client library that doesn't do that check, would it?

You have to be logged into Google.

Here is how it goes. You have a client_id that identifies your application.

User goes to your site, you redirect them to Google and they say, "Yes" give this dude access to my GDrive credentials so I can download cat pictures.

Google passes back a session cookie that your site sets.

Every time you make an API to Google, Google checks your session cookie is valid, and if it is, executes the command.

User logs off your site, and invalidates the session cookie.

Your site no longer has access to user's account.

sharktamer
Oct 30, 2011

Shark tamer ridiculous
Hopefully I can answer vagrant specific questions here. I'm trying to use vagrant on windows here to run yeoman. I have set up a share to my code folder on windows which syncs a folder within the vagrant guest. When I run yo webapp in the synced folder, it's constantly giving me issues, while running it in a non-synced folder within vagrant works fine.

The output log of yo webapp when running in the synced folder
The Vagrantfile I'm using

As you can see from the commented out line below the sync, I've tried using the rsync shares. This gets me past the errors, but doesn't actually sync the files between vagrant and windows. I can run vagrant rsync to get the changes, but this defeats the purpose of using grunt and livereload. vagrant rsync-auto crashes, but I don't want to have it running in a separate tab anyway.

e: Once the project is created by using yo either in the rsync synced folder, then switching back to normal sync or just running in another folder and copying to the synced folder, everything seems to work fine. Still, not being able to run yo to create projects in the first place is a hurdle I'd like to get over.

e2: Scratch that, I can't even move over completed yo runs to the synced folder. Gives a load of lines like this:

mv: cannot create directory ‘/shares/coding/html+css/playbook/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/node_modules/graceful-fs/test’: Protocol error

sharktamer fucked around with this message at 00:37 on Apr 30, 2014

Kenishi
Nov 18, 2010
I didn't look to see if there was a Qt thread to ask this in, but its small enough for here I guess.

I'm using PyQt and looking at the sourceforge api docs they specify multiple constructors. I've always read that in Python you can't have multiple constructors so how are they accomplishing this with PyQt? Are they simply doing some **kwargs magic to make it look like there are multiple constructors?

Dauq
Mar 21, 2008
I'm using read( write( to transfer data through a blocking stream socket in C, on Linux. Both client and server.
What i want to know is will the reads on the client and writes on the server match in size (as long as it is within the maximum receive buffer size ?). Or will the data come fragmented based on packet size, network issues and such and i'd have to rebuild it at the other end ?

coffeetable
Feb 5, 2006

TELL ME AGAIN HOW GREAT BRITAIN WOULD BE IF IT WAS RULED BY THE MERCILESS JACKBOOT OF PRINCE CHARLES

YES I DO TALK TO PLANTS ACTUALLY

Dauq posted:

I'm using read( write( to transfer data through a blocking stream socket in C, on Linux. Both client and server.
What i want to know is will the reads on the client and writes on the server match in size (as long as it is within the maximum receive buffer size ?). Or will the data come fragmented based on packet size, network issues and such and i'd have to rebuild it at the other end ?

TCP's abstraction is a stream of bytes. IIRC if read() returns, it can return with as little as one byte of what was sent. You should probably put a library between you and that socket.

nielsm
Jun 1, 2009



Dauq posted:

I'm using read( write( to transfer data through a blocking stream socket in C, on Linux. Both client and server.
What i want to know is will the reads on the client and writes on the server match in size (as long as it is within the maximum receive buffer size ?). Or will the data come fragmented based on packet size, network issues and such and i'd have to rebuild it at the other end ?

If you're using TCP then you definitely need to do your own buffering so you can collect enough data to build complete messages.
However if instead you're using UDP (datagram-mode sockets) then you always receive whole datagrams at a time, assuming they get delivered at all.

Blinkz0rz
May 27, 2001

MY CONTEMPT FOR MY OWN EMPLOYEES IS ONLY MATCHED BY MY LOVE FOR TOM BRADY'S SWEATY MAGA BALLS

sharktamer posted:

Hopefully I can answer vagrant specific questions here. I'm trying to use vagrant on windows here to run yeoman. I have set up a share to my code folder on windows which syncs a folder within the vagrant guest. When I run yo webapp in the synced folder, it's constantly giving me issues, while running it in a non-synced folder within vagrant works fine.

The output log of yo webapp when running in the synced folder
The Vagrantfile I'm using

As you can see from the commented out line below the sync, I've tried using the rsync shares. This gets me past the errors, but doesn't actually sync the files between vagrant and windows. I can run vagrant rsync to get the changes, but this defeats the purpose of using grunt and livereload. vagrant rsync-auto crashes, but I don't want to have it running in a separate tab anyway.

e: Once the project is created by using yo either in the rsync synced folder, then switching back to normal sync or just running in another folder and copying to the synced folder, everything seems to work fine. Still, not being able to run yo to create projects in the first place is a hurdle I'd like to get over.

e2: Scratch that, I can't even move over completed yo runs to the synced folder. Gives a load of lines like this:

mv: cannot create directory ‘/shares/coding/html+css/playbook/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/node_modules/graceful-fs/test’: Protocol error

VirtualBox doesn't support symlinks in shared folders without admin privileges.

  • Shut down the VM
  • Add this to your Vagrantfile:
    code:
    config.vm.customize ["setextradata", :id, "VBoxInternal2/SharedFoldersEnableSymlinksCreate/SHARE_NAME", "1"]
    in the vm config section.
  • run VirtualBox as admin
  • run your command prompt/bash shell as admin
  • Run "vagrant up" in shell

sharktamer
Oct 30, 2011

Shark tamer ridiculous

Blinkz0rz posted:

VirtualBox doesn't support symlinks in shared folders without admin privileges.

  • Shut down the VM
  • Add this to your Vagrantfile:
    code:
    config.vm.customize ["setextradata", :id, "VBoxInternal2/SharedFoldersEnableSymlinksCreate/SHARE_NAME", "1"]
    in the vm config section.
  • run VirtualBox as admin
  • run your command prompt/bash shell as admin
  • Run "vagrant up" in shell

Vagrant doesn't like that option, but it turns out it's default behaviour anyway. I've run all the vagrant commands in an admin shell and nothing's changed. I didn't run VirtualBox as admin, but Vagrant takes care of running the virtualbox commands anyway.

I have no problems creating and accessing symlinks in the synced folder. Just linked a folder in the vagrant home with one in the share, no issues at all.

sharktamer fucked around with this message at 22:11 on Apr 30, 2014

Blinkz0rz
May 27, 2001

MY CONTEMPT FOR MY OWN EMPLOYEES IS ONLY MATCHED BY MY LOVE FOR TOM BRADY'S SWEATY MAGA BALLS

sharktamer posted:

Vagrant doesn't like that option, but it turns out it's default behaviour anyway.

I've run all the vagrant commands in an admin shell and nothing's changed. I didn't run VirtualBox as admin, but Vagrant takes care of running the virtualbox commands anyway.

I'm pretty sure that even elevated applications can't elevate other applications. When Vagrant runs VirtualBox it's still running the VBoxService as non-privileged. Run VirtualBox as admin and minimize it.

quote:

I have no problems creating and accessing symlinks in the synced folder. Just linked a folder in the vagrant home with one in the share, no issues at all.

Listen, I've been through issues with npm and installing npm_modules in my shared folder. It is 100% caused by VirtualBox not doing symlinks correctly in shared folders.

See:
https://www.virtualbox.org/ticket/10085
https://coderwall.com/p/qklo9w
https://github.com/mitchellh/vagrant/issues/713

Note comment by laithshadeed near the bottom.

sharktamer
Oct 30, 2011

Shark tamer ridiculous
It does make sense, but it hasn't worked for me. I have:

- Run vagrant halt
- Checked for any VBox processes
- Run VirtualBox as admin
- Run zsh in ConEmu as admin (at least it seems I have)
- Run vagrant up, then ssh
- cd'd to the share directory (/shares/coding in my case)
- Created a new folder, ran 'yo webapp' in it

and it gives me the same errors as before. Running yo webapp still works in the vagrant home. I think it's completely likely that your theory is right and I'm doing something wrong but I'm not sure what I can do to check for that either.

Vagrantfile is the same as before.

e: Definitely running cmd as admin here

e2: I'm giving up on this, just gonna use the sublime sftp plugin and maybe some other ssh mounting apps. Synched folders just don't want to work with yeoman at least.

sharktamer fucked around with this message at 22:26 on May 1, 2014

Uziel
Jun 28, 2004

Ask me about losing 200lbs, and becoming the Viking God of W&W.
Is there any particular framework or script for an entirely vertical org chart?
I have an org structure of User->Manager that is incredibly shallow.
I have it working with the Google Org chart (https://developers.google.com/chart/interactive/docs/gallery/orgchart)
but due to the depth it is hard to follow and requires scrolling forever.

A Tartan Tory
Mar 26, 2010

You call that a shotgun?!
Posted this in the Java thread but I have a feeling it's straight up not a java problem.

Getting the following error while trying to compile an axis based web service, in the service java code itself. But I'm pretty sure it's attempting to reference something outside.

http://pastebin.com/G6QNXPGU

In all previous examples I have been given this is the way it has been referenced and it has worked, anyone have any ideas what could possibly be wrong? Going a bit nuts over it.

Vicar
Oct 20, 2007

That error comes from the compiler not being able to find the interface you're trying to implement (ProxyPort). Did you recently move your files around and forget a file?

TwoDogs1Cup
May 28, 2008

DOUGIE DOUGIE DOUGIE! MY LOVE, HE MAKES MY EMPTY HEART FULL! DOUGIE! THE BEST FOREVER THE BEST DOUGIEEE! <3 <3 - TwoDougies1Cup
Have a very specific question here.

I'm using an iFrame plugin to embed gfycat gifs on Wordpress, which works perfectly.

I read of a script https://github.com/gfycat/gfycat.js to make them click to play which is;

quote:

<div class="gfyitem" data-title=true data-autoplay=false data-controls=true data-expand=false data-id="BestYellowishElephantseal" />

and you have to add this script for it to work

quote:

<script type"text/javascript" src="http://test.gfycat.com/gfycat_test.js"></script>

The problem is it only shows one gif on the page even though I have like 10. It's like as soon as I add that script everything gets deleted except for the one gif that works.

I feel like I'm missing something really simple here, but I don't know what it is

baka kaba
Jul 19, 2003

PLEASE ASK ME, THE SELF-PROFESSED NO #1 PAUL CATTERMOLE FAN IN THE SOMETHING AWFUL S-CLUB 7 MEGATHREAD, TO NAME A SINGLE SONG BY HIS EXCELLENT NU-METAL SIDE PROJECT, SKUA, AND IF I CAN'T PLEASE TELL ME TO
EAT SHIT

Are you changing that data-id tag for each one?

e- I've only had time to skim it, but the idea is to add the div elements on your page, and the script replaces each of them with a magic gif object, right? That would mean if you're adding gifs normally with image tags, and wrapping the whole lot in a single div, the whole lot would be wiped and switched out for the single gify object that replaces the single div.

That might be completely wrong, just throwing it out there as a thing to investigate!

baka kaba fucked around with this message at 22:33 on May 3, 2014

TwoDogs1Cup
May 28, 2008

DOUGIE DOUGIE DOUGIE! MY LOVE, HE MAKES MY EMPTY HEART FULL! DOUGIE! THE BEST FOREVER THE BEST DOUGIEEE! <3 <3 - TwoDougies1Cup
I don't think I am adding the div elements. Crap



That's how it looks when I'm editing, but only the first gfycat plays

baka kaba
Jul 19, 2003

PLEASE ASK ME, THE SELF-PROFESSED NO #1 PAUL CATTERMOLE FAN IN THE SOMETHING AWFUL S-CLUB 7 MEGATHREAD, TO NAME A SINGLE SONG BY HIS EXCELLENT NU-METAL SIDE PROJECT, SKUA, AND IF I CAN'T PLEASE TELL ME TO
EAT SHIT

I don't know Javascript or JSON, so I can't really be of much help here, but honestly what you're doing there looks like how I'd use it. Creating a separate div with that class, and letting the script find each of them and pop another element in there.

So when you say only the first one plays, does that mean the others are at least appearing? Do you mean they don't play even when you click on them, or just that they're not auto-playing? If they're not appearing at all, look at the page source when your page has finished loading - do you see the gif's <img> elements added into the code?

TwoDogs1Cup
May 28, 2008

DOUGIE DOUGIE DOUGIE! MY LOVE, HE MAKES MY EMPTY HEART FULL! DOUGIE! THE BEST FOREVER THE BEST DOUGIEEE! <3 <3 - TwoDougies1Cup

baka kaba posted:

I don't know Javascript or JSON, so I can't really be of much help here, but honestly what you're doing there looks like how I'd use it. Creating a separate div with that class, and letting the script find each of them and pop another element in there.

So when you say only the first one plays, does that mean the others are at least appearing? Do you mean they don't play even when you click on them, or just that they're not auto-playing? If they're not appearing at all, look at the page source when your page has finished loading - do you see the gif's <img> elements added into the code?

Sorry no, only the first one appears. The rest don't show up.

I'll take a look at the page source though

baka kaba
Jul 19, 2003

PLEASE ASK ME, THE SELF-PROFESSED NO #1 PAUL CATTERMOLE FAN IN THE SOMETHING AWFUL S-CLUB 7 MEGATHREAD, TO NAME A SINGLE SONG BY HIS EXCELLENT NU-METAL SIDE PROJECT, SKUA, AND IF I CAN'T PLEASE TELL ME TO
EAT SHIT

Sorry, when I said page source I meant the final document you see when you explore the DOM through your browser's developer tools (can you tell I don't know webdev?). I'm looking at some dude's judo site and he's using img tags instead of divs, and they are getting completely replaced by a nest of div elements.

It might just be a case of the stuff loading but collapsing to zero size thanks to wacky HTML funtimes, so unless anyone else has any actual useful advice, that's the first place I'd look.

TwoDogs1Cup
May 28, 2008

DOUGIE DOUGIE DOUGIE! MY LOVE, HE MAKES MY EMPTY HEART FULL! DOUGIE! THE BEST FOREVER THE BEST DOUGIEEE! <3 <3 - TwoDougies1Cup
I finally got it working, thanks!

Kenishi
Nov 18, 2010
Didn't see a Maven thread.

Trying to use Maven to handle building a project, I'll call it MyGUI. The project requires the jar built from another maven project ("EventLib") I have. I have MyGUI's POM set up to take EventLib as a dependency of the project. But when I try to package MyGUI into a rar I get all of EventLib's dependencies, which I need, but I also get all of the maven plugin jar's in the package as well. I do have surefire setup as a dependency in EventLib but it's scope is set to 'test' so I'm not sure if thats causing the plugins to be added in or what.

I tried googling but theres too much other generic questions about excluding regular dependencies. What's the fix for this inside?

EDIT: Actually I know it is the surefire dependency causing the maven plugin's to generate in the package. I would have thought having it as 'test' scope would have left it out, guess I misunderstood the description for the scope.

EDit2: Fixed by setting the surefire dep. to optional but still wish there was a scope for test phase and test phase only, not test and execution phase.

Kenishi fucked around with this message at 07:47 on May 5, 2014

Doctor w-rw-rw-
Jun 24, 2008
Your question probably belongs in the Java thread. Also, given that you are having a configuration issue, it's appropriate to give an example - any example - of your process and configuration that led you to the problem. How are you packaging? Are you using the shade plugin? What are your exclusions? Do you need to mark dependencies as optional?

Kenishi
Nov 18, 2010
Well I kind of solved it. I was making the assumption that if I needed to run JUnit tests before packing, then I needed to include surefire. But it turns out thats already included in as a plugin and theres no need to add it as a dependency.

I really wish there was a better source for learning Maven, the Apache site is massive and the doc/explanations are sometimes difficult to follow.

Doctor w-rw-rw-
Jun 24, 2008

Kenishi posted:

Well I kind of solved it. I was making the assumption that if I needed to run JUnit tests before packing, then I needed to include surefire. But it turns out thats already included in as a plugin and theres no need to add it as a dependency.

I really wish there was a better source for learning Maven, the Apache site is massive and the doc/explanations are sometimes difficult to follow.

Java thread. Go there. Ask questions and learn things. At the very least, someone should be able to point you I t he right direction.

Mr. Crow
May 22, 2008

Snap City mayor for life
I have a design/architecture patterns question, anyone have some patterns to recommend for creating a 'modular' application?

Without getting to specific, we have basically a core application, and then depending on the client, various modules that get installed on top of that. Historically everything was very segregated and all the 'modules' were for all intents and purposes separate applications, so the separations weren't leaky and everything was dandy.

We've been moving everything to a more standardized application lately, and things are starting to bleed into the core application (which is fine). Because of the way everything is laid out, it's currently a pain in the rear end to put logic in the core that 'knows' about our applets without creating an actual dependency (interfaces and inheritance, hoooo! but read on...).

Problem is (and I'm likely overthinking things), some of the logic that's bleeding through is basically having modules add additional buttons and UI elements to core forms that are shown; and some modules may be updating the same forms (I don't know if those modules would be installed at the same time though, lets assume not). I think the UI side of it is just screwing with me for some inexplicable reason, I dunno. Any ideas?

Something like the Flightweight Pattern seems appropriate here, except for the fact I guess that it's intended for huge amounts of objects. I dunno.

raminasi
Jan 25, 2005

a last drink with no ice
Flyweight is about minimizing the amount of heavy stuff you have to duplicate, so it's not really what you want.

"Pluggable" GUIs kind of suck. If there's a way for your core to isolate particular areas of the GUI that individual clients are allowed to play with, the clients can each provide their own first-class interface objects (e.g. in WPF clients could provide a UserControl via some interface they have to implement, or something). On the other hand, if you're actually trying to implement a complex interface system with a requirement that it decay gracefully if any one of its n pieces are missing, you've got some challenges ahead of you.

Pythagoras a trois
Feb 19, 2004

I have a lot of points to make and I will make them later.
Is TDD just a web dev thing, or is it something programmers do for all applications?

ultrafilter
Aug 23, 2007

It's okay if you have any questions.


It's something that programmers can do for many sorts of applications, and it's not limited to web development. It's probably one of the most underused methodologies out there.

Plorkyeran
Mar 22, 2007

To Escape The Shackles Of The Old Forums, We Must Reject The Tribal Negativity He Endorsed
TDD helps mitigate some of the downsides of dynamic typing so it's a bit more popular in areas where dynamically typed languages are common (such as web dev) but the benefits are not limited to that by any means.

ashgromnies
Jun 19, 2004
Does anyone know of a good resource on Linux system and application profiling? Something that goes over tools to analyze network, disk, CPU, memory, hard disk, etc. usage and tuning?

A book or web article or something?

Uziel
Jun 28, 2004

Ask me about losing 200lbs, and becoming the Viking God of W&W.
I have an app idea and I was curious if anything out there already solves this "problem". I travel often, and when traveling, chicken wings are my go to food.

I cannot easily find restaurants near a given city/zipcode for a given day that have chicken wings on special. I've looked into FourSquare, the Twitter API, Yelp and Urbanspoon but none of them provide this type of specific functionality. I realize that the devil is in the details, but I thought crowdsourced restaurant specials (taco tuesdays, $1 burger nights, etc) would be a great app and would also solve a problem I'm having.

JawnV6
Jul 4, 2004

So hot ...
Eat24's menu search handles specific foods like that really well. Just tried chicken wings locally and didn't see any false positives.

kedo
Nov 27, 2007

Uziel posted:

I have an app idea and I was curious if anything out there already solves this "problem". I travel often, and when traveling, chicken wings are my go to food.

I cannot easily find restaurants near a given city/zipcode for a given day that have chicken wings on special. I've looked into FourSquare, the Twitter API, Yelp and Urbanspoon but none of them provide this type of specific functionality. I realize that the devil is in the details, but I thought crowdsourced restaurant specials (taco tuesdays, $1 burger nights, etc) would be a great app and would also solve a problem I'm having.

You might be able to get that sort of data out of Locu's menu search api, but you'd need to be real crafty with how you'd search for it. I tried a combo of "wings" and "special" and of course ~90% of the results talk about "wings in our special sauce."

https://dev.locu.com/

Uziel
Jun 28, 2004

Ask me about losing 200lbs, and becoming the Viking God of W&W.

JawnV6 posted:

Eat24's menu search handles specific foods like that really well. Just tried chicken wings locally and didn't see any false positives.
I just tried that and while it returns chicken wings, I am more looking for places that have weekly specials on specified days like this:
http://www.livingpittsburgh.com/2009/09/wing-night-pittsburgh-wing-specials/

coffeetable
Feb 5, 2006

TELL ME AGAIN HOW GREAT BRITAIN WOULD BE IF IT WAS RULED BY THE MERCILESS JACKBOOT OF PRINCE CHARLES

YES I DO TALK TO PLANTS ACTUALLY
If you want to crowdsource it, a Twitter bot is probably your best bet. Scrape for mentions of "$(FOOD)" and "cheap" "special" "discount" etc.

DrankSinatra
Aug 25, 2011
I'm a bit curious about some of the arguments for pure functional programming. I really like functional programming a lot - it obviates a lot of nonsense and boilerplate you deal with in purely imperative programming. I've never really wrapped my head around the arguments for dogmatically pure functional programming.

I get the idea that if you have some mutable item, X, and x is used at point a and later at point c, x can be altered via some piece of code b in an unexpected way, altering the behavior of c. Even with functional programming with immutable objects, I feel like that problem still exists - it's just gone from being an explicitly temporal problem to an implicitly temporal problem of function composition.
E.G. if I compose functions a,b,c,d,e, and f, some idiot three cubicles down can alter function d in a subtle way, and I get the equivalent problem when I apply the composition of the functions to the immutable equivalent of X.

DrankSinatra fucked around with this message at 22:10 on May 7, 2014

coffeetable
Feb 5, 2006

TELL ME AGAIN HOW GREAT BRITAIN WOULD BE IF IT WAS RULED BY THE MERCILESS JACKBOOT OF PRINCE CHARLES

YES I DO TALK TO PLANTS ACTUALLY

DrankSinatra posted:

I'm a bit curious about some of the arguments for pure functional programming. I really like functional programming a lot - it obviates a lot of nonsense and boilerplate you deal with in purely imperative programming. I've never really wrapped my head around the arguments for dogmatically pure functional programming.

I get the idea that if you have some mutable item, X, and x is used at point a and later at point c, x can be altered via some piece of code b in an unexpected way, altering the behavior of c. Even with functional programming with immutable objects, I feel like that problem still exists - it's just gone from being an explicitly temporal problem to an implicitly temporal problem of function composition.
E.G. if I compose functions a,b,c,d,e, and f, some idiot three cubicles down can alter function d in a subtle way, and I get the equivalent problem when I apply the composition of the functions on the immutable equivalent of X.

Some idiot three cubicles down can alter d in a subtle way, but the consequences of that alteration must a) leave the function via its return and b) affect other functions via their arguments. Even if the change doesn't send your test suite's alarm bells ringing, when you notice the anomalous behaviour and investigate it's gonna be much easier to identify d as the culprit than if you mutable state flying all over the place.

coffeetable fucked around with this message at 22:18 on May 7, 2014

carry on then
Jul 10, 2010

by VideoGames

(and can't post for 10 years!)

Yeah, the problem you described is a source control problem that no programming language could every fix. The point is that yeah, X could be different for c if you changed b, but it would never be different if you left c and b alone but somehow changed Y, a completely unrelated item elsewhere. Calling (a(b(c(d(e Y))))) at some point before (a(b(c(d(e X))))) can never affect the meaning of the second statement if the program is sufficiently purely functional, because there is no mutable state, and none of the functions have been supplied with the value of Y/use the value of Y in their calculations, and you can see this because Y is never a parameter to these functions.

Adbot
ADBOT LOVES YOU

DrankSinatra
Aug 25, 2011

coffeetable posted:

Some idiot three cubicles down can alter d in a subtle way, but the consequences of that alteration must a) leave the function via its return and b) affect other functions via their arguments. Even if the change doesn't send your test suite's alarm bells ringing, when you notice the anomalous behaviour and investigate it's gonna be much easier to identify d as the culprit than if you mutable state flying all over the place.

In general, I agree, but if the data the function is applied to is say, some nightmare frankendata blob, that may not be the case. Admittedly that's the degenerate case, but I've seen that degenerate case frequently in production code using imperative programming. I'm wondering if it isn't just the case that functional programming [by virtue of comparative mathematical and formal sophistication] tends to attract developers who are more conscientious and thoughtful designers. I imagine there are low-to-average skill developers who could work some real nightmare magic with monads for example.

DrankSinatra fucked around with this message at 22:28 on May 7, 2014

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply