[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
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: 39
File: 1334682645405.jpg (475 KB, 1024x1076) Image search: [Google]
1334682645405.jpg
475 KB, 1024x1076
Previous /dpt/ at >>50756824

Actually get stuff done edition

What are you working on?
I'm currently looking up somethings for my networks homework. Done with Computer Graphics project for today.
>>
File: asmref2.png (117 KB, 1920x1080) Image search: [Google]
asmref2.png
117 KB, 1920x1080
Other than examples, what other sections should I add to my entries?
>>
>>50762733
checking out graphql from fb, seems pretty nifty
>>
>tfw not imaginative enough to think up of things to make
>>
Trying to figure out the best way to go about keeping one from calling an initialization function twice in a row without first calling the associated shutdown function in my dependent linear language

What I'm thinking is that the main function gives you a linear "system" handle as a parameter and requires you to return it, and this handle has a set of libraries in its type
Initializing library X adds X to the set in the system type and requires that it not be there beforehand, and shutting it down removes it

Sound sensible?
>>
File: 1425634768588.gif (486 KB, 475x347) Image search: [Google]
1425634768588.gif
486 KB, 475x347
>covariance
>contravariance

I just don't even care anymore
>>
>>50762793
why the fuck is it a c program, just write a manpage nigga
>>
use the trap thread plz
>>
>Recent CS grad
>Applied to be software development engineer at Amazon
>Fuck up at the end of phone technical interview

O-oh well. I guess I can keep working at this shitty startup that doesn't pay.
>>
File: 81bx0GJBVBL-600x600.jpg (73 KB, 600x600) Image search: [Google]
81bx0GJBVBL-600x600.jpg
73 KB, 600x600
>>50762793
that pretty much sums it up
>>
statement vs expression
>>
File: what.jpg (449 KB, 1537x851) Image search: [Google]
what.jpg
449 KB, 1537x851
how is this suppose to make any sense
>>
>>50762856
But anon, that's not going to improve my coding skills
>>
>>50762936
hi ANDREW
:)
>>
>>50762936
tell it where autoheader is? maybe it's looking in /usr/something
>>
>>50762936

Just let it go.
>>
>>50762998
hello
>>
>>50762936
gentoo
>>
>>50763009
>tell it where autoheader is? maybe it's looking in /usr/something

How the fuck do I do that?

>>50763010
But i need curl ;-;
>>
>>50762851
Assume that B is a subtype of A

You can get an A from both a container of As and a container of Bs, but you can only get a B from a container of Bs
For that operation, a container of Bs can be substituted for a container of As (following B --> A); that operation is covariant

You can put a B into both a container of As and a container of Bs, but you can only put an A into a container of As
For that operation, a container of As can be substituted for a container of Bs (the opposite of B --> A), that operation is contravariant
>>
What programming pet peeves do you have? Mine is when people convert numbers to strings to find digits.
>>
>>50763107
How are you supposed to do it then?
>>
>>50763107
when people use C++
>>
>>50763057
>How the fuck do I do that?
fuck me if I know. I have automake and autoconf installed and that autoheader is simply there in /usr/bin. How the hell did you install that?
Why do you peasants use mingw when you can just virtualize some linux distro?
>>
>>50763114
Modulo and floored division by 10.
int sumdigits(int n) {
int sum = 0;
for(; n; n/= 10)
sum += n % 10;
return sum;
}
>>
>>50763131
fuck this gay ass shit dude

HOW CAN AUTOHEADER NOT BE INSTALLED IF IT'S RIGHT NEXT TO AUTOCONF

that doesn't even make sense... either both would be installed or neither
>>
>>50762886
>>50762886
>C++

You guys are doing it wrong.
#include <iostream>
#include <string>

using namespace std;

bool no_go(const string& str, const string& delimiters = " _") {
string::size_type pos = str.find_first_of(delimiters, 0);
return pos == string::npos;
}

int main() {
std::string no_go1{"OP is a faggot"};
std::string no_go2{"OP_is_a_faggot"};
std::string good_2go{"OP.is.a.faggot"};

cout << std::boolalpha;

cout << "no_go1 : " << no_go(no_go1) << endl;
cout << "no_go2 : " << no_go(no_go2) << endl;
cout << "good_2go : " << no_go(good_2go) << endl;
}
>>
>>50763173
have you checked if it's in a different path?
have you tried uninstaling it and reinstaling it?
jokes on you for using the GANOO
>>
What is /g/'s opinion of F#, OCAML, or other similar functional languages?
>>
>>50762866
kill yourself faggot
>>
File: smartneko.webm (265 KB, 486x500) Image search: [Google]
smartneko.webm
265 KB, 486x500
Ask a programming literate anything.
>>
>>50763153
ugly
>>
>>50763233
i'm not a faggot, it's not gay if i'm dressed like a girl
>>
>>50763260
WAY faster and more efficient. It should be an idiom programmers are used to.
>>
>>50763267
post legs
>>
>>50763244
Text editors from best to worst
>Emacs
>Atom
>Sublime
>nano
...
>Vim
>>
>>50763215
>have you checked if it's in a different path?
It is in the same path
>have you tried uninstaling it and reinstaling it?
I will
>>
File: cover.jpg (51 KB, 400x579) Image search: [Google]
cover.jpg
51 KB, 400x579
>>50762733
Why is this book considered important? LISP sucks!
>>
>>50763244
Where do you get these cute gifs?
>>
>>50763278
Emacs + vim bindings > vim > Emacs
>>
>>50763217
I fucking hate ML syntax
>>
>>50763291
reddit
>>
>>50763217
Hybrid functional languages are just a trick to get procedural programmers to work with people who know better (i.e. people who would prefer functional languages like Haskell). OCaml's acceptable, but languages like F# and Scala are a disgrace. Haskell is better than Ocaml.
>>
>>50763310
too strong for you?
>>
File: wsg9.webm (265 KB, 486x500) Image search: [Google]
wsg9.webm
265 KB, 486x500
>>50763291
>>
>>50763340
No, I love functional programming, the purer and stronger typed the better

I just really dislike ML syntax compared to Miranda (Haskell, Agda) syntax
>>
>>50763338
Haskell makes my brain hurt. C and Python are all I need.
>>
File: d.jpg (864 KB, 1280x1707) Image search: [Google]
d.jpg
864 KB, 1280x1707
>>50763278
emacs > spacemacs > *

>>50763291
Internet
>>
>>50763369
That's fine by me. If you ever want a challenge or something to learn I strongly suggest it though. No reason to bother unless you want to learn it.
>>
>>50763282
>Why is this book considered important?
Because it teaches you very good practices about how to actually write code. Personally, I prefer HTDP
>LISP sucks!
that's your uneducated opinion and for which you didn't provide any evidence to back it up

>>50763379
like:
int a;
double b= 4.23;
a = b;

of course you can, but the floating part goes to shit
>>
>>50763282
https://www.cs.berkeley.edu/~bh/sicp.html
>>
>>50763187
>function named exactly backwards heh

#include <iostream>
#include <string>

using namespace std;

bool good_2_go(const string& str, const string& delimiters = " _") {
string::size_type pos = str.find_first_of(delimiters, 0);
return pos == string::npos;
}

int main() {
std::string nogo_1{"OP is a faggot"};
std::string nogo_2{"OP_is_a_faggot"};
std::string good_2go{"OP.is.a.faggot"};

cout << std::boolalpha;

cout << "nogo_1 : " << good_2_go(nogo_1) << endl;
cout << "nogo_2 : " << good_2_go(nogo_2) << endl;
cout << "good_2go : " << good_2_go(good_2go) << endl;
}
>>
>>50763244
So are those balls like tokens for the cat, so it can exchange them for food when it wants, but only a limited amount?
>>
>>50763460
Looks like it
>>
Trying to think of the best way to control my LED cube.
I'm intentionally not looking at other people's work since I want to do this myself.
I plan on doing a 7x7x7 but I'm starting off with a 3x3x3 just to get my control circuit figured out.
I'm using RGB common anode. I'm trying to decide if I want to have the cathode color leads controlled independently of the current sink logic and actually give varied colours for each individual LED, or if I should control the logic through the R G and B individually and just use multiplexing to give the illusion of mixed colours.
>>
>>50763460
>>50763473
http://benjaminmillam.com/cat-geek/monkey-the-cat-hunts-for-dinner/
>>
>>50763435
That's nice.
>>
>>50763460
yup. Even crows can do the same. Those fucking intelligent birds
https://www.youtube.com/watch?v=AVaITA7eBZE
>>
>>50763534
This is truly amazing.
>>
Reminder that C is obsolete and Go is the approved language for all new projects.
>>
>>50763543
Wow...
>>
>>50763662
/g/ approved?
>>
>>50763694
Yes, both /g/ and the entire professional programming community at large.
>>
>>50763662
>GC
Nah
>inb4 "it runs on a different thread so there's no runtime effect"
>>
>>50763662

B-but what about muh dlang?
>>
>>50763662
>Go is the approved language for all new projects.
said no one ever
>>
>>50762733
studying for a c++ midterm tomorrow, only doing from the intro to c++ to nested while loops, nothing crazy.
>>
>>50763662
>Go is the approved language
Kill yourself

>>50763694
No it's not. We've had this discussion with Gofags too many damn times and each time they get BTFO because it's a shitty language.
>>
File: Capture.jpg (30 KB, 465x368) Image search: [Google]
Capture.jpg
30 KB, 465x368
>>50763662
>import "fmt"
>Still have to write fmt.PrintLn
Dropped
>>
>>50763710
Dead. D had its chance and blew it.
>>
>>50763723
Go is a stupid language but this is a stupid complaint. You can easily import stuff into the namespace using:
import . "fmt"
>>
>>50763662
>Go

http://qr.ae/drvVS
http://qr.ae/drvm8
http://yager.io/programming/go.html
http://nomad.so/2015/03/why-gos-design-is-a-disservice-to-intelligent-programmers/
http://java.dzone.com/news/i-don%E2%80%99t-much-get-go
http://dtrace.org/blogs/wesolows/2014/12/29/golang-is-trash/
http://www.lessonsoffailure.com/software/google-go-not-getting-us-anywhere/
http://www.lessonsoffailure.com/software/googles-go-not-getting-us-anywhere-part-2/
http://www.lessonsoffailure.com/software/google-go-good-for-nothing/
https://gist.github.com/kachayev/21e7fe149bc5ae0bd878
>>
>>50763739

You take that back.. you.. you... double nigger!
>>
>>50763749
>other languages do it automatically
>have to add an extra period to import into namespace
My complaint is still valid
>>
I completed the Python track in Codeacademy /g/, tell me where to go next.
>>
>>50763739
d is far from being dead.
>>
Are there any good guides for learning how to write Linux kernel modules?
>>
>>50763662
Go sucks. C is well designed and clean. C is better than C++. C++ is too difficult.
>>
>>50763791
>c++ is too difficult

really? I mean I find it to be almost as easy as python.
>>
File: 1443418480630.jpg (81 KB, 707x682) Image search: [Google]
1443418480630.jpg
81 KB, 707x682
>>50763791
>C is well designed and clean.
>>
File: call-him-a-faggot.png (715 KB, 956x553) Image search: [Google]
call-him-a-faggot.png
715 KB, 956x553
>>50763770
>>
>>50763772
Actually thinking about it this isn't a bad complaint. Good compilers should implicitly detect what needs to be imported from the standard library and work as such. It's verbose and unnecessary for stuff to be imported when it's already there in the code. Then again, verbose and unnecessary is the definition of Go.
>>
>>50763782
If that's true, then how come the first letter of Dead is 'D'?
>>
>>50763773
I'd also like to know, I'm sort of in the same boat.

For now, what I've been doing is making little programs to challenge myself (basic movement on a text grid represented with X and 0, a basic RPG text combat engine that still needs a lot of work, etc).

I'm going through the HTML/CSS course right now, but that's a totally different animal.
>>
>>50763785
TLPI?
http://www.man7.org/tlpi/
>>
>>50763901
That opens precedents.
>>
>>50763791
> If you can't manage memory on your own you are stupid and get what you deserve.
> C++ is too complicated
>>
>>50763782
>abandoned by its creators
>not dead
pick one
>>
>>50763918
I'll check it out, thanks.
>>
>>50763933
hehe could be anon

>>50763959
nprb
>>
>>50763791
Go's a systems programming language though, unlike C++.
>>
File: D_Programming_Language.png (314 KB, 1280x970) Image search: [Google]
D_Programming_Language.png
314 KB, 1280x970
>>50763938
>abandoned by its creators
what the fuck are you talking about ? Andrei Alexandrescu left his job at facebook to create the D Foundation

http://forum.dlang.org/post/[email protected]
>>
>>50764015
Yeah, and then he immediately regretted it and offed himself.
>>
>>50764015
>http://forum.dlang.org/post/[email protected]
>I'm also glad to announce that the D Language Foundation already has a donor - I have decided to contribute my books' royalties to it.
Beautiful.
>>
File: 1440078011096.png (35 KB, 700x700) Image search: [Google]
1440078011096.png
35 KB, 700x700
>>50764001
>>
If Go's so great then why doesn't Richard Stallman use it?
>>
>>50764001
pls
>>
>>50764054
Stallman doesn't program, he just gives talks.
>>
>>50764045
>implying books royalties make D less shit
nigga please
>>
>>50764109
Where i said that ?
>>
>>50764097
Oh, I guess GNU just programmed itself then.

>this is what atheists actually believe
>>
>>50764128
GNU's just an acronym, there's no programming involved.
>>
>>50764128
But that anon is right, Stallman does not program anymore, he used to, but does not anymore, he stopped in early 90s or so, decade before Go existed even on paper.
>>
1/2

Guy Steele expresses similar admiration. Currently a research scientist for Sun Microsystems, he remembers Stallman primarily as a "brilliant programmer with the ability to generate large quantities of relatively bug-free code." Although their personalities didn't exactly mesh, Steele and Stallman collaborated long enough for Steele to get a glimpse of Stallman's intense coding style. He recalls a notable episode in the late 1970s when the two programmers banded together to write the editor's "pretty print" feature. Originally conceived by Steele, pretty print was another keystroke-triggerd feature that reformatted Emacs' source code so that it was both more readable and took up less space, further bolstering the program's WYSIWIG qualities. The feature was strategic enough to attract Stallman's active interest, and it wasn't long before Steele wrote that he and Stallman were planning an improved version.

"We sat down one morning," recalls Steele. "I was at the keyboard, and he was at my elbow," says Steele. "He was perfectly willing to let me type, but he was also telling me what to type.
>>
I've had a little experience with java in my classes but eventually switched to Python. I have a few interviews soon, should I try to relearn Java ASAP? Or pray they are fine with Python?
>>
>>50764175
2/2

The programming session lasted 10 hours. Throughout that entire time, Steele says, neither he nor Stallman took a break or made any small talk. By the end of the session, they had managed to hack the pretty print source code to just under 100 lines. "My fingers were on the keyboard the whole time," Steele recalls, "but it felt like both of our ideas were flowing onto the screen. He told me what to type, and I typed it."

The length of the session revealed itself when Steele finally left the AI Lab. Standing outside the building at 545 Tech Square, he was surprised to find himself surrounded by nighttime darkness. As a programmer, Steele was used to marathon coding sessions. Still, something about this session was different. Working with Stallman had forced Steele to block out all external stimuli and focus his entire mental energies on the task at hand. Looking back, Steele says he found the Stallman mind-meld both exhilarating and scary at the same time. "My first thought afterward was: it was a great experience, very intense, and that I never wanted to do it again in my life."
>>
>>50764164
How do you know? Do you watch everything that Richard Stallman does? He could be working on all kinds of projects for all you know.
>>
>>50764209
How could he be programming if he's too busy living in his car and eating foot skin?
>>
File: c.png (63 KB, 449x498) Image search: [Google]
c.png
63 KB, 449x498
>>50763933

Yeah, like C and.. hmm.. what's that word that everybody keeps saying?
>>
>>50764222
Well memed, my friend.
>>
>>50764209
I don't watch everything he does, I read everything he writes.

>My favorite programming languages are Lisp and C. However, since around 1992 I have worked mainly on free software activism, which means I am too busy to do much programming
>>
>>50764229
>Cuck nigger
Isn't that exactly what YOU are, you disgusting race-mixer?
>>
>>50764229
i kek'd irl
>>
>>50764232
What Richard Stallman calls "not much programming" is more programming than all of /dpt/ put together.
>>
>>50764245
>you disgusting race-mixer?

I don't think it's disgusting. I find it fulfilling.
>>
People working on important stuff and you still try to push your several fizzbuzz programs as hard work
http://www.wired.com/2015/10/major-advance-reveals-limits-computation/
>>
>>50764260
>fulfilling
GTP confirmed for taking BBC
>>
>>50764282
>Linking a wired article
I'm not opening that shit.
>>
>>50764250
I don't think so but even if we assume so, he dropped programming altogether in 2008.
>>
File: p1280037.jpg (1 MB, 3072x2304) Image search: [Google]
p1280037.jpg
1 MB, 3072x2304
>>50764222
stallman is a true programmer, wherever is he, he always stops and takes times to write some code.
>>
Name one reason why I shouldn't put all my talent points into C#
>>
>>50764301
Did you mean
>he always stops and takes time to reply to all the emails
>>
>>50764308
>my talent points
You don't have any talent, anon.
>>
>>50764301
>tfw you're trying to cross a rope bridge and you have to step over Richard Stallman

EVERY TIME
>>
>>50764308
Because nobody wants a hybrid in their group ;)
>>
>>50764286

Very funny, funny man.
>>
>>50762867
how bad did u fuck up? story?
>>
>>50763122
>Boohoo c++ is for faggots who dont appreciate high level languages
>>
>>50764308

Learn many languages, master a few. Pick whatever suits the majority of the work you're doing.

So if it's embedded, pick C or C++, desktop applications are fine in C#, Java, etc.
>>
File: mid_img_0632.jpg (120 KB, 675x900) Image search: [Google]
mid_img_0632.jpg
120 KB, 675x900
>>50764327
your battle station is your basement-bedroom. his battle station is the whole world.
>>
>>50764380
>So if it's embedded, pick C or C++
>or C++

I sense a series of shitposts coming.
This one included.
>>
>>50764385
stallman is peace-loving
>>
>>50764401

C-only embedded is over, anon. It's CURRENT_YEAR.
>>
>>50764385
That's because he doesn't have a bedroom smh fam
>>
>>50764401
you'll find that the kind of ``embedded systems'' C++ users use are literally PCs from ten years ago. whoop de do
>>
>>50762936
you are fucking retarded, windows won't execute linux program
I don't even know why I, or anyone, is still helping you... stop doing this shit, just kill yourself
btw, if you compile your shit with the gcc compiler in windows, it still won't work in other machines
as you've been yold many times already, go install visual studio, and stop being retarded, you fucking piece of shit

>>50763278
no. Vim > *
>>
>>50762733
Working on a GIF to PNG converter. Currently defining a struct for a PNG chunk which includes 4 4-byte words.
>>
>>50763338
they serve different purposes. also their feature sets are very different. haskell has things like type classes but lacks an ML-tier module system, for example.
>>
>>50763710
D sucker

>>50763662
this
>>
>>50764454
Type classes solve the same problem that ML's module system solved, kind of. ML's "solution" is less general.
>>
>>50762733
Programming a Tetris clone in Visual Basic 6.0 using DirectX 7.0
>>
>>50764490

[spoiler]secretly, I still enjoy toying with VB6[/spoiler]
>>
>>50763791
>C is well designed and clean
Let me guess. You're only pretending to be retarded?
>>
>>50764436
(fset '> '<)
(> ?v ?e)
nil
>>
>>50763791
>C is well designed and clean.
>>
>>50764509
What do you expect would happen?
>>
lisp
>>
File: it_held_so_much+potential.jpg (155 KB, 640x720) Image search: [Google]
it_held_so_much+potential.jpg
155 KB, 640x720
Python generators.

Are they anything but a really fast way to produce lists?

Why did this video series include them with object oriented programming?
>>
move semantics are the biggest load of shit i've ever witnessed

c++ tries to have its cake and eat it too as far as abstraction goes and it SUCKS
>>
Can anyone figure out why this code isn't working?

using System;

namespace encrypt
{
class MainClass
{
public static void Main(string[] args)
{
string input;
char[] character;
double i = 0;

try {
input = args[0];
} catch(Exception) {
return;
}

character = input.ToCharArray();

char[] encryption = {
'A',
'B',
'C',
'D',
'E',
'F',
'G',
'H',
'I',
'J',
'K',
'L',
'M',
'N',
'O',
'P',
'Q',
'R',
'S',
'T',
'U',
'V',
'W',
'X',
'Y',
'Z'
};

foreach(char chr in input) {
foreach(char item in encryption) {
i = char.GetNumericValue(item);
for(int j = 0; j < i; j++) {
for(int k = 0; k < input.Length; k++) {
char fuckvariablenamingschemes = character[k];
++fuckvariablenamingschemes;
character[k] = fuckvariablenamingschemes;
}
}
}
}
Console.Write(character);
}
}
}
>>
>>50764472
not at all. with implicits modules basically become type classes, but they can do a lot more as well, such as conventional module features:
- logical grouping of similar code
- improved compilation times
- easy drop-in replacements of old code
but also can do a lot of unique things:
- abstraction layers between different pieces of code
- version control between modules (as a language-level feature)
- solve problems in which OOP is generally used in a more purely functional way
- an extension framework (by accepting a certain module type and then using include you can extend a module and use it instead of the original with no side effects)
>>
>>50764529
Just that.
>>
File: asmref3.png (287 KB, 1920x1080) Image search: [Google]
asmref3.png
287 KB, 1920x1080
>Can't do multiline strings in JSON
>Have to make it an array
The worst
>>
>>50764562
The best way to produce lists is either through list comprehensions or generators, yes.
>>
>>50764575
what's wrong with them?

>>50764597
lmfao get a data entry job
>>
File: 1442512810784.jpg (224 KB, 488x484) Image search: [Google]
1442512810784.jpg
224 KB, 488x484
I have been writing comfy Go all day, every keypress fills my dpt tear glass.

How does it feel to not be on the one true Bell Labs extended lineage?
>>
>>50764597
shame, if you used racket and sexp with your own semantics you could use @-exp for that

oh well!
>>
File: computerman.jpg (13 KB, 400x226) Image search: [Google]
computerman.jpg
13 KB, 400x226
> tfw you work in infrastructure
> tfw every week involves yelling at people to fix their shit but they never do
> tfw I've become the build bitch for at least three teams, but they're never consistent about their build processes

Any office that doesn't regularly have devs build and deploy their own shit needs to be destroyed.
>>
>>50764642
>meme language
>>
>>50764634
>animu faggot
>bell labs lineage
you got that right
>>
I wanted to fuck around with oop and make a shitty platformer game. Is there anything better in python then pygame?

Are all the good graphics shit in c++?
>>
Is exception handling even used outside of like, opening files?
>>
>>50764634
>Bell Labs
mo' like lel labs, amirite?
>>
>>50764436
What is mingw? Are you only pretending to be retarded?
>>
>>50763710
>muh c++ alternative meme
>>
>>50764683
User input
>>
>>50764683
No, that's all it's good for.
>>
>>50764576
Seriously I have no idea why this isn't working.

When i call the program with the argument `abc` it should return `bdf` if I did my math properly (adding letters is difficult). But it doesn't, it just returns `abc`.
>>
>>50764683

From what I understand since you often write code that is used not by people but by other code exception become pretty important as a error handing method that can pass the method to other code all the way to the top.
>>
ITT: we develop the /g/ programming language

Everything is immutable
>>
>>50764634
When will you Go users realize that your language is a piece of shit?
>>
>>50764683
Out of bounds array indexing.
>>
>>50764690
You shouldn't be throwing exceptions for bad user inputs. Just write a function that verifies it yourself.
>>
>>50764688
>meme

muh meme meme
>>
>>50764699
>shit exploding everywhere out of the blue
>a good idea
exception cucks actually believe this
>>
>>50764704

Well memory has become abundant. Just make a new object each time and delete the old.
>>
>>50764704
How are we doing i/o?
>>
>>50764704
There are no variables, only pointers.

Also it's reverse-garbage-collected - random spots in memory are "reserved" by the compiler at runtime to ensure there are no stack overflow errors.
>>
>>50764679
No, use C with SDL or Allegro. Or use Visual Basic 6.0 with DirectX 7.0 as I am currently doing. Very easy.
>>
>>50764728
Magnetic pins and switches
>>
>>50764704
Null-terminated character arrays for string B)
>>
>>50764683
Exception handling shouldn't be used and if your language requires it it's a shitty language
>>
>>50764731
>There are no variables, only pointers.
wat
>>
>>50764706
>superior systems language
>low level
>maintainable code
>>
>>50764739
>>50764739
>Or use Visual Basic 6.0 with DirectX 7.0 as I am currently doing. Very easy.
i swiftly exhaled air through my nose
>>
>>50764704
There is no heap, only stack
>>
>>50764743
this
>>
File: 1443271113363.png (295 KB, 401x593) Image search: [Google]
1443271113363.png
295 KB, 401x593
>>50764706
Until Rob and friends drop it I'll stick with them

I don't see an alternative I would like more
>>
>>50764743

It might be needed in some big project.

But you will know that hopefully.

Otherwise whats the point of passing it up.
>>
>>50764704
Indenting your code results in a compiler error.
>>
>>50764761
There's no stack, only registers.
>>
>>50764687
>What is mingw?
from google:
>MinGW | Minimalist GNU for Windows
windows won't execute linux executables. if you look at the pic, you'll see that those aren't .exe files...
>>
>>50764747
You don't use declare and define variables, you simply read/write the memory directly.

*(int *) 0xDEADBEEF = 500;
if(*(int *) 0xDEADBEEF == 500)
{
// do something
}
>>
>>50764772
>what is nim
you mentally ill pedos deserve to be cucked by go
>>
>>50764747
The pointers point directly to memory locations, so when you want a constant value you just search the current memory registry for a location with the value you want. Then you create a constant pointer to it.
To make it easy the ramsearch could just be a function call, such as this:

point exampleName = ramsearch(16)


This would create a pointer called "exampleName" to the first memory location that contained the value "16".
Of course this may become problematic if the memory location you indexed changes externally, but hey that's why they're called variables and not constants, right?
>>
>>50764704
No branching or flow control so the language is optimized for caching.
>>
>>50764797
in an language without any mutability
>>
>>50764743
>>50764720
>>50764710
>>50764699
>>50764690
>>50764692
>>50764683

Why the fuck is exception shit being forced on me in intro to comp sci.

I understand why you wouldnt want to use it like if the user makes an error you tell the user to fuck off and ask for input again but should you just use exceptions in place of the actual error?

I am not even the guy who posted the original question.
I wish /g/ had some real programmers.
>>
>>50764775
Here's how a non-shit language deals with errors

https://www.fpcomplete.com/school/starting-with-haskell/basics-of-haskell/10_Error_Handling
>>
>>50764789
Windows can execute certain linux executables.

For example, programs written through Mono can actually be executed on both Windows and Linux without having to recompile. Assuming the program doesn't call any platform-exclusive libraries the same executable will work on both systems.
>>
>>50764822
>Why the fuck is exception shit being forced on me in intro to comp sci.
It's used all the time in actual applications.
>>
Just write error-free code and you never have to handle errors ;)
>>
>>50764789
>windows won't execute linux executables. if you look at the pic, you'll see that those aren't .exe files...
https://github.com/wishstudio/flinux
>>
>>50764833
>in shit applications
>>
>>50764749
>superior systems language
Try writing a decently functioning kernel in it and we'll talk. The ones I've seen have all been very limited due to Go being a bad systems programming language. And that's on top of it being GCd and benchmarking much slower than C/C++.

>low level
That's a joke right? It's about as low level as Java, maybe a bit more because you have pointers, but it's nowhere near C/C++'s level

>maintainable code
Well it's verbose as hell and ugly. It's certaintily not as messy as C, but I don't have much of an opinion on this.

It has a shitty type system, lacks generics and exceptions, has shit tooling, and this is on top of it just being crap at the one thing it tried to do well, concurrency. Its concurrency is like a braindead gimped version of what's used in Erlang.

>>50764772
>I don't see an alternative I would like more
How about Erlang/Elixir?
>>
>>50764856
I'm not justifying it, I'm just telling you how it is.
>>
>>50764822
>not using exception oriented programming
I don't even use for loops anymore if I'm going over an array. I just go until an out of bounds exception happens, and I catch it and go on with the rest of my program.

It's very enterprisey.
>>
>>50764844
this anon gets it
>>
>>50764694
> When i call the program with the argument `abc` it should return `bdf`
Such a transformation would require a single loop. Your code has 4 nested loops.

What exactly are you trying to do?

E.g. this part
                        for(int k = 0; k < input.Length; k++) {
char fuckvariablenamingschemes = character[k];
++fuckvariablenamingschemes;
character[k] = fuckvariablenamingschemes;
}

is equivalent to
                        for(int k = 0; k < input.Length; k++)
character[k]++;

It increments each character in the string.

On its own, that would transform "abc" to "bdf". So what are the 3 outer loops for?
>>
File: layne staley.jpg (32 KB, 500x365) Image search: [Google]
layne staley.jpg
32 KB, 500x365
>>50764870
>I just go until an out of bounds exception happens, and I catch it and go on with the rest of my program.
I know you're joking, but I can't shake the feeling someone has done this
>>
>>50764858
>how about meme/meme2
>>
File: 1442779743925.gif (892 KB, 500x281) Image search: [Google]
1442779743925.gif
892 KB, 500x281
>>50764858
Erlang actually sounds nice but from a different angle.

I don't like buying in to pre 1.0 languages without strong backing so most of those Elixer/Nim and stuff languages are not yet worth looking at.
>>
>>50764858
>lacks generics and exceptions
>what are interfaces
>what are error codes
javacuck confirmed
>>
>>50764885

This.

Some fag has done it and shipped the software.

Someday someone is going to maintain the code and show all his friends after he spends an hour figuring out what he is looking at.
>>
>>50764888
Yes friends, did you know that your phone is running off of a meme language? And that whatsapp is running off of a meme language? And did you know that you're a faggot?
>>
>>50764826
So you should write convoluted code that pushes all the dangerous work onto the user of your library?
>>
>>50764882
I...uh...

Well. This is embarrassing.
>>
>>50764858
>i can't write a kernel
>go is limited
>implying I can write a kernel at all
Dumbass.
>>
>>50764831
>>50764847
what the hell are you faggots arguing? are you retarded? it's clear to me: the guy downloaded a binary package for a linux program, and put the files in some random folder, hoping it would magically run
also, if you need an external application, then it's not windows itself running the program, and you can't run .net executables on linux directly.
stop arguing random shit, you fucking retards

>>50764858
>How about Erlang/Elixir?
slow as hell
>>
File: 1442093961107.jpg (262 KB, 544x604) Image search: [Google]
1442093961107.jpg
262 KB, 544x604
>>50764885
[spoiler]I have some software that works this way written in [spoiler]Go [/spoiler], Recovering from panics on bounds is really dank.
>>
>>50764704
100% manual memory management
>>
>>50764930
i didn't even follow the discussion, just hopped in to contradict your argument
>>
>>50762733
Anon, why didn't you use the Anime image?
>>
>>50764704
I'll help design the logo!
>>
>>50764930
>and you can't run .net executables on linux directly

If they're simple enough you can. The `mono` extension is only actually needed for framework calls which most console applications don't have. You'll need it for GTK# applications, but Windows can't run GTK# natively anyway so the point, unlike this board, is moot.
>>
>>50764910
No, my phone is not running off a meme language. I don't do whatsapp. Anything else, faggotron?
>>
>>50764704
The stack is a 1st class object that can be passed around
>>
>>50764914
This is probably a better article, I didn't read that one and just assumed it would go over the monadic syntax

http://www.randomhacks.net/2007/03/10/haskell-8-ways-to-report-errors/
>>
>>50764942
Not a pedophile.
>>
This fuck sentDex has a ton of python videos on youtube.

How the hell does he still have shit audio?
>>
>>50764966
who
>>
>>50764896
Erlang is worth looking into. Elixir is 1.1 at this point but I do agree that it's still fairly immature. That being said what it's done so far has been impressive

>>50764904
>interfaces
interace{} anyone? :^)

>>50764923
I have no idea what you're trying to say, but I was giving an example of what a good low level language should be able to do. Go is not a good low level language.

>>50764930
>slow as hell
It depends on what you're trying to do. You wanna serve out some static files or move a few directories around on a computer? Well it's gonna be slow as hell. Now if you want to have 100k connections going simeltaneously then Erlang is fast. It's all about the usecase. And even that aside, with HiPE, Erlang's speed isn't terrible.
>>
>>50764951
What stack, you fucking retard? There are only registers, you dumb cunt!
>>
>>50764941
ok. I had no idea flinux existed, so thanks for pointing out.
I guess they want some sort of wine for linux programs in windows... not sure for why you'd want that
>>
>>50764948
Microsoft released the CLR code recently so it's just a matter of time before the thing is fully ported onto Linux.
>>
>>50764821
The pointers themselves are immutable.
>>
>>50764973
>with HiPE
Can this shit get any more meme?
>>
>>50764978
Registers are now first class objects that can be passed to other registers.
>>
>>50764973
>It depends on what you're trying to do. You wanna serve out some static files or move a few directories around on a computer? Well it's gonna be slow as hell. Now if you want to have 100k connections going simeltaneously then Erlang is fast. It's all about the usecase. And even that aside, with HiPE, Erlang's speed isn't terrible.
http://benchmarksgame.alioth.debian.org/u64q/erlang.html

>>50764948
once again, what the hell are you talking about? how is this related to the post I was replying to, and why should I care about windows shit?
>>
>>50764973
>slow as hell
>Erlang is fast
>adding 2 numbers is slow
>solving traveling salesman is fast
Now if this isn't a meme language, I don't know what is.
>>
Name one good reason to use C in 2016
>>
>>50765015
>C#
>Windows shit
>>
File: 1438820391695.gif (2 MB, 200x200) Image search: [Google]
1438820391695.gif
2 MB, 200x200
>>50764704
The syntax is a cleaned up C. Variables are declarded as either heap or inline (stack on the stack and heap when allocated on the heap)

The few language constructs always go through a meta compilations phase. Enums are just a meta-function. for and other loop constructs are just meta-functions around a single loop keyword. Templates are done with meta-functions. static_if is done with a meta-function. No special comment syntax is needed.

From the ground up meta-function language with s-expressions processing symbols.


("generic max function that takes a variable number of arguments")

(fn |max a b|
if a > b { a } else { b }
|)

(fn |Max ...args|
((nest-binary-op max args))
| check-types)
>>
>>50764882
Actually I just compiled that and it doesn't work.
Inputing `abc` results in `bcd`, not `bdf`.
So back to experimenting, I guess.
>>
>>50765015
>>50765029
Erlang is terrible at number crunching. Which is why it provides a direct interface to call C code when necessary. If you want to look at benchmarks, look at ones which actually utilize what Erlang is good at, concurrency.
>>
>>50764973
>>50765015
BTFO
T
F
O
>>
>>50764822
Most non-trivial functions have requirements for their inputs. E.g. division requires that the denominator is non-zero. Memory allocation requires that the requested memory can actually be obtained from somewhere. And so on.

So the function can "fail". Ideally, you don't want every possible failure to simply terminate the program. But you can't just ignore them either (at least, not if you want software which actually works). So you have to be able to inform the caller that the function failed.

The "C way" to do this is via a status return, e.g. 1 for success, 0 for failure. But this requires that you check every function call for failure, and do something about it ... typically by having the parent function report failure to its caller, and so on up the call chain.

If you look at properly-written C code, as much as 70% of it can be error handling, with the other 30% being the actual "meat" which handles the success case.

Exceptions allow you to get rid of all of the boilerplate to check for errors and propagate them. You write code to handle the "typical" case, and propagating errors happens automatically. You only need to write specific code if you want to do something other than propagate the error up to the caller (i.e. catch it).
>>
>>50765031
to impress non-programmers with how l33et your coode loooks
>>
>>50765031
muh perfurmance
>>
>>50765047
or as we like to call it, "funcurrency"
>>
>>50765031
Embedded
>>
>>50765047
>http://benchmarksgame.alioth.debian.org/u64q/erlang.html
compare against
https://benchmarksgame.alioth.debian.org/u64q/go.html

>>50765035
way to keep talking shit. you guys surely love arguing pointless shit
>>
>>50764704
CPU cores are first class objects that can be passed around.
>>
>>50765047
>I'm slow as fuck; better give me MOAR cores to be slow on all of them.
>>
File: street.jpg (38 KB, 388x585) Image search: [Google]
street.jpg
38 KB, 388x585
Okay funny joke Mr Google, but really which one of these was meant to be the right answer?
>>
>>50765071
literally use assembly
everything else is a meme language
Thread replies: 255
Thread images: 39

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.