Coding: Fleeting Thoughts

A place to discuss the implementation and style of computer programs.

Moderators: phlip, Moderators General, Prelates

User avatar
roband
Posts: 2545
Joined: Tue Sep 21, 2010 2:52 pm UTC
Location: UK

Re: Coding: Fleeting Thoughts

Postby roband » Thu May 15, 2014 10:28 am UTC

CSS3 is making me moist, despite barely knowing how to handle CSS2.

User avatar
ahammel
My Little Cabbage
Posts: 2135
Joined: Mon Jan 30, 2012 12:46 am UTC
Location: Vancouver BC
Contact:

Re: Coding: Fleeting Thoughts

Postby ahammel » Thu May 15, 2014 4:14 pm UTC

Nyktos wrote:
Jplus wrote:And Python, but that wasn't really designed with efficiency in mind anyway.
Well, actually...

Looks cool. Isn't Guido at Dropbox these days?
He/Him/His/Alex
God damn these electric sex pants!

Nyktos
Posts: 138
Joined: Mon Mar 02, 2009 4:02 pm UTC

Re: Coding: Fleeting Thoughts

Postby Nyktos » Fri May 16, 2014 3:05 am UTC

He is, but iirc he's not directly involved with Pyston.

User avatar
Xanthir
My HERO!!!
Posts: 5426
Joined: Tue Feb 20, 2007 12:49 am UTC
Location: The Googleplex
Contact:

Re: Coding: Fleeting Thoughts

Postby Xanthir » Fri May 16, 2014 7:39 am UTC

roband wrote:CSS3 is making me moist, despite barely knowing how to handle CSS2.

You're welcome, but remember about CSS version numbers.
(defun fibs (n &optional (a 1) (b 1)) (take n (unfold '+ a b)))

User avatar
Xeio
Friends, Faidites, Countrymen
Posts: 5101
Joined: Wed Jul 25, 2007 11:12 am UTC
Location: C:\Users\Xeio\
Contact:

Re: Coding: Fleeting Thoughts

Postby Xeio » Fri May 16, 2014 6:46 pm UTC

Code: Select all

int[] fields = new int[baseFields.Length + 2];
baseFields.CopyTo(fields, 0);
new int[] { 11555, 682 }.CopyTo(fields, baseFields.Length);
baseFields = fields;
Oh, good, someone decided to be clever and save space! Lists just waste so much memory.

User avatar
roband
Posts: 2545
Joined: Tue Sep 21, 2010 2:52 pm UTC
Location: UK

Re: Coding: Fleeting Thoughts

Postby roband » Mon May 19, 2014 9:23 am UTC

Xanthir wrote:
roband wrote:CSS3 is making me moist, despite barely knowing how to handle CSS2.

You're welcome, but remember about CSS version numbers.

That makes sense. But I suppose then my comment would have to have been..

The additions to CSS are making me moist, despite barely knowing how to handle CSS pre-additions. A bit wordy :P

User avatar
Xenomortis
Not actually a special flower.
Posts: 1456
Joined: Thu Oct 11, 2012 8:47 am UTC

Re: Coding: Fleeting Thoughts

Postby Xenomortis » Mon May 19, 2014 1:19 pm UTC

I'd heard of checked exceptions before I started programming Java.
I thought they sounded like a reasonable idea.
I now think I was wrong.
Image

Rysto
Posts: 1460
Joined: Wed Mar 21, 2007 4:07 am UTC

Re: Coding: Fleeting Thoughts

Postby Rysto » Mon May 19, 2014 2:36 pm UTC

IMO they can be used effectively, but the way that the Java APIs use them is completely wrong. Declaring that you throw something generic like "IOException" is useless to the caller. What, exactly, is the programmer supposed to do with that? On the other hand, throwing "FileNotFoundException" is useful because that is a specific error that the programmer can deal with. I've used checked exceptions sparingly in situations where I knew exactly what errors could occur and needed to force my callers to deal with them. But for the most part unchecked exceptions are definitely the way to go.

User avatar
You, sir, name?
Posts: 6983
Joined: Sun Apr 22, 2007 10:07 am UTC
Location: Chako Paul City
Contact:

Re: Coding: Fleeting Thoughts

Postby You, sir, name? » Mon May 19, 2014 4:31 pm UTC

Checked exceptions are good if you use them properly.

I like unchecked exceptions inside modules, and (sparsely) checked exceptions in external interfaces. And those are checked exceptions that shouldn't be re-thrown (except possibly as an unchecked one within the enclosing module; you get the picture).

Although it should be noted that exception use, and error handling in general is ridiculously domain specific. What's an incredibly powerful solution in one problem domain can be stupidly annoying in another.
I edit my posts a lot and sometimes the words wrong order words appear in sentences get messed up.

User avatar
NecklaceOfShadow
Posts: 775
Joined: Sun May 03, 2009 7:40 pm UTC
Location: In the alchemical aether
Contact:

Re: Coding: Fleeting Thoughts

Postby NecklaceOfShadow » Wed May 21, 2014 2:58 am UTC

Damn near half of the commits in the repository for my school code have come from this class' final project. 40 commits on this project, out of 84 total. I knew I'd been working on this a lot, but this put it in some perspective.
Significantly less weird than I used to be. Still pretty weird.

οὗτός ἐστιν Ἀγαμέμνων, ἐμὸς
πόσις, νεκρὸς δὲ τῆσδε δεξιᾶς χερός
ἔργον δικαίας τέκτονος. τάδ’ ὧδ’ ἔχει.

User avatar
Nautilus
Posts: 105
Joined: Thu Feb 25, 2010 1:19 am UTC
Location: That's a strange place to put a piano

Re: Coding: Fleeting Thoughts

Postby Nautilus » Wed May 21, 2014 3:12 am UTC

Numerical solutions are still symbolic. Just less so.
My flagella bring all the boys to the yard

User avatar
raudorn
Posts: 370
Joined: Mon Jun 13, 2011 11:59 am UTC

Re: Coding: Fleeting Thoughts

Postby raudorn » Sun May 25, 2014 8:50 pm UTC

Not sure if this is the appropriate place for a rant, but it seems like it.

I'm supposed to be a programmer. But I'm starting to not feel like it at all. I know that experience is key, and experience can only be gathered with time. But that doesn't change, that I'm already at the point where I'm a "professional programmer", because someone pays me to make computers do stuff, and yet I still feel like I'm digging in a ridiculously wide sandbox and impressing my buddies with a square block of sand. Then I look around and see all these sandcastles. Most of them horrid and falling apart, some plain and generic and a select few beautiful and big.
It's not that I generally don't know how to make sandcastles, but only in the same way you know how to make a car. Actually making one is an entirely different matter. "Okay", I think, "then I just start small and build a sandhouse here and a sandtower there and someday I can make sandcastles too. What happens instead is, that at work I'm running around a shattered pipedream of a sandcastle, desperately patching things up, fixing holes in the walls, all the while trying to make dent in the pile of feature requests demands. And there are fourteen other guys doing the same. And the whole thing somewhat resembles a sandcastle, but only if you stay on the intended path and for the love of Elune, don't ever open a door labeled "Employees only".
"Doesn't matter" I continue, "I can simply build my own little, not overly ambitious thing in my free time and do whatever I please with it.". I usually say that before I get home after a workday, covered in muddy sand, grains stuck in my teeth and hair bleached by seawater. Then I dick around on this sandcastle complex commonly known as "internet" until it's time to sleep, because screw building sand thingies in my free time. "So then," I might say, "I should learn new things so I can get a job a better organized sandcastle building company". So I look around and see a certified Zend PHP-Developer walking by. You know, the kind real programmers make fun of. And I see that he knows more about Zend and PHP than I do, and I actually work with both at our sandcastle. Well, rats.
"Still," I argue, "there's only the way forward. I just have to find my path and move on it." That's the point, where I pop my dream bubble, throw the analogy out of the window, grab the narrator and cover them with four tons of sand, jellyfish, sea shells and plastic rings until they stop spouting idealistic nonsense. You might hear a muffled "imposter syndrome", "pomodoro", "freelancing", "open source", "incremental", "priviledged" or "patience" through the pile, but you can safely ignore that, it's just canned phrases.
[/rant]

Okay, maybe I just need to get out of web development as quickly as I can. I'm barely working for a year in web dev and I'm becoming jaded as fast as I can digest the stuff I'm seeing. The inner workings of the web put Cthulhu to shame and neatly solve the Fermi paradox as well, because it broadly communicates "INSANE APES HERE, DO NOT VISIT" across space. This isn't what programming is supposed be like. I spend most of the precious little "actual programming" time not working on algorithmic problems or designing clever data structures, but I spend it trying to make some crappy system behave properly. And I'm just a guy who fiddled around a bit and took a few classes and now pretends to be a programmer in a sandbox full of madmen.

User avatar
Xenomortis
Not actually a special flower.
Posts: 1456
Joined: Thu Oct 11, 2012 8:47 am UTC

Re: Coding: Fleeting Thoughts

Postby Xenomortis » Sun May 25, 2014 9:37 pm UTC

raudorn wrote:Okay, maybe I just need to get out of web development as quickly as I can. I'm barely working for a year in web dev and I'm becoming jaded as fast as I can digest the stuff I'm seeing.

My first job (and first real programming experience) was web development.
Honestly, I found quite unsatisfying. If you're finding the work unsatisfying or your colleagues frustrating, change employers.

raudorn wrote:I spend most of the precious little "actual programming" time not working on algorithmic problems or designing clever data structures, but I spend it trying to make some crappy system behave properly. And I'm just a guy who fiddled around a bit and took a few classes and now pretends to be a programmer in a sandbox full of madmen.

Only the most privileged get to work on interesting and technical of things frequently, but it comes up for most of us occasionally. The rest of it can be fairly mundane.
Honestly, this is something personal projects help a lot with; you get to do something different and interesting (and I personally use different programming languages at home to work).
Image

User avatar
Thesh
Made to Fuck Dinosaurs
Posts: 6598
Joined: Tue Jan 12, 2010 1:55 am UTC
Location: Colorado

Re: Coding: Fleeting Thoughts

Postby Thesh » Sun May 25, 2014 9:48 pm UTC

Look for a small company once you get some experience; they tend to have more room for creativity. I find myself spending my time doing the tedious crap at work, ad nauseam, then playing around with interesting projects at home to keep myself sane... although with every project there's an amount of tedious work, so I usually get distracted and find something else to work on. The end result is that I have a lot of half-completed interesting projects, but it doesn't really matter that they are never completed.
Summum ius, summa iniuria.

User avatar
raudorn
Posts: 370
Joined: Mon Jun 13, 2011 11:59 am UTC

Re: Coding: Fleeting Thoughts

Postby raudorn » Mon May 26, 2014 6:50 pm UTC

Thesh wrote:Look for a small company once you get some experience; they tend to have more room for creativity. I find myself spending my time doing the tedious crap at work, ad nauseam, then playing around with interesting projects at home to keep myself sane... although with every project there's an amount of tedious work, so I usually get distracted and find something else to work on. The end result is that I have a lot of half-completed interesting projects, but it doesn't really matter that they are never completed.


That's pretty much what I planned to do from the beginning. My thought was "Get a job now, then do interesting or beneficial stuff in my free time, rinse and repeat, become satisfied while still make proper money." My current main problem is, that I have naught but a drop of motivation left over after work. My work (luckily) isn't as tedious as it could be, but even so eight hours of mental work are taxing enough. That leaves the weekend, which turns my brain into full cannot-form-a-coherent-thought mode. Last weekend I opened a program from my projects folder, stared at it for a few minutes, then closed the editor again. I'm so dependent on extrinsic motivation, it's a miracle my heart continues beating without a daily reminder.

Well, to leave on a more upbeat note, just writing this down has helped, structured thoughts and all that. Thanks for listening, I suppose.

User avatar
You, sir, name?
Posts: 6983
Joined: Sun Apr 22, 2007 10:07 am UTC
Location: Chako Paul City
Contact:

Re: Coding: Fleeting Thoughts

Postby You, sir, name? » Mon May 26, 2014 7:21 pm UTC

I've luckily enough sort of managed to get a reputation of being The Wolf of computer programming at work. Means I get a lot of opportunities to challenge myself, and end up doing lots of greenfield stuff.
I edit my posts a lot and sometimes the words wrong order words appear in sentences get messed up.

User avatar
NecklaceOfShadow
Posts: 775
Joined: Sun May 03, 2009 7:40 pm UTC
Location: In the alchemical aether
Contact:

Re: Coding: Fleeting Thoughts

Postby NecklaceOfShadow » Mon Jun 02, 2014 2:18 pm UTC

I'm sure I knew how to at one point, but I've bloody forgotten. How do you do syntax highlighting on the fora? I know it's possible, but that's about all I know.
Significantly less weird than I used to be. Still pretty weird.

οὗτός ἐστιν Ἀγαμέμνων, ἐμὸς
πόσις, νεκρὸς δὲ τῆσδε δεξιᾶς χερός
ἔργον δικαίας τέκτονος. τάδ’ ὧδ’ ἔχει.

User avatar
ahammel
My Little Cabbage
Posts: 2135
Joined: Mon Jan 30, 2012 12:46 am UTC
Location: Vancouver BC
Contact:

Re: Coding: Fleeting Thoughts

Postby ahammel » Mon Jun 02, 2014 2:22 pm UTC

NecklaceOfShadow wrote:I'm sure I knew how to at one point, but I've bloody forgotten. How do you do syntax highlighting on the fora? I know it's possible, but that's about all I know.

[code=php]
He/Him/His/Alex
God damn these electric sex pants!

User avatar
NecklaceOfShadow
Posts: 775
Joined: Sun May 03, 2009 7:40 pm UTC
Location: In the alchemical aether
Contact:

Re: Coding: Fleeting Thoughts

Postby NecklaceOfShadow » Mon Jun 02, 2014 2:28 pm UTC

Trying [code=java] doesn't give any syntax highlighting, and the text box ate the sample code I was working with when I put [code=php]. Haven't tried other languages.
Significantly less weird than I used to be. Still pretty weird.

οὗτός ἐστιν Ἀγαμέμνων, ἐμὸς
πόσις, νεκρὸς δὲ τῆσδε δεξιᾶς χερός
ἔργον δικαίας τέκτονος. τάδ’ ὧδ’ ἔχει.

User avatar
Xenomortis
Not actually a special flower.
Posts: 1456
Joined: Thu Oct 11, 2012 8:47 am UTC

Re: Coding: Fleeting Thoughts

Postby Xenomortis » Mon Jun 02, 2014 2:35 pm UTC

It only works for php.
Fortunately, that's usually good enough for any C like language.
Image

Ubik
Posts: 1016
Joined: Thu Oct 18, 2007 3:43 pm UTC

Re: Coding: Fleeting Thoughts

Postby Ubik » Tue Jun 03, 2014 5:35 am UTC

Looks like Apple is contributing their share to the graphics API fragmentation.

Edit: That said, it would be somewhat curious to run as much of Apple's marketing texts through a Markov chaining program and see how the certain kind of language they use is reproduced.

Volcano99
Posts: 56
Joined: Wed Dec 16, 2009 10:10 pm UTC
Location: 350 km SW of The Castle

Re: Coding: Fleeting Thoughts

Postby Volcano99 » Tue Jun 03, 2014 8:40 am UTC

Ubik wrote:Edit: That said, it would be somewhat curious to run as much of Apple's marketing texts through a Markov chaining program and see how the certain kind of language they use is reproduced.


Point No. 1: Empathy
Apple should center its efforts on accomplishing its main goals, and eliminate all the best product, the most useful software etc.; if we present them in a creative, professional manner, we will be judged by the desired quality, the signals they convey.


I used http://thinkzone.wlonk.com/Gibber/GibGen.htm (at level 6) with some text from http://www.entrepreneur.com/blog/220603. Taking a larger, more recent sample text and running markov over words instead of characters should give superior results... Maybe we should get a Twitter account like https://twitter.com/markov_bible running.

Ubik
Posts: 1016
Joined: Thu Oct 18, 2007 3:43 pm UTC

Re: Coding: Fleeting Thoughts

Postby Ubik » Tue Jun 03, 2014 10:18 am UTC

Heh! I can recognize certain Appleness in that.

User avatar
ahammel
My Little Cabbage
Posts: 2135
Joined: Mon Jan 30, 2012 12:46 am UTC
Location: Vancouver BC
Contact:

Re: Coding: Fleeting Thoughts

Postby ahammel » Wed Jun 04, 2014 4:01 pm UTC

I'd like a unit test runner that keeps track of which tests result in the execution of which code paths; and then runs only tests that have changed since last time the suite was run or the tests whose code paths have changed.
He/Him/His/Alex
God damn these electric sex pants!

User avatar
headprogrammingczar
Posts: 3072
Joined: Mon Oct 22, 2007 5:28 pm UTC
Location: Beaming you up

Re: Coding: Fleeting Thoughts

Postby headprogrammingczar » Wed Jun 04, 2014 9:05 pm UTC

If anything is going to have that feature, it's a program coverage tool, not a plain unit test package.
<quintopia> You're not crazy. you're the goddamn headprogrammingspock!
<Weeks> You're the goddamn headprogrammingspock!
<Cheese> I love you

User avatar
Aaeriele
Posts: 2127
Joined: Tue Feb 23, 2010 3:30 am UTC
Location: San Francisco, CA

Re: Coding: Fleeting Thoughts

Postby Aaeriele » Thu Jun 05, 2014 6:59 am UTC

ahammel wrote:I'd like a unit test runner that keeps track of which tests result in the execution of which code paths; and then runs only tests that have changed since last time the suite was run or the tests whose code paths have changed.


If you're good about breaking your code up into logical units and separating those units out into separate files, you can get a close approximation of this by tying unit tests to the files they depend on.
Vaniver wrote:Harvard is a hedge fund that runs the most prestigious dating agency in the world, and incidentally employs famous scientists to do research.

afuzzyduck wrote:ITS MEANT TO BE FLUTTERSHY BUT I JUST SEE AAERIELE! CURSE YOU FORA!

User avatar
ahammel
My Little Cabbage
Posts: 2135
Joined: Mon Jan 30, 2012 12:46 am UTC
Location: Vancouver BC
Contact:

Re: Coding: Fleeting Thoughts

Postby ahammel » Thu Jun 05, 2014 1:37 pm UTC

Aaeriele wrote:
ahammel wrote:I'd like a unit test runner that keeps track of which tests result in the execution of which code paths; and then runs only tests that have changed since last time the suite was run or the tests whose code paths have changed.


If you're good about breaking your code up into logical units and separating those units out into separate files, you can get a close approximation of this by tying unit tests to the files they depend on.

That's a good point. And if you follow the convention that the tests for "file" go in "test_file" or something, you might be able to hack together a Makefile rule to do that.
He/Him/His/Alex
God damn these electric sex pants!

Volcano99
Posts: 56
Joined: Wed Dec 16, 2009 10:10 pm UTC
Location: 350 km SW of The Castle

Re: Coding: Fleeting Thoughts

Postby Volcano99 » Thu Jun 05, 2014 10:19 pm UTC

That's a good point. And if you follow the convention that the tests for "file" go in "test_file" or something, you might be able to hack together a Makefile rule to do that.

http://www.gnu.org/software/make/manual ... tern-Rules

Maybe something similar to this? I don't have any project of this kind to test :( If you have any Makefile-fu it shouldn't be hard!

Code: Select all

test: tests/test_%  # I'm pretty sure this doesn't glob correctly

tests/test_%: %.py
    run_test_for $< && touch $@ # Or pipe test results to said file

User avatar
Aaeriele
Posts: 2127
Joined: Tue Feb 23, 2010 3:30 am UTC
Location: San Francisco, CA

Re: Coding: Fleeting Thoughts

Postby Aaeriele » Fri Jun 06, 2014 7:54 pm UTC

ahammel wrote:
Aaeriele wrote:
ahammel wrote:I'd like a unit test runner that keeps track of which tests result in the execution of which code paths; and then runs only tests that have changed since last time the suite was run or the tests whose code paths have changed.


If you're good about breaking your code up into logical units and separating those units out into separate files, you can get a close approximation of this by tying unit tests to the files they depend on.

That's a good point. And if you follow the convention that the tests for "file" go in "test_file" or something, you might be able to hack together a Makefile rule to do that.


This is essentially the structure that one of the projects I work on (EVELink) uses - though we don't bother with only running subsets of tests; the EVELink tests run in under a second so it's simpler to just run the entire suite.
Vaniver wrote:Harvard is a hedge fund that runs the most prestigious dating agency in the world, and incidentally employs famous scientists to do research.

afuzzyduck wrote:ITS MEANT TO BE FLUTTERSHY BUT I JUST SEE AAERIELE! CURSE YOU FORA!

User avatar
Jplus
Posts: 1721
Joined: Wed Apr 21, 2010 12:29 pm UTC
Location: Netherlands

Re: Coding: Fleeting Thoughts

Postby Jplus » Sun Jun 08, 2014 9:45 pm UTC

Ubik wrote:Looks like Apple is contributing their share to the graphics API fragmentation.

Edit: That said, it would be somewhat curious to run as much of Apple's marketing texts through a Markov chaining program and see how the certain kind of language they use is reproduced.

A bit late, but a good opportunity for some red spider project promotion: the RSP has a simple Markov chain text randomizer that you can use on any plaintext. Just run "rshelp randomtext" while in rsshell.
"There are only two hard problems in computer science: cache coherence, naming things, and off-by-one errors." (Phil Karlton and Leon Bambrick)

coding and xkcd combined

(Julian/Julian's)

User avatar
Xenomortis
Not actually a special flower.
Posts: 1456
Joined: Thu Oct 11, 2012 8:47 am UTC

Re: Coding: Fleeting Thoughts

Postby Xenomortis » Wed Jun 11, 2014 10:57 am UTC

I've come to the conclusion that Python is too easy to write.
Spoiler:
Ok, I'm partly joking.
Image

elminster
Posts: 1560
Joined: Mon Feb 26, 2007 1:56 pm UTC
Location: London, UK, Dimensions 1 to 42.
Contact:

Re: Coding: Fleeting Thoughts

Postby elminster » Thu Jun 12, 2014 7:25 am UTC

After having not used it a while, I now remember how god damn good IDA pro and it's plugins are for disassembling, unpacking, reverse engineering, understanding, and 'decompiling' etc programs is. Naturally, it's way to expensive for amateur use (just over 1800 euros), but I would honestly pay something towards it if I used it more (If I could), but I'd definitely buy it if I used this professionally.
I was writing a tool to decrypt some game files (data shuffling/XORing/and reasonably basic security stuff), and there's absolutely no better way to really understand what a program is doing quickly than using IDA pro. I'm mediocre at reading/understanding compiled x86 asm (optimizations, etc make it harder to read) but this sped up what would have taken more than a week with others into 2 days.
Image

User avatar
You, sir, name?
Posts: 6983
Joined: Sun Apr 22, 2007 10:07 am UTC
Location: Chako Paul City
Contact:

Re: Coding: Fleeting Thoughts

Postby You, sir, name? » Fri Jun 13, 2014 11:30 pm UTC

How do Haskell applications deal with system state? I don't mean short snippets of code from academia, but actual, large applications.

I can sorta see how you'd be able to sort of lug it around in a monad, which seems to work for a small application, but let's say the application is very large? In terms of imperative programming, that seems a lot like keeping the system state in a bunch of global variables. Is there some way to project a facet of the larger system state into more manageable pieces?

I feel I may be missing some detail here...
I edit my posts a lot and sometimes the words wrong order words appear in sentences get messed up.

User avatar
NecklaceOfShadow
Posts: 775
Joined: Sun May 03, 2009 7:40 pm UTC
Location: In the alchemical aether
Contact:

Re: Coding: Fleeting Thoughts

Postby NecklaceOfShadow » Sat Jun 14, 2014 7:57 am UTC

I'm not sure if they're sufficiently large for you, but you might want to look at the source code for pandoc, the Markdown -> everything utility, or the source code for aura, one of the AUR helpers for Arch.
Significantly less weird than I used to be. Still pretty weird.

οὗτός ἐστιν Ἀγαμέμνων, ἐμὸς
πόσις, νεκρὸς δὲ τῆσδε δεξιᾶς χερός
ἔργον δικαίας τέκτονος. τάδ’ ὧδ’ ἔχει.

User avatar
Jplus
Posts: 1721
Joined: Wed Apr 21, 2010 12:29 pm UTC
Location: Netherlands

Re: Coding: Fleeting Thoughts

Postby Jplus » Sat Jun 14, 2014 9:59 am UTC

Or Xmonad, which obviously deals with system state.
"There are only two hard problems in computer science: cache coherence, naming things, and off-by-one errors." (Phil Karlton and Leon Bambrick)

coding and xkcd combined

(Julian/Julian's)

User avatar
headprogrammingczar
Posts: 3072
Joined: Mon Oct 22, 2007 5:28 pm UTC
Location: Beaming you up

Re: Coding: Fleeting Thoughts

Postby headprogrammingczar » Sat Jun 14, 2014 11:26 am UTC

You can always continue to use mutation - there's IORef, MVar, TVar, various types of Chans, and more that you can use in addition to pure state.
<quintopia> You're not crazy. you're the goddamn headprogrammingspock!
<Weeks> You're the goddamn headprogrammingspock!
<Cheese> I love you

User avatar
You, sir, name?
Posts: 6983
Joined: Sun Apr 22, 2007 10:07 am UTC
Location: Chako Paul City
Contact:

Re: Coding: Fleeting Thoughts

Postby You, sir, name? » Sat Jun 14, 2014 12:13 pm UTC

Thanks. I think I'm beginning to get a clearer picture now. I'm also starting to think I'm mentally approaching it from the wrong way (i.e. I'm asking myself how to write Java code in Haskell).

I've spent the afternoon reading various haskell code from existing projects. Very illuminating.
I edit my posts a lot and sometimes the words wrong order words appear in sentences get messed up.

User avatar
headprogrammingczar
Posts: 3072
Joined: Mon Oct 22, 2007 5:28 pm UTC
Location: Beaming you up

Re: Coding: Fleeting Thoughts

Postby headprogrammingczar » Sat Jun 14, 2014 7:00 pm UTC

Don't forget to read this one. wink wink
<quintopia> You're not crazy. you're the goddamn headprogrammingspock!
<Weeks> You're the goddamn headprogrammingspock!
<Cheese> I love you

DR6
Posts: 171
Joined: Thu Nov 01, 2012 1:44 pm UTC

Re: Coding: Fleeting Thoughts

Postby DR6 » Sat Jun 14, 2014 7:37 pm UTC

headprogrammingczar wrote:Don't forget to read this one. wink wink


Code: Select all

data Bool = TRUE | FALSE | FILE_NOT_FOUND deriving (Bounded, Enum, Eq, Ord, Read, Show)



Well, I guess that's not a bad way to start...

User avatar
phlip
Restorer of Worlds
Posts: 7573
Joined: Sat Sep 23, 2006 3:56 am UTC
Location: Australia
Contact:

Re: Coding: Fleeting Thoughts

Postby phlip » Sun Jun 15, 2014 1:34 pm UTC

DR6 wrote:Well, I guess that's not a bad way to start...

And this isn't a bad way to continue:

Code: Select all

> :t true
true :: Bool
> :t false
false :: GHC.Types.Bool

Code: Select all

enum ಠ_ಠ {°□°╰=1, °Д°╰, ಠ益ಠ╰};
void ┻━┻︵​╰(ಠ_ಠ ⚠) {exit((int)⚠);}
[he/him/his]


Return to “Coding”

Who is online

Users browsing this forum: No registered users and 4 guests