Inflicting Haskell on N00bs for Science
-
Can we come up with a name for println/echo that an unfamiliar person would understand?
Progress uses
display
.
-
simply because it would not be wrong to rename foldr to AbstractAggregatorFactory
That would be definitely wrong. It would not compile.
AbstractAggregatorFactory
is a type identifier,foldr
is a value (well, function; everything is a function, even functions) identifier.
-
First Jeff is making the assumption that the three weeks of training provided where worth the shit that finds its way onto my shoes while walking through this shit-landmine-field in the original article.
> How to Use You're and Your
Oh, the irony....
-
for println/echo
C#
Console.WriteLine("heh");
(System could be prepended )
Seems more intuitive to me at least. It's obviously about writing something, unlike echo. Does not imply writing to paper (commonly : printing).
-
My permanent roommate understood neither... Had no idea what so ever.
-
Does not imply writing to paper
Relies on being able to work out what the Console is. Why would you be trying to write a line on my Playstation?
-
I didn't claim it was perfectly clear, just more opaque.
-
someone wants to be a programmer, but waits until college to let a class expose the art.
Um.... that's not how a discipline works.
If you haven't shown enough interest by the time you reach college to know what "assignment" is, then you don't need to be in a programming degree.
I dislike that attitude.
-
Both the syntaxes must have been pretty cryptic for him. He didn't seem to understand that the curlys indicate scope and that the block would be repeated. Recognizing function application is right out.
While in the shower this morning I articulated a reason why I don't like what my brain thinks of as typical Haskell code, which the
foldr
example illustrates nicely:foldr (+) 0 [1..10]
It is very lacking in structure, which style I feel offended by or allergic to. It feels like unconnected things being shoved together and triggers a bit of CDO, I guess. Dammit, I want parenthesis. Or commas. Or brackets. Keywords! Anything but ambiguous white space!
Reading code like this just feels...discordant.
-
If it makes you feel happier, you can save
foldr (+) 0
with the namesum
. That's exactly what it is.let sum = foldr (+) 0
-
I doubt it would make me much happier. You still have that other stuff. And now it seems like there's still going to be some magic bullshit hanging off the end of
sum
. You're just smearing the chaos around a bit.This is just a more extreme version of my reaction to, say,
if
statements that don't use braces.
-
Then switch to a LISP(-like) language!
(foldr + 0 (range 1 11))
-
-
Dammit, I want parenthesis. Or commas. Or brackets. Keywords! Anything but ambiguous white space!
I have the same problem with Python and BASIC-like syntax. And SQL up to a point, but I don't write SQL insane enough to be annoyed at it too much.
-
If you're writing SQL in ways that mean you want braces and stuff, then you're Doing It Wrong™
BASIC-likes aren't too bad; they have keywords to denote blocks, so don't need braces and such. Python is the one I don't get though; the way it puts so much importance on whitespace just strikes me as a myriad problems just waiting to happen.
-
If you're writing SQL in ways that mean you want braces and stuff, then you're Doing It Wrong™
Stored procedures are no longer a thing then?
-
BEGIN --code END
-
If you're writing SQL in ways that mean you want braces and stuff, then you're Doing It Wrong
CREATE PROCEDURE thing AS BEGIN IF something BEGIN BEGIN TRY -- do some things END TRY BEGIN CATCH -- deal with the error END CATCH END END
It can get a bit nasty without too much fancy stuff
-
If you're writing SQL in ways that mean you want braces and stuff, then you're Doing It Wrong™
https://github.com/SockDrawer/SockBot/blob/master/sock_modules/stats.yml#L65
https://github.com/SockDrawer/SockBot/blob/master/sock_modules/stats.yml#L329
-
And SQL up to a point, but I don't write SQL insane enough to be annoyed at it too much.
SQL doesn't bother me. It uses things like commas and keywords. SPROC languages tend to use semicolons and other structure (as already noted).
I'm not a fan of pythong's<yes, that was intentional, jerk> meaningful whitespace, but at least it's something.
-
And there are no braces in those queries
-
-
pythong
I feel tempted to Google for that, if just to make certain people here happy.
-
What happens when the magic uuid is oneboxed?
-
It's not part of the raw, so shouldn't affect anything ;)
-
-
http://www.cafepress.com/nuthole.70630906
Here it is.
-
Shirley it must be stored somewhere in the db?
-
In the cooked maybe, but the raw will only have the URL that is oneboxed
-
I am now sorry I clicked that link. I expected something funny perhaps but... WHY?
-
So you can advertise your geek credentials on an Australian beach, obviously
-
Is that a python in your pants or are you just happy to see me?
-
If it needs labelling in order to be identified, it's not much of a python.
-
-
-
Hmmm...
The UUID is in cooked, but not raw, and it's raw that's examined in the queries.
postgres@what:~$ psql -d discourse -c "select raw from posts where topic_id=48592 and post_number=69" raw -------------------------------------------------------------------------------------------------- @RaceProUK <a href="/t/via-quote/48592/65">said</a>:<blockquote>+ If you're writing SQL in ways that mean you want braces and stuff, then you're Doing It Wrong™+</blockquote> + + + https://github.com/SockDrawer/SockBot/blob/master/sock_modules/stats.yml#L65 + + ­ + + https://github.com/SockDrawer/SockBot/blob/master/sock_modules/stats.yml#L329 (1 row)
postgres@what:~$ psql -d discourse -c "select cooked from posts where topic_id=48592 and post_number=69" | cat cooked ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- <aside class="quote" data-post="65" data-topic="48592"><div class="title"> + <div class="quote-controls"></div> + <img alt="" width="20" height="20" src="//what.thedailywtf.com/user_avatar/what.thedailywtf.com/raceprouk/40/21463.png" class="avatar">RaceProUK:</div> + <blockquote><p>If you're writing SQL in ways that mean you want braces and stuff, then you're Doing It Wrong™</p></blockquote></aside> + + <aside class="onebox githubblob"> + <header class="source"> + <a href="https://github.com/SockDrawer/SockBot/blob/master/sock_modules/stats.yml#L65"> + github.com + </a> + </header> + <article class="onebox-body"> + <h4><a href="https://github.com/SockDrawer/SockBot/blob/master/sock_modules/stats.yml#L65" target="_blank">SockDrawer/SockBot/blob/master/sock_modules/stats.yml#L65</a></h4> + <pre class="onebox"><code class="lang-yml"><ol class="start lines" start="55" style="counter-reset: li-counter 54 ;"> + <li> u.username ILIKE $1::varchar</li> + <li> ORDER BY u.id ASC, S.visited_at DESC</li> + <li> LIMIT $2::int</li> + <li>name: Attendance</li> + <li>config:</li> + <li> trust_level: 1</li> + <li> defaults:</li> + <li> 1: ['%username%', 25]</li> + <li> 4: ['%username%', 50]</li> + <li>- query: |</li> + <li class="selected"> WITH exclusions AS ( /* Which categories to exclude from counters */</li> + <li> SELECT user_id, id, topic_id, post_number</li> + <li> FROM posts</li> + <li> WHERE raw LIKE '%[deleted for obvious raisins%' AND</li> + <li> user_id IN (</li> + <li> SELECT gu.user_id</li> + <li> FROM group_users gu</li> + <li> WHERE group_id IN(</li> + <li> SELECT g.id</li> + <li> FROM groups g</li> + <li> WHERE g.name IN ('admins')</li> + </ol></code></pre> + + + </article> + <div style="clear: both"></div> + </aside> + + + <p></p> + + <aside class="onebox githubblob"> + <header class="source"> + <a href="https://github.com/SockDrawer/SockBot/blob/master/sock_modules/stats.yml#L329"> + github.com + </a> + </header> + <article class="onebox-body"> + <h4><a href="https://github.com/SockDrawer/SockBot/blob/master/sock_modules/stats.yml#L329" target="_blank">SockDrawer/SockBot/blob/master/sock_modules/stats.yml#L329</a></h4>+ <pre class="onebox"><code class="lang-yml"><ol class="start lines" start="319" style="counter-reset: li-counter 318 ;"> + <li> FROM group_users gu</li> + <li> WHERE group_id IN(</li> + <li> SELECT g.id</li> + <li> FROM groups g</li> + <li> WHERE g.name IN ('admins')</li> + <li> )</li> + <li> )</li> + <li>),</li> + <li>buckets AS ( SELECT</li> + <li> CASE </li> + <li class="selected"> WHEN ua.username ILIKE $1::varchar AND (</li> + <li> a.target_topic_id NOT IN ( SELECT topic_id FROM badge_posts GROUP BY topic_id HAVING count(topic_id) < 10 )</li> + <li> AND a.target_topic_id NOT IN ( SELECT topic_id FROM exclusions )</li> + <li> AND a.target_topic_id != 1000</li> + <li> AND NOT c.read_restricted)</li> + <li> THEN 1 ELSE 0 END AS liker_eligible, </li> + <li> CASE </li> + <li> WHEN ut.username ILIKE $1::varchar AND (</li> + <li> a.target_topic_id NOT IN ( SELECT topic_id FROM badge_posts GROUP BY topic_id HAVING count(topic_id) < 10 )</li> + <li> AND a.target_topic_id NOT IN ( SELECT topic_id FROM exclusions )</li> + <li> AND a.target_topic_id != 1000</li> + </ol></code></pre> + + + </article> + <div style="clear: both"></div> + </aside> + (1 row)
-
A one eyed trouser snake?
-
Please don't correct that!
Correct how? I wrote it exactly how I wanted to write it.
-
I got a quote notification for that
-
-
Don't visit http://www.pythong.org/. Really, don't.
Anyway, pythong isn't new. I know it's been mentioned in the old forums too.
-
-
Hah, I remember that guy.
-
It is very lacking in structure, which style I feel offended by or allergic to. It feels like unconnected things being shoved together and triggers a bit of CDO, I guess. Dammit, I want parenthesis. Or commas. Or brackets. Keywords! Anything but ambiguous white space!
Don't try Forth (or Factor which is a modern variant).
-
-
@antiquarian said:
Don't try Forth
It wasn't on today's todo list.
Putting it off until sometime early in July?
-
Standardized tests (SATs, GRE's, etc.) are often like this. So it's only worthwhile to guess if you can eliminate at least one answer.
-
"console" is pretty nasty jargon.
-
Python is the one I don't get though; the way it puts so much importance on whitespace just strikes me as a myriad problems just waiting to happen.
Most of which take a fair degree of silliness to trigger to begin with... ;)
About the only thing that actually makes a difference for non-silly cases (because mixing tabs and spaces for indentation should make you feel bad to begin with) is that you have to write
pass
for a null statement in Python, but that's not too far off having to shove a;
or{}
in there in C-style languages...
-
I'd make exceptions for people who were never exposed to it in such a way to know about it.
But 2 of the 3 highschools I attended had programming courses.
How can you say, "I want this to be my career, but I don't want to make any effort on my own to learn it".