[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y ] [Home]
4chanarchives logo
/dpt/ - Daily Programming Thread
Images are sometimes not shown due to bandwidth/network limitations. Refreshing the page usually helps.

You are currently reading a thread in /g/ - Technology

Thread replies: 255
Thread images: 26
File: DPT.png (389 KB, 934x1000) Image search: [Google]
DPT.png
389 KB, 934x1000
Old thread: >>54531622

What are you working on /g/?
>>
>>54534082
LEGITIMATE THREAD
>>
>>54534082
Doing some Code Wars challenges in Python
>>
Hey /dpt/, what is the hardest hobby project you have ever written?
>>
>/g/ posters think extensible records are impossible
>>
>>54534088
THIS
>>
>>54534109
you're the one spamming

fuck off and die
>>
How do I convert a set of booleons to a binary and then to an integer in C?
>>
File: 1453653437430.jpg (192 KB, 891x605) Image search: [Google]
1453653437430.jpg
192 KB, 891x605
>>54534100
CHIP-8 emulator in C+SDL1 (no Image/Mixer)

Assembler and Compiler for custom chip8 language written in Python
>>
>>54534143
int foo = (bool3 << 2) | (bool2 << 1) | bool1;
>>
>>54534143
>to a binary
There's a binary type?
>to an integer
I'm assuming c99 since otherwise this isn't a question.
switch (boolean)
case true:
return 1;
case false:
return 0;
>>
>>54534143
>a set of booleans
>convert to an integer
What are you even talking about?
>>
>>54534163
int bool3 = 356;
Boom code broken.
>>
>>54534143
First of all, why do you need to do that?
>>
>>54534188
>using a 2^32-valued type to store a 2-valued type
Absolutely disgusting
>>
I'm terrible at doing output shit in Haskell, can someone help me?

Basically I have a list of pairs of strings :: [(String,String)] and I want to print in the following format:

String1
|= String2
String3
|= String4

etc. The above example would apply to a list [(String1, String2), (String3, String4)]
>>
I want to work in the space tech sector

What language would I need to learn? What's generally used for programming drones and satellites?
>>
>>54534213
Guess what! That's how it works in C and ~every language~.

stdbool is just an enum, which is syntactic sugar for ints anyway.
>>
>>54534188
are you fucking retarded

#include <stdbool.h>
>>
>>54534226
I dunno, when I write in C89 I tend to just use chars
>>
>>54534226
Go try shoving 356 into a boolean in Haskell.
>>
>>54534189
>>54534172
I want to use 8 buttons to input a number
>>
>>54534226
>even suggesting using int, a possible 32-bit data type, when char is considered a numerable and is 8-bit
Full retard
>>
>>54534226
>stdbool is just an enum
kid...
>>
Using crystal to solve some basic eulerproject problems.

I hope spoj will support Crystal someday though.
>>
>>54534253
Okay, so you want a map from button to {pressed, not pressed}. Not a set of booleans, which could only have 4 possible values.
>>
>>54534163
In C, what type do these bit-shifts coerce the value to? Not that it would matter to the guy's question considering it'll only be 1 or 0, but I am curious
>>
>>54534286
unsigned int, 99% sure, otherwise signed int
>>
>>54534222
Lots of different languages are used because it's hard or impossible to upgrade satellites.

The most important part of writing for space tech is to develop the ability to write immaculate fucking code. You can learn a language on the job.

>>54534247
Ints are either faster or the char is word aligned, meaning it's an int in terms of impact.

>>54534256
>he doesn't know about word alignment

>>54534252
Meme language that uses integer types behind the scene.

>>54534258
It's a very nice and fancy enum but it's still an enum.
>>
>>54534253
Then why not use the buttons to input to a string and then convert said string to an integer?
>>
File: mount stupid.jpg (23 KB, 600x338) Image search: [Google]
mount stupid.jpg
23 KB, 600x338
>>54534313
>>
>>54534253
Use a char data type

Each button will xor that value with a bit-shifted 1 value

Ex:
number in 8-bit: 10110010
press left-most button: 10110010 ^ 10000000 -> 00110010
press 3rd-button from the right: 00110010 ^ 00000100 -> 00110110
>>
>>54534313
Chars are 1/4 the size though

>>54534100

I wrote a vietnam war teaching simulator with an inbuilt 2d tactical turn based strategy game
>>
>>54534286
uchar maybe?
>>
>>54534321
And exactly what errors am I making?
>>
File: 1385669102599.png (872 KB, 624x658) Image search: [Google]
1385669102599.png
872 KB, 624x658
>get out of college with a BS in CS
>loved SQL
>wanna do database shit
>look up database entry level positions
>damn near everyone has 5+ work experience

am I just retarded when I search this shit on google? I type "entry level database positions" and linkedin, indeed, and monster come up with Amazon database positions requiring 5+ years of experience.

how do people get into databases? I wanna do Software Engineering and SQL shit but damn son all that work experience though.
>>
>>54534361
bools in C evaluate to 0 or 1, no other values

they're not enums
>>
>>54534371
you can get 5+ year experience jobs if you really know your shit. but maybe try to get a junior full stack job and spend all your extra time on db stuff.
>>
>>54534371
You do it alongsize something else

I do plenty SQL as a python/django dev
>>
>>54534313
>Lots of different languages are used because it's hard or impossible to upgrade satellites.

they should just use erlang, stupid spacedevs
>>
>>54534361
also chars and bools can be packed like in a struct or an array
>>
>>54534388
>they're not enums
nice meme
>>
>>54534394
>>54534392

so go for an entry software engineering positon? that should build my work experience and alongside it I work on SQL shit?

or should I aim for a software engineering position that has a qualification needing SQL?
>>
>>54534163
wouldn't that convert 1010 to one thousand ten instead of ten?
>>
>>54534434
no

if you're using based windows 7 open up calc.exe and set it to programmer mode and play around with it
>>
>>54534434
bit-shifts are bit-shifts ie they work in base 2, not 10
>>
>>54534429
I'd say entry level full-stack web dev, because as a web dev you get full access to a db (likely MySQL, maybe PostGres) and can copy it and fuck around with it all you like.
>>
>>54534143
would it be possible to just read the Boolean values into a char array of 0s and 1s and then loop through the char array and summing into an integer variable?
>>
>>54534486
no then you're just getting the count, so (1,0,1) would be indistinguishable from (0,1,1)
>>
>>54534475
>I'd say entry level full-stack web dev

see I have developed a website using PHP, MySQL and all the backend shit works fine but /wdg/ completely shit on my html.
>>
#include <stdio.h>
int main() {
printf("%i\n",sizeof(1==1));
}

On my system that's a 4.
>>
>>54534515
bootstrap homie

oh and JQuery
>>
>>54534503

well if the char array for the Boolean value is in order from the 0th position to nth then when looping through the char array you base the exponent on the iterator value.

so if you have (1,0,1) output would be:
2^0+0+2^2
and (0,1,1)
0+2^1+2^2
>>
>>54534533

I used bootstrap. I just suck at getting the html tags correct and have old code that when I first developed were good but are now archaic and need to be fixed.
>>
>>54534563
There are few html tags you need to use or remember when coming up with professional design, or actually, what specifically did they say was wrong?
>>
>>54534551
sure then it's equivalent to >>54534163 but more extensible to any number of bools since it's an array
>>
>>54534515
git gud
>>
>>54534462
>bit-shifts
is that what the << n does?
>>
>>54534577
He probably did his layout with tables. Or used cancerous tags. Or inlined his javascript or CSS.
>>
>>54534584

what I learned from /wdg/ is this:

plan like a motherfucker and git gud at tags felt like shit after /wdg/ basically said my website will blow up any minute
>>
>>54534590
yes

<< is left shift, so (1 << 1) is 2 (10 in binary)

>> is right shift, so (2 >> 1) is 1
>>
>>54534590
Yes. Not to sound condescending, but what did you think it meant?
>>
File: 1416985037776.jpg (58 KB, 554x390) Image search: [Google]
1416985037776.jpg
58 KB, 554x390
>>54534608
>Or inlined his javascript or CSS

I did both. I am planning on fixing it but fuck me I am terrified of breaking it.
>>
>>54534631
copy it to a separate folder

if you fuck up, you still have the original code
>>
>>54534631
>I did both.
The fuck homie, it's 2016, what kinda tutorials are making you inline it?
>>
>>54534649
Fuck, this reminds me how much I hate W3Schools documentation and would rather see MDN. How do I force MDN to the top, without having to type mdn at the end of my searches?
>>
File: 1416939121047.gif (786 KB, 480x270) Image search: [Google]
1416939121047.gif
786 KB, 480x270
>>54534649
I just took a college course. much of it was on databases, MVC framework, Jquery, php, input validation, SQL injection, etc

there was stuff on good practice in HTML but I skipped that day and god damn I do regret it.
>>
>>54534163
can someone explain what this does?
>>
Who is this Jason everyones talking about?
>>
File: 1462455396748.jpg (109 KB, 1043x1600) Image search: [Google]
1462455396748.jpg
109 KB, 1043x1600
>>54534677
>there was stuff on good practice in HTML but I skipped that day

>>54534683
bool3 * 4
+ bool2 * 2
+ bool1 * 1

>>54534698
I've heard he structures your data nicely
>>
>>54534683
see >>54534620

| is bitwise OR, it's like a boolean OR but it applies to all bits, so like (1 | 1) is 1, (0 | 1) is 1
>>
Is it true that most programmers are actually qt traps?
>>
>>54534731
no kys
>>
>>54534731
xD epik /b/ro
>>
>>54534731
No it's not

But it is true that wearing a skirt and cute stockings increases your programming ability
>>
>>54534760
kys
>>
>>54534163
>>54534620
>>54534702
so the int starts as 00000000
if bool1 = 1 then the int is 00000001 =1
and if bool2 =2 then the int is 00000011 =3 and so on?
>>
>>54534779
don't knock it til you try it
>>
>>54534760
Can attest to this. My roommate in college who was the best programmer I knew there wore a skirt sometimes.
>>
>>54534798
i have and i don't see the point, they're comfy but it gets old fast, you get used to it

rubbing lingerie against your dick to jerk off is another story
>>
>>54534795
Yes
<< is a bit shift
1 << 2 turns
0000 0001
into
0000 0100 (see the 1 is shifted left twice)

| is a bitwise OR. Since everything is initialized at 0, your final number is comprised of all your bit-shifted 1s, ie
(1<<5) | (1<<3) | (1<<2)
is
00101100
>>
>>54534795
bools (from stdbool.h) only evaluate to 0 or 1

if bool1 = 1 and bool2 = 1 then (bool2 << 1) is 2, and the int becomes 3 because (00000010 | 00000001 = 00000011)
>>
>>54534816
Same, went to a silicon valley conference and they provided cute frilly skirts during the creative programming hours

>>54534822
It's useful for that too
>>
>>54534841
thanks senpai

[spoiler]thought << was a comparison and | was an appendage[/spoiler]
>>
>>54534908
>appendage
uwotfam?
>>
File: 1461005231404.jpg (687 KB, 826x1167) Image search: [Google]
1461005231404.jpg
687 KB, 826x1167
http://learnyouahaskell.com/chapters
Y/N?
If no, rec a better resource
>>
>>54534923
like 1 | 2 = 12

i thought that was the proper term
>>
>>54534939
https://docs.oracle.com/javase/tutorial/
>>
>>54534943
Concatenation, which is usually not done with |
>>
>>54534968
Good joke
>>
>>54534968
nice meme
>>
>>54534216
mapM_ (\(f, s) -> putStrLn f >> putStr "|= " >> putStrLn s) [("test", "output"), ("Please", "respond")]
>>
>>54534939
The people here are dunces, mate.
>>
>>54535159
including the hasklelers
>>
File: FirekeeperWP.jpg (525 KB, 2560x1440) Image search: [Google]
FirekeeperWP.jpg
525 KB, 2560x1440
>>54535159
But they're my dunces
>>
>>54535256
Haskellers are at least not content to wallow in shit like most programmers.
>>
>>54534100
tiling window manager
>>
>>54534100
An LMC interpreter
>>
C# fags, I have a question: what are the best resources (books pref) about WPF?
>>
File: ImAccomplished.png (268 KB, 1800x1430) Image search: [Google]
ImAccomplished.png
268 KB, 1800x1430
This is what Ive been working on for the past few days. Im very proud that it worked out. Probably my favorite thing Ive ever made.
>>
>>54535672
Looks pretty good bro
>>
>>54535672
it's cool
I just use Tiled
>>
>>54535596
Which one? Neat.
>>
anybody made bots for Maplestory? Can you use the onscreen keyboard and post keys to it to bypass their security shit (since you aren't really sending anything to their .exe)
>>
>>54535692
Thanks :)
>>54535703
Never heard of it. After a quick google it looks pretty neat. What does it save files as?
>>
>>54535672
Must be slow as hell, my shitty game's levels are saved in binary data files :) but your game looks crisp, nice work
>>
does anyone here know of some way to "initialize" a shared library ?
like the first time it gets loaded it reads some config values, stores them somewhere, and can access that memory location every time it's loaded ?

i guess some mmap hackery would work, but has anyone ever tried something like that ?
>>
>>54535820
XML
but I just use Tiled libraries for whatever programming language I am using which do the work for me of parsing it. Then it exposes all the layers, objects, etc.
>>
>>54535793
well looks like you can :)

github.com/omgimanerd/python-maplestory-bot
>>
>>54535908
Originally before I made my level editor in JSON I tried in XML. GameMaker Studio has a bit of crappy support for JSON but none for XML and parsing it myself proved too difficult so thats why I switched. Tiled looks very nice but I like having the control of what I made for making it perfect for my needs. Thanks for the info, Ill be sure to check into it more if I need it for future projects.
>>
>>54535844
https://stackoverflow.com/questions/19373061/what-happens-to-global-and-static-variables-in-a-shared-library-when-it-is-dynam
>>
>>54535832
Reading a pure text file during startup is not significant. I store my game's data files in S-expressions.
>>
>>54536027
>at startup
Ah okay; my game reads the levels when they are loaded, rather than loading them all on launch
>>
>>54536042
I mean even then it's not going to be more than a handful of ms more. Loading the images and sounds will take drastically longer.
>>
>>54536067
true
Maybe it's because I'm a C fag that I can't imagine using text for data
>>
>>54536005
thats not really answering my question, or am i missing something ?
>>
What tools do ya'll use for refactoring?
>>
>>54536403

My brain, usually.
>>
>>54536611
>wangblows C# tripfag
>brain
>>
>>54536622

Alright, alright.. you've apprehended me. I haven't got a brain.
>>
File: tingtp.jpg (90 KB, 1200x876) Image search: [Google]
tingtp.jpg
90 KB, 1200x876
>>54536783
>>
>>54536801

Are you bloody rusing me, m8?
>>
>>54536817
:)
>>
File: Capture.png (75 KB, 895x917) Image search: [Google]
Capture.png
75 KB, 895x917
Making a video game, of course.

It's gone pretty well so far, the fun part was figuring out and implementing the data structure (quadtrees) for objects in the game. At first I wrapped the state in a struct containing the player, obstacles, a turret, and a quadtree but now I'm going to have to refactor the entire module and use a quadtree directly as the main data structure to be passed around. It's too inconvenient to pass around the whole game-struct and destructure it to insert entities into the quadtree, especially now that I'm implementing the turret's ability to fire projectiles at the player.

Previously, I'd have to update the turret's rotation to aim at the player, update it's field containing projectiles with the new projectile, and then insert all existing projectiles into the quadtree and pass both the turret structure and the new quadtree structure back up to its calling function, where the quadtree is updated again with the player's position (and then stepped through to check for collisions in appropriate quads). I think it'll just be easier to make the quad the main data structure, because then I can just step through it once, updating and checking as I go along.
>>
>>54536611
You're an idiot.

>>54536936
>[]
Dude spell-expressions of the square sort have at most half the power.

But what sort of game is this? Is it a turn based game? What's the user interface? Command line? 2D grafix + mouse driven?
>>
I'm currently trying to learn arm7 assembly, and PPC geco/broadway assembly. Go ahead and call me crazy, but what I want to do requires it. If anyone else is as crazy as me and is willing to share resources, let me know.

Now on to why... I want to make home brew gba and wii games. I already have ideas, and am already designing and writing the story for my game. No, I won't give more details here.
>>
>>54537204
But why? Can't you use a C compiler?
>>
>>54537204
top cringe
>>
>>54537204
>I already have ideas, and am already designing and writing the story for my game. No, I won't give more details here.

Let me guess, it's a pokemon spinoff except you have sex with the pokemon instead.
>>
File: pokemon.gif (23 KB, 275x300) Image search: [Google]
pokemon.gif
23 KB, 275x300
>>54537312
You already want sex with pokemon though.
>>
>>54537262
No. The C compilers can't do everything I want to do
>>54537312
Actually my first game is a zelda spinoff timeline wise situated after windwaker in a more modern time technology wise. No more details though for you.
>>
File: Capture.png (117 KB, 876x882) Image search: [Google]
Capture.png
117 KB, 876x882
>>54537023
Real-time space-escape. You fly a spaceship around a 2D map with randomly dropped-in obstacles, which obscure your path and provide cover from a randomly placed instant-kill turret. Your goal is to get from the start of the map to the end-zone. It's not fancy, I originally planned it for the Lisp Game Jam but things happened and I couldn't get around to it. It's my first "real" project outside of textbooks and exercises. Still just keyboard controlled right now, but I think I know how to add in mouse-based movement/aiming since I figured out how to aim the turret towards the player (ended up implementing my own atan2 before realizing my language already has it, whoops).

I haven't coded in a UI. I did have a rudimentary one for a while that displayed the player's speed and coordinates, but reading and then rendering that information over the game slowed the whole thing down by a few seconds (...every tick), so I cut that out. Maybe I'll figure out reimplementing it later using the builtin GUI features. It was kind of tough figuring out how to implement scrolling. I landed on successively cropping a larger background in a square around the player, and shifting the x- and y-coords of the upper-left by an initial constant scaled by the player's distance from the center of the screen, which seems to work fine. It sounds more complicated than it turned out to be, but felt that complicated to work out. But now as you zoom around the screen the background scrolls faster the further away you are from the center, which is a nice effect.

pic related, please excuse the placeholder graphics.
>>
>>54536936
>>54537418
You got a github for that?
>>
What does "outparam" mean within the context of C structs?
>>
>>54537331

Oh wow.
>>
>>54536936
Nice theme, what is it?
>>
File: 1457999444834.jpg (66 KB, 958x764) Image search: [Google]
1457999444834.jpg
66 KB, 958x764
>>54537414
8/10 troll
top kek
>>
>>54536384
Oh I see what you are saying. A config shared across all uses of the library should really be done at compile time for that particular platform. If you need it to be configurable beyond once per system use a configuration file. Binary files are the easiest (just mmap a struct and reverse), but text files are easier on the user.

What exactly are you talking about?
>>
>>54535844
That's not even mmap hackery. That's like what mmap was intended for, man. You can just mmap to a file on the hard disk.
>>
>>54537467
Lol, its cute that you think I'm a troll.
>>
>>54534222
You need an engineering degree then you apply for an Internship at NASA if you maintain a certain GPA, there is no other way to touch mission sensitive software.

However you can work for SpaceX and Praxis or one of the many NASA contractors who still design mission critical software. To do that you want to learn safe programming, so essentially you want to take 6.005 at MIT which teaches you proper testing, where you write tests before even writing the actual function. http://web.mit.edu/6.005/www/sp16/classes/03-testing/

Another good course that does this (planning and writing tests before even programming) is HtDP
https://www.edx.org/course/how-code-systematic-program-design-part-ubcx-spd1x I would do the edx course first, then read through 6.005

After you can attend the 'space hackers' camp bullshit https://2016.spaceappschallenge.org/
>>
>>54537439
Darktooth, looks great except when I load ERC.

>>54537428
Yeah, I decided this would be a good opportunity to learn how to use git and started a git project, and now have it up on github.
https://github.com/interplinternet/boopo
>>
Thinking of a good way to capture variables, not sure if I want to add a pointer to every variable in the lang and a "captured_from_inline" flag or something, seems like the only option with how it's done

int main(void) {
int myvariable = 10;

saturn_init();

saturn_capture(myvariable, SATURN_INT);
saturn(5,
"int thing, 5",
"add myvariable, thing",
"out stdout, 'myvariable in inline saturn: '",
"out stdout, myvariable",
"out stdout, newline"
);

printf("myvariable in c: %d\n", myvariable);

saturn_quit();

return 0;
}

output:
myvariable in inline saturn: 15
myvariable in c: 10
>>
Hey /g/. No memes please. I'm going to school next year for computer science but have absolutely no knowledge of anything programming. I planned on learning a shit ton over the summer myself but I'm not sure where to begin. What language is best for beginners? What books would you recommend? What about online courses? Any help would be appreciated.
>>
>>54537414
ooh what a unique and valuable idea, good thing you didn't spill the beans
>>
>>54537938
sorry if this is the wrong place to post something like this
>>
>>54537938
C Primer Plus by Stephen Prata. It starts from the beginning and goes probably to the beginning of your first CS course (that isn't "intro to programming")
You wouldn't be able to finish it before late August unless you really went at it, but whatever you can get done will benefit you a ton.
>>
>>54537938
https://docs.oracle.com/javase/tutorial/

whatever you do, DO NOT go with python
>>
>>54537938
I used htdp to teach myself, I'd definitely recommend that. Very practical, but still theoretical enough to be informative. There's an edx course using that text if you want that, I just went through the whole book on my own though. It took a while.
>>
>>54537985
Should add that How to Design Programs uses lisp, but it's very easy and the lessons and design recipe ideas are language agnostic. It'll be a help regardless of what language you move on to and focuses on programming design and not language specific details.
>>
>>54537472
the thing is that i want the configuration to be re-loaded _only_ when necessary (meaning not every time the library gets loaded) because it would have an performance impact, but the configuration could change all the time.

probably some hackery with dlopen to keep it open, a function to trigger the configuration update and mmap would work, but that seems really ugly to me.
>>
>>54537948
That would just be the broad idea, actual details would be [spoiler] protected by copyright as design documents have been published [/spoiler] and I can't protect the broad idea, only the specific implementation of them.
>>
how is functional programming NOT pure mental masturbation?
>>
>>54538043
because of side effects
>>
how is object oriented programming NOT pure management masturbation?
>>
>>54537981
>>54537984
>>54537985
Thanks guys. Glad no one shitted on me. I'll look more into the links and books you posted.
>>
>>54537984
>Java
That's even worse.
>>
>>54534523
1==1 will return 1 and then you'll discover that in your system an int uses 4 bytes
>>
>>54538060
Well, the 2nd guy was massively shitting on in a way.
>>
>>54538060
It might be a good idea to look at the syllabus (if available online) for courses you're taking in the fall to see what language you'll be learning and learn it ahead of time

>>54538068
>worse
It's bad, but not worse
>>
>>54538055
>impllying there is only FP and OOP
long live Go.
>>
>>54534005
>>54534027
trap fag confirmed for samefag, confirms my suspicions that he was samefagging when there was an incredibly biased anon that defended the trap threads while bashing any other thread

he had his posts deleted so it's obvious which ones were him

also this shitty bait >>54531720 seems to be the trap fag

also he seems to speak spanish:
>>54532304
>>54532349

more samefagging, posts 1:01 apart:
>>54532370
>>54532385

seems to be a false flagger:
>>54532538
>>
whats the deal with people posting so much about traps and wearing skirts?
>>
>>54538084
How do you get Go from this? toppest fucking kek my man
>>
>>54538090
It's a horrible forced meme.
>>
>>54538068
>>54538071
>No memes please.
fuck you
>>
>>54538103
Are you implying that Java is not a meme?
>>
>>54538092
keep the best of all worlds, discard the bullshit, you get Go.
>>
>>54538100
this, and it's mostly the samefag trap fag, see >>54538088, i think he got banned so you probably won't see much fagging at all at least for a day or so
>>
>>54538113
heh
>>
>>54538130
>
>>
>>54538112
if by meme you mean popular and widespread then sure it's a meme

http://www.tiobe.com/tiobe_index
http://pypl.github.io/PYPL.html
>>
>>54538069
Yeah. That was my point. People in the thread didn't seem to understand that it's standard for boolean stuff in C to be ints.
>>
>>54538022
You can put the config in a shm space. That will keep it loaded as long as the OS hasn't been restarted. After the first instance of your library starts on boot and realizes the shm space isn't there is can instantiate the shm space.
>>
Is the haskellbook(.com) a good place to start learning haskell?
I just want anything that has a good return-on-time-investment if my goal is to learn haskell.
The closest I've been to anything related to funcional programming is C++ TMP.
>>
>>54538153
Thinking Functionally with Haskell
>>
>>54538140
Just because something is popular, it doesn't mean that it's good.
>>
>>54538145
now do sizeof(bool)
>>
>>54538158
example: C
>>
>>54538158
java is literally the best language though, java being bad is literally a decades-old epic meme that is not true any more, it's not slow or badly designed at all
>>
>>54538178
>Forced OOP
>Not the epitome of bad design
>>
>>54537981
Just to clarify, what edition did you mean? I'm assuming you mean the latest right?
>>
>>54538186
OOP is literally the only one good way to make large-scale applications

java is very well suited for its domain
>>
>>54538186
oop isnt inherently bad you memeboi cuck
>>
>>54538197
>>54538201
Fucking OOP memers
>>
>>54538192
Of course
>>
>>54538207
kys delusional idiot
>>
>>54538218
Don't you have a street to be shitting on, Pajeet?
>>
>>54537883

Oh shit, my saturnigger! You're doing things!
>>
>>54538224
nice sour grapes jackass, you're literally stupider than a pajeet
>>
>>54538217
I appreciate the help
>>
>>54538161
>using a new and unstable standard like c99
1
>>
>>54538238
>1999
>new
you probably hadn't even been born yet
>>
>>54538178
Java isn't even the best of its category. C# is better.
>>
File: 1461737108240.png (860 KB, 841x720) Image search: [Google]
1461737108240.png
860 KB, 841x720
>>54538238
>new and unstable
>17 years ago
>Deprecated by new standard
>>
>>54538263
keep believing that, idiot
>>
>>54538270
The previous thread involved some guy stating his boss forces him to use C89 because C99 is too new and a lot of compilers aren't mature enough.
>>
>>54538297
the fucking microsoft compiler maybe, not gcc
>>
http://infoq.com/news/2016/05/csharp7-pattern-matching-removed?utm_source=reddit&utm_medium=link&utm_campaign=external

Honestly they should just use F#
>>
>>54538297
For desktop, the only two relevant compilers, GCC and Clang, have C11 support and even default to them.
C99 probably hasn't 'matured' on whatever backwards-ass embedded system he is using, because nobody has even written or is interested in writing a compiler, because their C89 shit already werks.
>>
>>54538314
lmfao even Csharts are starting to realize that they're adding way too many retarded features
>>
>>54538336
Go has it right about their goal. No need to make it a functional language like others since the aim is about simplicity (type system, writing, reading, keywords, etc)

C# will be pretty much just F# in 5 years
>>
>>54538279
Kek. Nice argument. Let me know when Java has user-definable value types, operator overloading, delegates, constraints, or properties, and maybe I'll be inclined to think otherwise.
>>
>>54538336
Not him, but I was about to say that.
C# is so complex and big (for me) that not adding a feature is not a big deal.
>>
>>54538314
> the let keyword, supplying immutable var
Lmao
>>
>>54538372
>user-definable value types, operator overloading, delegates, constraints, or properties
those are all disgusting

see >>54538365

java is like a better go
>>
>>54538229
Heh, just bored while thinking of project ideas.

I added it just now by the way:
myvariable in inline saturn: 15
myvariable in c: 15

main() is the same
>>
>>54538387
Java is too complex to be a better go

A better go would just be a go with gc
>>
>>54538336
>lmfao csharts

fug u fug u fug u!!!
>>
>>54538401
>go with gc
So D?
>>
>>54538390
>Heh, just bored while thinking of project ideas.

That's my problem. I've got nothing going on right now. Basically just fucking around and playing video games. :(
>>
>>5453841>>54538401

Meant without gc
>>
>>54538387

>those are all disgusting
Wew lad. I'll admit that operator overloading and properties are (fucking nice) syntactic sugar that not everyone will understand, but delegates are pretty damn important, and not having constraints in a language with generics is straight-up retarded. They go hand-in-hand.
>>
>>54538421
Learn some simple opencv that can detect anime images

After that part is done, you can detect anime images in a 4chan thread, get the md5, then filter future posts
>>
File: [tilting increases].png (27 KB, 500x500) Image search: [Google]
[tilting increases].png
27 KB, 500x500
>>54538432
>I'll admit that operator overloading and properties are (fucking nice) syntactic sugar that not everyone will understand
>>
>Every time I compile something in C# I get told that I'm using an outdated version of the compiler
>Decide to update Visual Studio, since attempts at updating .NET tell me I already have the latest .NET installed
>Visual Studio stuck on creating a goddamn system restore point. Literally not doing anything but doing its loading animation where it moves dots across the screen

There is nothing good about this IDE. Absolutely fuck all.
>>
>>54538460
Cuck#
>>
>>54538460
You always seem to have problems
>>
>>54538450

I already have some ideas on deck. I'm just too much of a lazy sack of shit to actually start working.

No drive to do it right now since the semester just ended. Need to wind down a little bit.
>>
>>54538451
What's your argument against them? Are you seriously in the "operator overloading is bad because it can be bad if people use it in retarded ways" camp? I'm more of the belief that it's insulting for a language to assume its users are retarded.
>>
File: 1456007784488.gif (18 KB, 340x340) Image search: [Google]
1456007784488.gif
18 KB, 340x340
>>54538460
>Wincucks
>>
>>54538460
Use core clr with the dotnet cli tool
>>
>>54538460
>There is nothing good about this IDE. Absolutely fuck all.

When it works, it's the GOAT, though.
>>
>>54538490
methods are fucking enough. you don't need both methods and operator overloading. it's fucking nice to be able to look at any code in any context and know exactly what the operators are doing, and not having random operators being applied to fucking objects or simply accessing a field invisibly mutating state.
>>
>>54538514
>invisibly mutating state
That is literally all OOP does though.
>>
>>54538533
with a method call you know what you're getting. when accessing a field you know what you're getting. retarded C# properties are methods disguised as fields.
>>
hey fags, since you are already talking about it...
how do I install the core clr on linux? I'm starting to learn C# and I have no clue how to install the compiler/env on linux, but idgaf about running it on windows.
>>
>>54538514
Nobody in their right mind uses them that way. You should be able to add, for example, two 3D vector types together with a + operator, and there's no question as to what's happening there. Christ, without them, they might as well not define arithmetic operators for primitives, just .Add()/.Subtract()/etc methods, but that would be retarded, wouldn't it?
>>
>>54538564
>C#
>linux
and i'm the memer...
>>
>>54538549
Except you know that properties are actually methods, so you do know what you're getting into you dunce.
>>
Does anyone know how to fix this properly?
http://stackoverflow.com/questions/12672193/fixed-position-command-prompt-in-node-js

I have the same problem as that guy but the solutions posted don't solve it for me, the prompt gets hidden because i'm logging so much shit
>>
>>54538564
Google .net core clr Linux
It should bring you to the website
>>
>>54538577
I want to learn C# to make some apps, idgaf about windows. what's the problem?
also, how is this a meme? quite the contrary.
>>
>>54538603
well not exactly the same, I want the prompt on at all times, not just ask a question
>>
File: 1461385377717.png (220 KB, 403x430) Image search: [Google]
1461385377717.png
220 KB, 403x430
>>54538618
>not using swift to make linux apps
>>
>>54538574
>Christ, without them, they might as well not define arithmetic operators for primitives, just .Add()/.Subtract()/etc methods
That's actually a much more sane approach, and guess what? Lisp has been doing it, likely since before your were born.
>>
>>54538634
>apple cuck calling other people "memers"
holy fuck
>>
>>54538648
>lisp doesn't have operators for primitives
???
+?
Not to mention Lisp allows you to overwrite + to extend it to vector addition.
>>
>>54538492

Honestly, I'm planning on switching back to Linux in the summer. Windows is a terrible development environment, even for .NET. I think what I'll do from now on is I'll write multiplatform software on Linux and test with mingw-w64 + Wine.

>>54538564

On Ubuntu (or maybe any Debian based distro; not sure), Microsoft apparently has a repo for it:

https://dotnet.github.io/getting-started/#/linux

Otherwise, build it from source

https://github.com/dotnet/coreclr/blob/master/Documentation/building/linux-instructions.md

You'll also need to get CoreFX and the Roslyn Compilers to have a full .NET environment. You should be able to find instructions on their respective repositories.

https://github.com/dotnet/roslyn
https://github.com/dotnet/corefx
>>
>>54538648
>That's actually a much more sane approach
The fuck it is. Those operators exist for a reason, and existed long before computers, let alone fucking Lisp.
>>
>>54538680
I bet you don't even use emojis as your identifiers. Faggot
>>
>>54538688
He's a fucking faggot. Lisp has operators. It's not some awful language where everything is a method of an object. Fuck most lisps don't have objects.
>>
>>54538618
>apps
>>
>>54538688
>>54538733
I thought his point was that they weren't operators, but just plain functions.
>>
>>54538742
that's the contraction for applications, yeah. problem?
>>
>>54538682

our relationship is over because of this.
>>
>>54538763
abbreviation
>>
>>54538748
What? Operators are plain functions. The difference is that in many lisps you can overwrite whatever function you want.

Infix functions are still plain functions and some language allow you to define your own, like haskell.
>>
>>54538768

Because I'm switching back to Linux or because I'm showing people how to into C# on Linux?

Also, what relationship?
>>
>>54538681
Lisp doesn't give syntactic privilege to arithmetic, + is a function like anything else. The issue is with pouting your parser, particularly if you enforce order of operations, with arithmetic when a far simpler, more elegant approach exists in prefix notation. If a given function needs to make lower level calls than another it doesn't matter, that's opaque to you.
>>
>>54538818
>Also, what relationship?
#SHOTSFIRED
>>
>>54538648
>>54538681
Lisp used to have separate operators like + and +$ for different numeric types.
>>
>>54538932
Some still do for writing speedy code.
>http://api.call-cc.org/doc/library/fx%2B
>>
>>54538818
>Also, what relationship?

u son of a bitch
>>
>>54538961
he doesn't like anarcho-statists
>>
File: 1451683513443.gif (2 MB, 400x225) Image search: [Google]
1451683513443.gif
2 MB, 400x225
>>54538682
>Windows is a terrible development environment, even for .NET.
Wholeheartedly agree. Even OS X is better imho (in my honest opinion)

Bash/Ubuntu was going to win me over, but
- it's way too slow on Win10
- apt won't properly uninstall packages meaning you can't re-install shit as needed (well you don't need apt, but it's a huge convenience)
- cannot detect your environment variables properly, have to use Git-Bash to use git and a working bash (but git-bash does not have all the commands you want like whereis)
- you're still working in windows file system/ecosystem

Not to mention, Win10 doesn't have some of the better dev tools out there, like SequelPro for Mac if you use MySQL, takes 20 minutes to tell you an update is done resetting some settings upon doing so, and is still decades behind when it comes to installing software.

Oh btw, CLion is a fantastic C IDE for anyone who uses C
Thread replies: 255
Thread images: 26

banner
banner
[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y] [Home]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
If a post contains personal/copyrighted/illegal content you can contact me at [email protected] with that post and thread number and it will be removed as soon as possible.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com, send takedown notices to them.
This is a 4chan archive - all of the content originated from them. If you need IP information for a Poster - you need to contact them. This website shows only archived content.