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

/dpt/ - Daily Programming Thread

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 323
Thread images: 29

File: PSP.png (867KB, 700x925px) Image search: [Google]
PSP.png
867KB, 700x925px
What are you working on, /g/?

Previous thread: >>61817506
>>
>not worshipping black seed
>>
>>61825885
Why did we need a new thread?
>>
Scheme, Shen, or Idris?
>>
>>61825901
But I do?
>>
>>61825966
Malboge
>>
>>61825926
>bump limit
>>
>>61825997
>350
That's a small bump limit.
>>
>>61825885
Writing an AI to automatically detect cuckolds, gather doxx on them, then eventually issue drone strikes on them.

Currently working on the cuckold detection part. I'll be collecting donations to pay for the reaper and the hellfire missiles after that phase is complete.

I'll be humane about it and paint the missiles black though.

>>61825901
>>61825982
Thank you for your contribution to the project. I'll be sure to use your post as training data.
>>
>>61825926
you must be new here
>>
>>61825966
Meme, literally who, or God Almighty?
>>
>>61826007
You can tell when a thread is autosaging when the post count becomes italicized. On /g/ it's 310 for some inane reason.
>>
>>61826024
You doing a dpttxt twitter of your own?
>>
>program reads data from file, prompts user for input then changes part of data and stores it again
Should I use a database or just something like csv?
>>
>>61826082
>Blackbeard gets 10 prints
B L A C K B E A R D
>Fuze gets 4
F U Z E
>Capitao gets 7
C A P I T A O

What is a loop? Your code is literally:
for word in available_ops:
for letter in word:
if word == letter:
# never true


>>61826104
What isn't working?
>>
hey /dpt/, how would I go about making a site similar to chinkshit.xyz which simply redirects to the newest of a specific general's threads?
>>
>>61826235
It will be easier to use a database unless you're writing it in Scheme or Lisp.
>>
>>61826235
sqlite
>>
File: 1499572552559.jpg (40KB, 550x512px) Image search: [Google]
1499572552559.jpg
40KB, 550x512px
struct variables
{
GLfloat speed = 3.0f;
};


void run(GLFWwindow* window)
{
struct variables * vars = {};
printf("%d\n", vars->speed);
return;
}

>segfault
what
>>
>>61826245
Well you'd need to create a script to get the newest version of /dpt/. I think the most robust way to do it would be to have the script open the catalog gather every thread with /dpt/ in it, and filter the ones that are autosaging.

You'll have to use an HTML parser to find all results in the link and then to filter them based on post count:
4chan.org/g/dpt
>>
>>61826300
>what
What did you expect, Anon?
>>
>>61826300
> struct variables * vars = {};
Thats not how its done.
>>
>>61826314
Thanks, I'll look into it. I'm assuming I'll have to use something like PHP or Javascript for this then.
>>
>>61826352
create a struct with those fields with those values and have vars point to it
>>
>>61826300
printf("%d\n", 0.5);

is not what you want. Floats when passed to variadic functions are promoted to doubles. You're going to have to do a cast hack.

Now why the code is segfaulting, it's because you're dereferencing an invalid pointer that happens to point out of your program's memory region.

struct variables * vars = {};

Even though you managed to compile it, I'm still convinced it's syntactically invalid C desu.

Try:
struct variables varss = {};
struct variables * vars = &varss;
>>
>>61826373
Nah, nah. You can use pretty much anything. No javascript needed. You issue a 307 redirect.

The code to run the server's program can be in pretty much anything. Php, perl, C, Java, Scheme, basically everything has tie-ins to some serverside technology.
>>
>>61826300
>GLfloat

Spotted the enginedev.
>>
>>61826410
>struct variables varss = {};
>struct variables * vars = &varss;
this is such a weird language

it seems to work with that and I have no idea wht
>>
>>61826498
> this is such a weird language
Thats what you get whan you start too high. Best you can do - get back to the langugae where it all make sense.
>>
>>61826498
{} is an initialiser list, and they can only be used to initialise arrays and structs. You should have gotten a compiler error for doing this on a pointer.
Are you doing something retarded like running C code through a C++ compiler?
>>
>>61825885
#include <stdio.h>

int main(){

int c = 5, d;
d = ++c + ++c + ++c + ++c + ++c + ++c + ++c + ++c + ++c + ++c + ++c + ++c;

printf("%d\n", d);

return 0;

}


How much is d?
>>
>>61826539
>Are you doing something retarded like running C code through a C++ compiler?
m-maybe
>>
File: 1374576261631.jpg (35KB, 368x368px) Image search: [Google]
1374576261631.jpg
35KB, 368x368px
>>61826556
Don't do that.
>>
>>61826556
lol you should really read a tutorial.
>>
File: rightclick-polymorphism.webm (2MB, 800x608px) Image search: [Google]
rightclick-polymorphism.webm
2MB, 800x608px
>>61826498
The first thing is a "struct variables" named "varss"

The second thing is a pointer pointing to "varss"


Read K&R and learn the fundamentals before trying gamedev anon. You gotta start with command line tic-tac-toe and shit before you can do 3D graphics. Shit's hard and you gotta start somewhere.
>>
>>61826581
Actually commandline tic-tac-toe is kinda advanced now that I think about it. I don't think I did tic-tac-toe in AP comp sci til gridworld, near the end of the year.
>>
>>61826620
man fuck gridworld
>>
Lisp is so good.
>>
>>61826581
I mean I get that one is a struct and one is a pointer
why did they have to be done separately? Is initializing the struct, putting it away somewhere, and keeping the pointer not something a C(++) compiler does?

I feel it is moreof just C and C++-details I struggle with.

>>61826570
is not C a subset of C++ though?
>>
I guess I could pick up K&R though thanks.
>>
>>61826698
>is not C a subset of C++ though?
Not entirely
int *ip = malloc(sizeof(int)); // valid C, invalid C++
>>
Here comes that annoying newbie guy with dumb questions you probably heard a thousand times :
- what are the easiest languages to learn?
- what are the most useful to actually find work easily?
- if I work like 4-5 hours a day on learning a language from scratch, could I be able to find work in like 1 year or so?
>>
>>61826300
>struct variables * vars = {};
WHAT DID EY MEAN BY THIS
>>
>>61826698
It's because C++ is a superset of C that you wanna use a C compiler at first.

There's more ways for C++ to compile invalid C programs and fuck you over, as you just witnessed.

And neither I nor anyone else recommends learning the ++ at the same time as the C. Stick to C for now at least.
>>
>>61826733
1. The """easy""" languages are shit, i.e python.
2. JS & Java, have fun in hell
3. Depends if you actually absorb and understand everything.

Find a domain youre actually interested in, find out what the popular languages are. Then try them all.
>>
>>61826733
You need a degree or certificate (or unfathomable wizardry + projects to your name + dick sucking & begging) to reasonably get a programming job desu.
>>
>>61826771
>JS & Java, have fun in hell
Haha why the hate?

>>61826796
Oh fuck. I'm too old for this I already checked most doors are closed. I thought being able to do the job/showing personal work actually mattered more but guess not.
>>
>>61826816
JS fatigue, and the language is an absolute chore to work with.
Java, theres no actual way to keep a clean and enjoyable code-base.
>>
>>61825966
scheme
>>
>>61825966
Smalltalk
>>
>>61826796
>You need a degree [...] unfathomable wizardry [...] to reasonably get a programming job
Employed autist reporting in, this is false. Dropped out of high school for C++ gamedev, now writing analysis tools in functional-style ES6 and Rust.
You can pretty easily get a job in the area where """IT""" meets """business""" because they need shit to get done, they will hire anyone and pay them. Fish around a bit and you can end up with a pretty lax job doing fun/interesting stuff.

also there are no good programming languages.
>>
Could someone please point me to a /g/ approved infohub on coding for industry. What languages do what, what you should learn, what bootcamp is worth it, how the industry works.

I imagine I sound pretty cancer but I don't ask g for much honest and I'm googling this shit right now too :/
>>
>>61826816
Anon I know a 50 year old man getting a BS in math and actuary certification.

You need a ~certificate~ thought not a degree. Most colleges/community colleges offer light certificates that are just a few courses.
>>
>>61826767
it hasn't been a (strict) superset for over 18 years, senpai. the differences in c99 deviated the language. it just happens that msvc is a c++ compiler that has a c mode
>>
>>61826906
>Employed autist reporting in, this is false
>not unfathomable wizardry
You're the second category in parentheses.
>>
how good is "let over lambda"
>>
>>61825885
PSP is management masturbation material - daily reminder.
>>
File: file.png (504KB, 600x600px) Image search: [Google]
file.png
504KB, 600x600px
>>
>>61827136
>+
>not ++
>>
>>61826934
search through ycombinator/hacker news if you want 'industry'.

this is free https://www.edx.org/micromasters/software-development

That intro course 'How to Design Programs' is based off the book HtDP and teaches a type disciplined way of thinking and reasoning about program design. Bootcamps are only worth it if you already have a programming background, they were orig meant for people with Physics degress and shit w/some programming knowledge to learn "industry methology" (namely that cancer, Agile). You can definitely still go to one and learn without knowing shit but you won't get hired anywhere (unless you're female, then you can weasel in with the diversity quota.. this is actually talked about a lot on HN when doing Bootcamp jobs stats).

Otherwise you'd be better off just doing that edx track it will essentially set you up for a job working at elastic search or some other bigcorp that does java/typsecript, which is all of them these days. Once you get familiar with edx courses 1 and 2, you can start to do some real CS on the side too like this: https://functionalcs.github.io/curriculum/#org2c45041 learning all about computer systems (VIrtual memory, CPUs, C/Assembly, ect).
>>
>>61826570
Aster please.
>>
>>61827258
>not +++
>>
>>61827306
>not +-
>>
File: Untitled.png (18KB, 706x384px) Image search: [Google]
Untitled.png
18KB, 706x384px
/dpt/, help!

So I have a certain amount of KeyFrames in an animation. Now I want to assign each KeyFrame a normalized "progression" value, which is a value from 0 to 1 indicating at what point in the animation the KeyFrame occurs. Basically, I have a 0-based index and a total amount of KeyFrames. I want 0 to be the first KeyFrame, and 1 to be the very last one. How do I calculate this progression-factor when given the index and the total amount of KeyFrames?
>>
>>61827465
index / (amount - 1)

watch out if amount is 1
>>
>>
>>61827545
Was that made in Qt?
>>
>>61827545
>>
>>61827465
How do you handle animation between keyframes, lerp?
>>
>>61827560

>>61827559
4chan API + matplotlib
>>
>>61827578
Hoping for more interesting data soon: I plan to run the script for these four boards for about a week or two and then to try to model it
>>
File: 1499449150729.jpg (799KB, 1080x1080px) Image search: [Google]
1499449150729.jpg
799KB, 1080x1080px
>>61827573
Between keyframes I interpolate the 16 values that make up the transformation matrix, making the at-runtime cost of animating a model
16 * (interpolate costs) * amountOfBones

which can further be optimized to
9 * (interpolate costs) * amountOfBones

by taking into consideration that only the top left 3x3 part of the 4x4 transformation matrix will contain useful values.
>>
>>61827545
>>61827560
>>61827578
This Space Invaders clone sucks.
>>
>>61827488
It worked! Thanks, anon!
>>
File: Untitled.png (23KB, 912x275px) Image search: [Google]
Untitled.png
23KB, 912x275px
>>
>>61827602
He was asking what you use to interpolate.
>>
>>61827664
I select the two relevant keyframes and then do (distance from keyframe 1) * keyframe1 + (distance from keyframe 2) * keyframe 2
>>
any good resources for learning advanced compiler use. or is just diving into the docs and reading through the 6 gorrilionflags my best bet?
or do i not really need anything other than -o, -l, -On, and -g
>>
>>61827688
man gcc
>>
>>61827688
all the -W flags can be useful
>>
>>61827676
OK. That's a lerp. Thanks for telling us.
I'd recommend slerp for most types of animation. Certainly for a general type.
https://en.m.wikipedia.org/wiki/Slerp
http://number-none.com/product/Understanding%20Slerp,%20Then%20Not%20Using%20It/
>>
>>61827688
Before you have a specific purpose you really don't need any other flags.
>>
Quick, print "Baka" to the console in your language of chocie, I'll start.

Go:
package main

import "fmt"

func main(){

fmt.Println("Baka")

}
>>
>>61827880
void main()
{
import std.stdio: writeln;
"baka".writeln;
}
>>
>>61826620
>>61826636
whats gridworld?
>>
>>61827880
fn main() {
println!("Baka")
}
>>
>>61827880
>Go
I tried to create a Go wrapper for a C api(Godot Native) last weekend, and holy hell what a cluster fuck it is to do that shit in Go, especially when it involves callback functions.
Got it to compile and run, but holy fuck what a pain in the ass.
>>
>>61827880
main = do
putStrLn "Baka"
>>
>>61827880

actor Main
new create(env: Env) =>
env.out.print("Baka")
>>
>>61826636
My nig. So many bad AP CS memories of that. Wish they switched back to the old curriculum, apparently you got to make fun things like a chatbot, and it was easier to get a 5.
>>
>>61827880
print "Baka"
>>
File: 20170607064915_1.jpg (38KB, 450x450px) Image search: [Google]
20170607064915_1.jpg
38KB, 450x450px
This is going to be a fun function to write!

void AnimatedModel::recursiveKeyFrameBuildup(KeyFrame& frame, unsigned int& amountOfBonesFound, aiNode* currentNode, const glm::mat4& parentTransform, const glm::mat4& rootInverseTransform, const std::map<string, unsigned int>& channelMap, aiAnimation* aiAnim)
>>
>>61827951
>wishes it was easier to get a 5
What did you get?
Also,
>brainlet
>>
>>61827880
program Baka;
begin
WriteLn('Baka');
end.
>>
>>61827880
"Baka
>>
>>61827880

import org.eolang.cli
import org.eolang.printed
import org.eolang.string
cli:
printed:
string:
"Baka"
>>
>>61827880
echo "Baka"
>>
>>61827999
I hope you arent actually using that abomination.
>>
>>61828012
Hi, welcome to /g/!
>>
>>61827880
are esolangs cheating?
    ↘↓                        

↘ ← ↙
⤢↘ ↘← ↑
↘← ↑⤡↙ → ↙ ↓↙↙
↙ → ↗ ↙
↘ ← ↙↙↘ ↙↘ ↙ ↑ ↘←
↘ ↑↕ ← ↓↓↑ ↙ ←
↘ ← ↙ ↕← ↗ ↔↙
↗↓ ↑↑ →↖ ↙← ↓ ↘
→ ↘ ↘ ↓↘← ↗ ↙↙
↙ ↖ ↘ ←↓↙← ↑ ↑↑
↑ → ↘ → ↙
↘ ↙ ←↙
↘ ↕ ↔ ↙↙ ← ↙

↑ ↘ ←↓↓↓ ↓↓↓ ↙↘
↘→ ↘ ↙ ← ↑
↓ ↘ → ↘ ↙ ←
→↘ ↓ ↓ ↙← ↕←
↗ →↘ ↙←
→↗ ↓ ↖← ↖ ↕ ↔ ↙
↗↔ ↖ ↑↓ ↙↑ ↖← ↑↘
↙ ↓ →↗→↖↑ ↑ ↑
↗↖ ↑→ ↙↓ ↙
↑ ↗ ↔ ↖↙←↙↓↖
↗↔ ↕ ↑ → ↙
↘ ←↗ →↖ ↘ ↕ ← ↖ ⤡
↗ ← ↙ ↑
↙ ↖ ↓↖← ↖ ↑
↓ ↓↑↙ → ↘↑↓↖
↗ ↙← ↑ ↙→ ↕
→ ↖
⤡ ↖ →↗ ↓ ↖
↑ ↑ ↗↖
>>
Guys what do I call my programming language?
It's already running code and I still don't know what the fuck name to give it...
This naming things shit is harder than programming
>>
>>61828045
giv sample cod
i name it 4 u
thx
>>
>>61828034
Is that supposed to be like some weird register visualization?
>>
>>61828045
there are 2 hard problems in computer science: cache invalidation, naming things, and off-by-1 errors.one
>>
>>61827880
print("baka")
>>
>>61828045
MyLang123
>>
>>61828054
its a visualization of control flow. it points to the next instruction.

the program starts with a datum of 0 and the direction it came from, and direction its going determine what to do with that datum. (the language is 2 dimensional)
>>
>>61828045
just name it after a random plant/animal/word/thing you like. Its what most modern langs do.
>>
>>61828095
Whats it called?
>>
>>61828107
Ziim
(I'm not the author, just a curious purveyor of esolangs.)
>>
>>61828051

I'm >>61821147 from last thread, see linked posts

I thought about some lame ass fusion of Lisp and Linux like "linsp" but that's autistic

>>61828058
True words... I literally cannot think of a name to give to my project... So I started it with a temp name and now I HAVE to pick one before it's too late. How did scientists of old name their shit?

>>61828092
The name I'm currently using looks like that

>>61828096
But there's always some sort of subtext, some kind of symbolism, some hidden depths thing that reveals the reasons behind the creator's choice if you analyze it deeply enough
>>
>>61827925
>!
for what purpose?
>>
>>61828150
its a macro. ! tells it to evaluate it. allows for
printfn!(); 
printfn!("asdf");
printfn!("{}", 1+1);
// etc


macro_rules! println {
() => { ... };
($fmt:expr) => { ... };
($fmt:expr, $($arg:tt)*) => { ... };
}
>>
>>61828134
>b was just taken from BCPL
>c was named c because it came after b
>C++ was just a superset of C
>Java was going to be named after a tree outside goslings office
>rust is (apparently & ironically) named after a fungus that is tough to kill

Theyre really not, language creators generally dont give a shit.
>>
>>61828134
> How did scientists of old name their shit?
1. Find essential difference specific for your lang
2. Translate to Latin
3. ???
4. PROFIT
>>
>>61828175
>allows for
And how would it not be allowed had it not been a macro?
>>
>>61827880
>'baka
>>
>>61828232
because rust is dumb. printf is inherently unsafe
>>
>>61828188
That's... really random. I guess I'm open source bike-shedding about this issue
But still, it's really bugging me that I can't think of a badass name

>>61828204
Interesting, well my lang is designed to be "stand alone" and run on it's own with only Linux to support it, not a single GNU package or anything. Much of the language's design and implementation came to me by trying to build a zero-dependency code-base.

Something came to mind now... "gits"... for "STAND ALONE COMPLEX" (pls don't killl me)
>>
File: baka.png (2KB, 525x39px) Image search: [Google]
baka.png
2KB, 525x39px
>>61827880
>>
>>61828287
>that I can't think of a badass name
just make it something unique. Rust still has an issue of having people from the game come to their places in mistake. People wont give a shit about the name, theyll just care about the language.

A simple placeholder name is take a random word that loosely describes your goal of the lang and make an anagram from it.
>>
>>61828045
If you want it to be unsuccessful name it after sci-fi.
If you want it to e successful make it a nasty acronym, like GNU.
>>
File: 1374574491604.jpg (37KB, 278x278px) Image search: [Google]
1374574491604.jpg
37KB, 278x278px
>>61827880
public interface BakaPrinter {
public void printBaka();
}

public class BakaPrinterToSystemOut implements BakaPrinter {
String bakaString;

BakaPrinterToSystemOut(String bakaString) {
this.bakaString = bakaString;
}

@Override
public void printBaka() {
System.out.println(bakaString);
}
}

public class BakaPrinterFactory {
private static BakaPrinterFactory bakaPrinterFactory = null;

public static BakaPrinterFactory getInstance() {
if (bakaPrinterFactory == null) {
bakaPrinterFactory = new BakaPrinterFactory();
}

return bakaPrinterFactory;
}

public BakaPrinter getBakaPrinterFromType(String type) throws UnsupportedOperationException {
if (type.equals("SystemOut") == true) {
return new BakaPrinterToSystemOut("baka");
} else {
throw new UnsupportedOperationException();
}
}
}

public class BakaPrinterProgram {
public static void main(String[] args) {
BakaPrinterFactory bakaPrinterFactory = BakaPrinterFactory.getInstance();
try {
BakaPrinter bakaPrinter = bakaPrinterFactory.getBakaPrinterFromType("SystemOut");
bakaPrinter.printBaka();
} catch (UnsupportedOperationException exception) {
exception.printStackTrace();
System.exit(1);
}
}
}
>>
>>61828349
Good job!
>>
>>61828349
jesus fuck i know its satire but still consider kys
>>
>>61828349
The factory pattern has to be one of the worst design patterns in existence.
It's both complex, verbose and encourages unmanaged resource use. I'm impressed.
>>
>>61828287
ALONE

That seems fine to me anon. Now stop bikeshedding. Also fun fact "alone" used to be two words, "all one." No really.

>>61828379
Factory pattern has its uses but like everything in oop, it's abused.

I think my code uses it well desu:
(define* (make-block-class
block-kind
(break!: break! dumb-break!)
(place!: place! dumb-place!)
(player-place!: player-place! dumb-player-place!)
(update!: update! dumb-update!)
(update/now!: update/now! dumb-update/now!))
(let ((rtn
(lambda (proc . args)
(case proc
((update/now!) (apply update/now! block-kind args))
((update!) (apply update! block-kind args))
((place!) (apply place! block-kind args))
((break!) (apply break! block-kind args))
((player-place!) (apply player-place! block-kind args))))))
(hash-table-set! block-class-table block-kind rtn)
rtn))
>>
>>61828422
>Factory pattern has its uses
Name one example. Because it's a terrible idea at every level.
>like everything in oop
Sorry, I'm bad at detecting sarcasm. Good joke anon.
>>
>>61828349
Sasuga, /dpt/.
>>
File: awkward_question.png (129KB, 314x278px) Image search: [Google]
awkward_question.png
129KB, 314x278px
Are there any other /girl programmers/ here?
>>
To: 61828507
traps arent girls.
>>
>>61828379
This pattern exists because Java is a really crappy and limited little language. It exists because constructors can only return objects of their own type.

Factories get around that. They return interfaces, and internally they can use any object constructor they deem appropriate. Using constructors directly will make code a pain to change later if you introduce a new compatible type and decide to use it. With factories, you just change the object it returns.

It's actually pretty neat if you understand the above. The problem is code monkeys will make factories by default, without understanding why, just because other people before him did. It leads to the self-parodying insanity we all make fun of.

And then there are languages which aren't limited like Java is, but people still make a goddamn object factory in them. Plenty of idiots make singleton objects in Ruby as well, despite the fact classes are objects and the whole language being duck typed. They simply do not understand why Java programmers came up with the idea of a singleton to begin with: classes can't implement interfaces in Java.

>>61828422
>alone lang

That's REALLY cool... With a .lone or extension too... Brb reinitializing project
>>
>>61828349
Enterprise Baka printing.
>>
>>61828542

That's what happens when developer performance is measured in numbers of lines of code produced.
>>
>>61828550
Youre now aware that DARPA literally thought a haskell implementation was a joke because it was a fraction of the 1k+ C++ code base
>>
>>61828422
Anyway thanks for the name anon. Would've never thought of it myself
Now I can work on the damn thing in peace
>>
>>61828540
>This pattern exists because Java is a really crappy and limited little language. It exists because constructors can only return objects of their own type.
>Factories get around that. They return interfaces
Hmm that's interesting.

I was starting to wonder whether the code that I posted would be considered a constructor or a factory (since Scheme isn't OOP from the ground up and thus doesn't have official constructors(TM)). But you're right, conceptually there's no differences between a factory or a constructor. There's just a difference between classes and interfaces in Java.
>>
>>61828640
constructors generally returns a new object, a factory can return a new, cached, reused or partially constructed object.

think of constructors as function application and factories are partially applied.

a -> a vs a -> possible b -> a
>>
Would you call yourself a creative coder, anon?
>>
>>61828640
Well in dynamic languages the concept is somewhat blurred, but even then there's a difference. Factories are just regular functions that return objects, while constructors are some special, magical little things that allocate memory and initialize it for you.

Even Javascript has factories... They're essentially just functions that make objects so that you don't have to use the convoluted stuff that is new/constructors.

Ruby actually separates allocation from initialization. New is a method on Class, and it works like this:

class Class
def new(*arguments, **keywords, &block)
object = allocate
object.initialize(*arguments, **keywords, &block)
return object
end
end


There's a magical allocate method on Class that makes an object. Then it calls initialize method on the object, which is provided by the actual classes. Then it returns the object.

Factories don't have to exist in Ruby because you can actually redefine the new method if you want. It can return any object. You can control how object creation plays out.
>>
>>61828744
Would you call yourself Grand Appz Architector, anon?
>>
File: image.jpg (5KB, 300x57px) Image search: [Google]
image.jpg
5KB, 300x57px
>>61825885
trying to get a job
>>
>>61828349
You're hired
>>
>>61828507
pls b my gf(male)
>>
>>61828768

>Factories don't have to exist in Ruby because you can actually redefine the new method if you want. It can return any object. You can control how object creation plays out.

Not to mention the fact that you can treat classes as any other object, and can call :new on an object not knowing which class it actually is.
>>
>>61828349
PAJEET MY SON
>>
>>61828946
Yes. Classes being actual objects (implying Object is an instance of itself) also completely and utterly obsoletes crap like singleton pattern. That didn't stop people from creating a singleton module and putting it in the goddamn standard library:

https://ruby-doc.org/stdlib/libdoc/singleton/rdoc/Singleton.html

It makes me so very angry! Why can't they understand? The class is the singleton. It's a full-fledged object like any other. No limitations like Java classes. But no, people just gotta put an :instance method on it to pointlessly create and manage yet another object.
>>
I have N tasks I want to run in parallel.
My current plan is to run each task in a thread pool and wait until all tasks are finished. This is relatively easy to implement, but I don't know the value of N. Each task can submit a sub task into the thread pool.
How do I wait until the thread pool is completely drained?
>>
>>61829411
Why not just N / pool size and spread them out evenly? Large thread count will hurt the performance.
>>
>>61829411
Assign each thread N / amount of threads tasks, and then wait for each thread to complete.
>>
>>61829431
>>61829461
I want my thread pool to be the size of the number of logical cores in the machine.
I don't know the value of N at runtime, so I don't know how many tasks each thread has.
>>
>>61829492
Whats the problem? Make core_count threads and let them go through tasks picking one when they done with previous.
>>
>>61829492
There must be some way to figure out just how many threads you're working with.
>>
>>61829411
>>61829492
// worker threads
{
while (job queue not empty) {
take job
do job
}
close thread
}

// main thread
{
populate job queue

for (number of threads) {
make thread
}

while (job queue not empty) {
take job
do job
}

for (number of threads) {
join thread
}
}
>>
>>61825966
Racket
>>
>>61828998
people used to believe in this thing called protein

they didn't know what it was exactly, they liked eating it and it didn't really taste like anything, one thing's for sure though it pulled a number on their kidneys. but they were still told they needed it. they didn't know but they thought they knew ...

what really happened was they stopped listening to their bodies and they started listening to what people were telling them
>>
#include<stdio.h>
#define sqr(x) x*x

int main () {
int a =3;
int b=2;
printf("%i", sqr(a+b));
}

What does it print?
90% of /g/ will screw it up.
>>
>>61829606
11
macros are evil
>>
>>61829606
Yes, unhygienic macros and all.
11
>>
>macros
>>
>>61829526
>>61829528
>>61829538
Thanks anons, I guess I'm overthinking the issue. Joining all threads should solve the issue.
>>
>>61829545
>Scheme
>but with meaningless deviations from the standard that just makes it incompatible just for vendor lock in
>vendor lock in? It's almost as if it's a corporate with corporate marketing horseshit and
>oh
>>
>>61829606
90% of /g/ does not know a single programming language, let alone C.
>>
Arduino shit. Question:

Dumb question but I need to set digital pin 11 on an Arduino shield to LOW for >100ms to reset the board's factory settings. Will this sketch work? I'm new to this and don't want to brick the thing.

#define resetPin 11

void setup()
{
pinMode(resetPin, OUTPUT);
}

void loop()
{
digitalWrite(resetPin, LOW);
delay(1000);
}
>>
>>61829767
If you only need to pull the pin low for 100ms once, I'd recommend putting everything in the setup loop (which runs once) so you would be setting the pin low, waiting 100ms, and setting it high again.
>>
File: consider.png (445KB, 807x700px) Image search: [Google]
consider.png
445KB, 807x700px
What programming language would an evil genius use to take over the world?
>>
>>61829828
His own.
>>
>>61829828
C++, and it worked.
>>
>>61829850
>an evil genius
>letting himself be taken over by a committee
>>
>>61829767
Unless you short and blow up a component on there, you will not brick it
>>
>>61829811
right on, will I need to put anything into loop() to get the program to compile? I've never tried to do my entire function in Setup().
>>
>>61826698
C has pointer arrays, C++ does not have pointer arrays.

You may be asking "why would you need pointer arrays?"
I'm doing high speed machine learning. Pointer arrays represent linear operators, very easy to manage memory.
>>
>>61829839
>>61829850
Wrong. The only right answer.
https://web.archive.org/web/20160304015440/yellosoft.us/evilgenius/
>>
>>61829879
>not using ANSI C++
>>
>>61829882
>short and blow up a component
...Is that possible by setting a pin to a LOW state for >100ms?
>>
>>61827880
clmtv:\dd
clmtv:\\iou, out
((sqs_telmarize == out clmtv:))
sumoru 'Baka'21112
b.alt.clmtv out 21112
/exit
>>
>>61829899
>haskell
>your botnet takes so long to infect a host they literally can do a fresh install and upgrade of the whole system before its even half-way done
>>
>>61829918
What do you suggest then? Haskell is highly robust and safe language. When you run it, there is a guarantee that your program will do exactly as you want it to.
>>
>>61829159

>the class is the singleton
You can also use modules or a plain old global object with class << self, in the event that you don't want your singleton to be a class itself.
>>
>>61829954
Someone in academia who wont wank to LC for three decades and actually invest in a language with speed in mind.

Also in this capeshit world, no evil genius would use something not made by him because his ego wouldnt allow it. And he could make sure (to the best of his ability) that it was back-door free.
>>
>>61829973
Couldn't he just make his own compiler for an established language like C?
>>
>>61825885
((lambda (x) (x x)) (lambda (x) (x x)))

#include <stdio.h>
int main(void(*v)(void*)) {
printf("yes, it works\n");
return main(main);
}

The printf's in there because the stack overflows in fucking nanoseconds otherwise. God computers are unbelievable.
>>
>>61829980
>C
>his bomb has a random seg-fault and bloms himself up
>>
>>61829992
The program is not even close to being valid.
>>
>>61830010
blows*
>>
File: works-on-my-machine-starburst_2.png (236KB, 497x480px) Image search: [Google]
works-on-my-machine-starburst_2.png
236KB, 497x480px
>>61830012
Do you think I care about "valid C" when I'm rewriting lambda calculus memes in C?
>>
>>61830010
https://www.youtube.com/watch?v=h73PsFKtIck
>>
>>61826796
lel umad, 20y/o working at 2 companies developing software, got no fucking gay certificate kek
>>
File: confused_and_nervous.png (1MB, 910x823px) Image search: [Google]
confused_and_nervous.png
1MB, 910x823px
>>61830012
Is this valid C?


main() {for (int n[]={3,1,2,0,4},i=0;i<5;i++)printf((char*)&(i[n][((int*) "an \0fou\0rch\0hi \0:D\n")]));}
>>
>>61830077
Certainly not.
You didn't even #include <stdio.h>
>>
>>61830087
The compiler compiles it.
>>
>>61830097
That doesn't mean that it's valid.
>>
Jumped on the #rust channel on Mozilla's IRC server today to find some resources about Rust's allocators, since I could not find out where the hell __rust_alloc is located on the Github. For SJWs, they were surprisingly helpful and professional.

>>61829992

Compile with -O2 and tell me if it stack overflows still.
>>
>>61830100
Why not? If a C compiler can compile the program, then how is it not valid C?
>>
>>61830105
>For SJWs, they were surprisingly helpful and professional.
That's because they act all nice on the surface, but they secretly try to brainwash you. If you don't have the same political opinions as them, they will block you out.
>>
>>61830108
Because that's not how the concept of undefined behaviour works.
The compiler is under no obligations to do ANYTHING. It can fail, it can continue, it could even wipe your hard drive and technically still be standards conforming.
If a C program contains undefined behaviour, it's not a valid C program.
>>
File: IMG_0429.jpg (2MB, 4032x3024px) Image search: [Google]
IMG_0429.jpg
2MB, 4032x3024px
>>61825885
I'm still studying Python. I'm reading Mark Lutz Learning Python front to back and halfway through it now, then reading programming with Python. I've finished upgrading and repairing PCs 21st edition front to back, and just bought a tool kit with everything I need for PCs, and another one for Apple devices from MacBooks to iPhones.
Pic related, read the stuff on the left, reading the stuff on the right
>>
>>61830129
I agree with this
>>
>>61830129
But under the C standard you implicitly call functions.
>>
>>61830105
No go in and start talking about something in depth, specifically a problem with Rust.
>>
>>61830181
Only in C89, and that code is not C89.
You're also violating strict aliasing.
>>
>>61830191
How is the code not C89?
>>
>>61830196
Declarations in for loops.
>>
>>61830105
Oh I tried that before but it's no fun if there's nothing special about it. I also just realized that the simplifications I made to the code before posting it made it stupid:
int f(int(*v)(void*)) {
printf("hey");
return v(v);
}
int main() {
return f(f);
}

I don't really like the cast from int(*)(void*) to int (*)(int (*)(void *)) but an accurate type definition would be infinitely long so whatever. In the end, it works correctly. My computer can apparently handle ~30k of these tiny stack frames too which is interesting.

>>61830129
Well you can police all you want. If you don't wanna call the code in this post C, fine anon. We can agree to call it C+=1 or perhaps C++.
>>
ahhhh mystery crash
>>
>>61827258
>++
>not 1+
>>
>>61830334
>>>/lgbt/forth
>>
>>61825885
I am very determined to learn to program, I just don't know where to start.
What is the best way of learning Java or C?
All the online courses require registration.
What software do I need?
I've only used Dev-C++ a little, only written Hello World and Celsius-Kelvin converter so far.
>>
File: zeromq-logo.png (5KB, 402x146px) Image search: [Google]
zeromq-logo.png
5KB, 402x146px
I need some ZeroMQ help.

I want clients to connect to a server, make requests, and get replies. Naturally, I tried the REQ-REP pattern. It worked, but there was a problem: requests have to be processed one by one (since ZMQ sockets aren't thread-safe).

Solution: ROUTER-DEALER pattern. Clients connect to the router, which sends all requests through a DEALER that distributes requests to any number of connected workers.
New problem: DEALER fairly distributes requests to workers, whether they're idle or busy.

Example:
>two workers
>1st worker gets a long request from a client, it will be busy for a while
>2nd gets a short request from another client, it replies
>1st worker still has not replied
>new request comes in, DEALER puts it on the 1st worker's queue
>2nd worker is idle, while the 1st one is still busy with the old request, as well as a new one

How can I avoid this?
>>
>>61830450
>What is the best way of learning Java or C?
By reinventing wheels for a while.
These days you don't need courses or books, you need a goal. As soon as you have an idea for something simple you want to write, you can google your way to victory, piece-by-piece.
That's how I learned, at least.

And I'm not sure C or Java are good choices as a starter language. C is too low level, Java is too verbose.
I'd start with Python. It teaches you the basics of programming and gets you going very fast doing way more in the same amount of time than what you would be doing in C.
After that, you can always delve deeper into C/C++ if you need performance or just crave knowledge of "how it really works".

also
>All the online courses require registration.
this is not correct
>>
>>61830726
>Recommending the memesnek
Disregard this advice.
>C/C++
Why are you grouping two completely different languages together?
>>
        .global _start
.text
shell: .ascii "/bin/shU"
_start:
xor %al, %al
movb %al, -9(%rip)
xor %rax, %rax
mov $59, %al
lea -28(%rip), %rdi
sub $24, %rsp
lea (%rsp), %rsi
lea 16(%rsp), %rdx
lea -48(%rip), %rcx
mov %rcx, (%rsi)
xor %rcx, %rcx
movq %rcx, 8(%rsi)
movq %rcx, (%rdx)
syscall
.byte 0
>>
>>61827136

>succ
>not inc
>>
File: android-boot-logo_634639.jpg (16KB, 626x626px) Image search: [Google]
android-boot-logo_634639.jpg
16KB, 626x626px
Given that Android doesn't allow any network operations on the UI thread, how do I execute several HTTP GETs in order? Is there a way to wait until the thread finishes?
>>
>>61827880

(print 'baka)
>>
>>61830764
I'd think of something to say if this bait wasn't so low effort.
>>
>>61830726
Okay, downloading Python.
C++ doesn't seem very hard though, I just don't know how to work with multiple .cpp files for example or something like that.
Any FLOSS projects that I might learn from just by reading?
>>
>>61830831
That post is not bait.
Why are you grouping two completely different languages together?

>>61830877
C++ is a god damn retarded clusterfuck.
>>
>>61825885
Health & Efficiency.

(Like a pig in a cage on antibiotics)
>>
>>61830877
>C++ doesn't seem very hard though, I just don't know how to work with multiple .cpp files for example or something like that.
C and C++ both use header files and includes. It's worse in C++.
>>
File: Screenshot_20170810_125616.png (70KB, 723x281px) Image search: [Google]
Screenshot_20170810_125616.png
70KB, 723x281px
why are you wasting time learning programming and computer science? Engineering is all about empathy, according to a Google Senior Engineer.
>>
I'm working on trying to find a job but apparently beginning generally programming literate doesn't mean shit.

Would really appreciate some help. I just need to make a really pitiful amount of money. Just enough to get by.

Problem is the local agencies want 40hr/week commitment and I can only work part time.
>>
>>61831002
>a part time programming job
Look into freelance m8.
>>
>>61830997
I think this is a misunderstanding between professional socializing and casual socializing.
>>
>>61830997
He said that because he sucks and no one trust him to code alone.
When you're good you can code alone and nobody bugs you.
To be free you must be good.
>>
>>61830892
>Why are you grouping two completely different languages together?
C and C++ are the same language. Don't (You) me.

>>61830877
Read up on include guards and namespaces.
C++ is a mess. It might look alright from the outside, but actually writing it is pain.
>>
>>61830997
Fucked priorities will eventually kill any business no matter how large. Theres only so much overhead you can cover.
>>
>>61831055
>C and C++ are the same language
Kill (You)'reself.
>>
>>61831055
C++ is only a pain to write if the last person who wrote it is bad.
>>
>>61830997
At risk of sounding like a junior I don't agree at all. It's not 100% solitary work obviously but most of my work is solitary. I'm tasked with implementing/improving on a system and aside from rather lengthy meetings where we lay out the plan for the project early on in development we don't talk that much. My work week is like 90% undisturbed solitary work. I'm very happy that we're not one of those open-office type deals. I imagine some company culture like that would breed this idea of engineering.
I don't understand how anyone could deal with a complex problem in that environment.
>>
>>61831075
Yes. And every dialect that isn't mine is bad. And there's thousands of dialects in C++.
It's difficult to find someone you fit with in C++ unless you're one of those factory grown programmers from community College.
>>
>>61831095
True, and it's a shame. But C++ on personal projects is comfy and powerful.
>>
>>61831077
There are some collaboration, especially at higher levels. But there's no "empathy". That's BS to make "engineering" look like something only SJW can do (because supposedly they have more empathy than those with centrist or right-wing views). Defining engineering "essentially" as empathy shows how twisted these people worldviews are.
>>
>>61831102
>But C++ on personal projects is comfy and powerful.
Yeah it's pretty alright there. But people tell you you're not a C++ programmer for not using all the bells and whistles.
And if you open source your project people always throw their garbage code at you.
I kinda want D to succeed. It's not perfect but it's probably better.
>>
>>61831200
>But people tell you you're not a C++ programmer for not using all the bells and whistles.
They're the ones who're in the wrong. Every young C++ programmer goes through that phase where they want to use every feature all the time, and ultimately it bites them in the ass. A good C++ programmer (few as they are) exercises restraint and subsets the language not only one what their favourite style is, but also what's appropriate for the task at hand.
D has a few good ideas (e.g. cleaner templates, UFCS) and much nicer syntax on the whole but I don't think it's the all-purpose replacement they make it out to be.
>>
>>61831200
D is 15 years past its expiration date.
It's never going to happen.
>>
>>61831239
>good C++ programmer
That's an oxymoron.
>>
>>61831239
>but I don't think it's the all-purpose replacement they make it out to be.
Why's that
>the gc
please come up with something else
>>
>>61831252
>please come up with something else
Why? It's a valid point. Using D without the GC is a pain in the ass, despite nominally permitting it the language doesn't provide the same utilities to make it easy like C++. Its OOP system (which is less flexible than C++'s) is dependent on having a GC.
>>
>>61830824
Listen for a call to finish and then call another?
>>
C noob here. Why are there 32bit libraries and 64bit libraries? How does this affect the way I program in C? Like, do 64bit libraries assume that the int data type is a different size of something? Or is it just the compiler producing machine code which has different sized memory addresses and registers?
>>
>>61827880
WriteLine("baka");
>>
>programming in python/kivy
>origin (0,0) is in the bottom left corner
>>
>>61828045
baklava
>>
>>61831814
the actual bus on your hardware is incapable of 64-bit code if it is a 32 bit machine
like walking a double door through a single door
>>
>>61831814
>Like, do 64bit libraries assume that the int data type is a different size of something?
lmfao, you're in for a wild ride.

Hopefully you start to understand why you only use C if you absolutely must, and use literally any other modern language if you can.
>>
>>61831814
sizeof(int) is implementation defined. Use stdint.h if you need integers of a particular size.
>>
What should I read next if I've finished K&R and want to get into Linux programming or cyber security?
>>
>>61831885
Lear asm anon.
>>
>>61831814
Never assume anything concrete about any library in C.
And sizeof is implementation-specific.
We have 32bit libs because C is a legacy-heavy language. If you can use 64bit libs, compile from source unless theres outstanding bugs for a 64bit version
>>
>>61831814
>Or is it just the compiler producing machine code which has different sized memory addresses and registers?
yea
>>
>>61831814
>Or is it just the compiler producing machine code which has different sized memory addresses and registers?
Yes, that's the gist of it.
>>
>watch a video about windows(r)(tm) server
>first three comments are from indians
>>
What's the absolute most hipster language to write in (that isn't something you made yourself)?
>>
>>61831964
Modula-2
>>
>>61831964
APL
PL/I
>>
>>61830450
I'd start with SICP.
https://sarabander.github.io/sicp/html/index.xhtml#SEC_Contents


Download Racket/another Scheme implementation and you can start.
>>
>>61832052
don't fall for this meme
>>
>>61831964
Ruby
>>
>>61832069
Why? I'm the one who suggested it and I genuinely believe it's the best way to start.
>>
>>61832089
Learning Lisp first means you have to unlearn and relearn programming when you move on. People who start with dynamic languages are going to be worse off.
>>
>>61832089
not enough focus on the practical
lisp has no application in 2017 (can you even make personal scripts to make your life easier with it?)
and what >>61832141 said

SICP is a great book and all but don't recommend it for beginners, that's just cruel
>>
File: Sam_text_editor.png (58KB, 1271x1015px) Image search: [Google]
Sam_text_editor.png
58KB, 1271x1015px
>he uses syntax highlighting
>>
>>61831814

For the same reason that you have different libraries for ARM and for x86, is the same reason why there are different libraries for 32-bit and 64-bit versions of the "same instruction set." It's not even just pointer size. If we're talking x86, the 64-bit extension has the following differences on top of larger register sizes:

1. Having 16 instead of 8 registers
2. Different calling convention (most arguments passed via the register instead of the stack).
3. SSE2 instructions guaranteed
4. Some other shit I can't remember, but these are the big ones.

Basically, there's zero binary compatibility between the two. Also, this isn't a C thing, this is a "every language that uses machine code" thing. It just so happens that the majority of native libraries are written in C.
>>
>>61832212
>i like taking longer to read and parse my own code
>>
>>61832212
I'd just like to let you know that your indentation and spacing are the most disgusting thing i've ever seen in my life.
>>
>>61832237
>implying it takes longer to read code without syntax highlighting
Also
>Syntax highlighting is juvenile. When I was a child, I was taught arithmetic using colored rods (http://en.wikipedia.org/wiki/Cuisenaire_rods). I grew up and today I use monochromatic numerals.
>>
>>61832285
>>implying it takes longer to read code without syntax highlighting
it literally does.
Color cues register faster than words.
>>
>>61832298
Are you a baby? Because only babies need syntax highlighting. Syntax highlighting is the equivalent of wearing a diaper.
>>
What's good modern multiplatform BASIC?
>>
>>61832314
Why is there always this attitude of
>Everything that makes reading or writing code easier is sinful and using it means you suck
?
>>
>>61832314
>lets keep name-calling instead of having any semblance of debate
your last (You)
>>
>>61832316
Ruby.
>>
>join a programming discord
>it's not about programming
>join an engineering discord
>"LOL, we don't always talk about engineering 24/7"
>talk about overwatch, drumpf and black bull preparing.

>be in technical faculty.
>80% the same or I just can't seem to be concise enough due to a neuronal/psychological problem.

>go into lifting discord.
>people help each other, banter with each other give helpful advice on form and feels.

Where the fuck do I find people I can talk about LEARNING STEM?

I just want to find people I can call a mentor or I wish to be the mentor of those who I can be helpful of.
>>
>>61832325
Bothers me more with people who don't use debuggers. They're wasting my time by being slow or by being incompetent.
Theres absolutely no reason to use print functions for debugging nowadays. Unless you're working on a platform where you actually don't have debug tools at all.
That's very rare.
>>
In opengl model/view/projection
the model matrix is the affine transform that maps each vertex in a model from local to global coordinates, right?
>>
>>61832325
That's a myth. Using syntax highlighting is like using *boldface* and _underlines_ and /italics/ everywhere. It does not in anyway improve readability.
>>61832328
I'm not name calling, I merely pointing out that diapers have the same benefits as syntax highlighting.
>>
>>61826314
>>61826373
>>61826439
You can use 4chan's open API, that might make it a bit easier.
>>
>>61832379
>It does not in anyway improve readability.
readability unimproved or worse? I can accept that
understandability? Much improved. You get information in chunks and important concepts are highlighted (bolded/italicized) so that at a glance you can tell what a paragraph or sentence is focusing on.
>>
>>61832359
Yes
http://www.opengl-tutorial.org/beginners-tutorials/tutorial-3-matrices/#the-model-view-and-projection-matrices
>>
>>61832427
>readability unimproved or worse? I can accept that
>understandability? Much improved.
How can you be so contradictory? Readability and understandability are not mutually exclusive, they are actually tightly linked. If you can't read something, then how can you hope to understand it?
>>
        .global _start
fizz: .asciz "fizz"
buzz: .asciz "buzz"
_start:
push %rbp
mov %rsp, %rbp
mov $1, %rax
sub $8, %rsp
.Lbl:
cmp $100, %rax
jg .Lel
mov %rax, -8(%rbp)
cqo
mov $15, %rbx
div %rbx
cmp $0, %rdx
je .Lfb
mov -8(%rbp), %rax
cqo
mov $5, %rbx
div %rbx
cmp $0, %rdx
je .Lb
mov -8(%rbp), %rax
cqo
mov $3, %rbx
div %rbx
cmp $0, %rdx
je .Lf
mov -8(%rbp), %rdi
call printint
.Llbj:
call printeol
mov -8(%rbp), %rax
inc %rax
jmp .Lbl
.Lfb:
mov $fizz, %rdi
call printstr
mov $buzz, %rdi
call printstr
call .Llbj
.Lb:
mov $buzz, %rdi
call printstr
call .Llbj
.Lf:
mov $fizz, %rdi
call printstr
call .Llbj
.Lel:
mov $60, %rax
mov $0, %rdi
syscall
>>
>>61832485
because you do not read code or technical texts like you read a novel. You take each paragraph or line or chunk of code at a time and try to understand it.

if a novel had highlighting or obnoxious boldface then yeah readability would drop.
>>
Red pill me on why Rust is bad?
>>
>>61832563
http://www.linusakesson.net/programming/syntaxhighlighting/
>>
>>61832564
>rustc is slow.
>statically links everything and you get outdated copies of several libraries on your computer.
>Modifying a file in your project or updating a dependency requires you to recompile everything that depends on it.
>Every executable, by default, contains a copy of jemalloc, making “hello world” approximately 650 kilobytes in size.
>Type-ahead auto-completion is still a work in progress, because rustc is slow.
>IDE support is lacking.
>Generic types are very popular, and they're essentially copy-and-pasted for every concrete type they're used with.
>The optimizer will break your program and it will run dog slow if you turn it off.
>Error messages from nested macros are difficult to understand.
>Rust has two main string types and four other string types, for a total of six
>Overly terse named types and keywords that don't communicate their purpose, like Vec and Cell
>SJW culture
>code fo conduct

etc
>>
>>61832574
I feel like he is putting up a false dichotomy between relying purely on highlighting and relying purely on reading.

why can not highlighting be an aid rather than your sole crutch?

>>61832446
makes sense then. Thanks.
>>
>>61832564
Its just a trudge to work with in general.
Anything done in Rust is done faster, with less headaches and you can achieve the same level of safety in another language.

The community care more about bike-shedding than the language. And many issues rarely get discussion because of Rust's Disneyland-like cult aura of no negativity allowed.
>>
>>61832602
>rustc is slow.
>statically links everything and you get outdated copies of several libraries on your computer.
>Type-ahead auto-completion is still a work in progress, because rustc is slow.
>IDE support is lacking.
>The optimizer will break your program and it will run dog slow if you turn it off.
>Error messages from nested macros are difficult to understand.
>Overly terse named types and keywords that don't communicate their purpose, like Vec and Cell
But those are problems with the compiler that can be fixed or are irrelevant in execution. Plus static compiling is good.
>Generic types are very popular, and they're essentially copy-and-pasted for every concrete type they're used with.
How is that a bad thing?
>SJW culture
>code fo conduct
Not a critique of the language.
>Rust has two main string types and four other string types, for a total of six
>Modifying a file in your project or updating a dependency requires you to recompile everything that depends on it.
Valid arguments.
>>
>>61832574
He doesn't seem particularly interested in fair comparisons when he syntax highlights normal text. The way you read code is very different from how you read normal text.
>>
>>61832637
I notice whenever someone gets frustrated with the language they blame it on the documentation being poor and not on the language itself.
>>
>>61832657
I never blame my language.
>>
>>61832657
I disagree. Most people blame specific features or lack there of and never attempt to get a wider picture of how a language would be used and criticising that.
>>
>>61832642
>How is that a bad thing?
Compiling essentially the same code over and over again is retarded when rustc is slow.
>>
>>61832657
>n-no the borrow checker is good, just wait a week it will get better!
>>
new thread when
>>
>>61832602
>>statically links everything
>this is bad for a systems programming language
>>
>>61832653
I get autism vibes or something along those lines.
>>
>>61832717
Why not have the option for both
>>
I don't understand why no one can give me a list of objectively bad things about Rust semantics.
>>
>>61833072
>of objectively bad things
your print being a macro for one thing.
having more than one type of string.
nested comments.
unsafe in a language screaming into a microphone about safety.

for starters
>>
>>61833154
>your print being a macro for one thing.
Not a big deal
>having more than one type of string.
That is one
>nested comments.
I don't really understand this
>unsafe in a language screaming into a microphone about safety.
Yeah, because sometimes you need to do something unsafe. Doesn't mean you have the make the whole project unsafe.

Anymore?
>>
>>61833154
>your print being a macro for one thing.
What's wrong with that? That seems perfectly rational to me. Parsing your format string at runtime seems pretty irrational.
>>
>>61833072
Naive gc is useless.
>>
>>61833235
How is Rust garbage collected though?
>>
>>61833192
>not a big deal
thats not an argument.
You ask for arguments and then wistfully dismiss things that go against your doctrine.
>I don't really understand this
There is no reason for nested comments to exist, they only cause problems when working with strings. But yet Rust keeps those and scraps actually useful things like ternaries.
>Yeah, because sometimes you need to do something unsafe.
But i thought the almighty borrow checker was all you needed? Unsafe is a direct contradiction to Rust's mantra. And the fact that unsafe is needed just shows Rust is a woefully flawed language.
>>61833230
Because macros are an awful relic that only serve to make your code shit.
>being limited to run-time
>>
>>61833246
I said naïve GC. The same than RAII in C++.
>>
>>61833266
>Rust macros are the same as C macros
>>
>>61833280
Youre right, in some areas theyre actually worse.
>>
>>61833266
I never said I was a Rust shill, quite the contrary. I just want solid arguments to convince me otherwise because all the Rust shills that come here brain wash me.

>thats not an argument.
Really is not a major flaw in the language at all.
>There is no reason for nested comments to exist, they only cause problems when working with strings. But yet Rust keeps those and scraps actually useful things like ternaries.
I guess that is a flaw.
>But i thought the almighty borrow checker was all you needed? Unsafe is a direct contradiction to Rust's mantra. And the fact that unsafe is needed just shows Rust is a woefully flawed language.
No, because Rust is safe it doesn't allow you to do unsafe things, and such you need unsafe to do it, as well as using FFI. Just because only 5% code is unsafe, doesn't mean that 95% code which is safe is shit.
>>
>>61833272
How is the Rust GC naive? It has clear ownership rules to ensure that objects are deallocated when you want them to.
>>
>>61833336
Rust macros are pretty much just for pattern matching. But the sheer verbosity just makes them not worth it.
> because Rust is safe it doesn't allow you to do unsafe things
That's incorrect.

Rust is a stepping stone language, that i hope someone will improve upon soon. Form your own opinion, but i sincerely believe its not worth investing in.
>>
>>61833386
So young and ignorant.
>>
>tfw you fell for the GC meme
>>
>>61833266
>Unsafe is a direct contradiction to Rust's mantra. And the fact that unsafe is needed just shows Rust is a woefully flawed language.
Christ if you read the initial revealing of Rust when it was first conceived you'd know that this is blatantly wrong. Rust is about being able to make useful safe constructs and use them to ensure that your program doesn't encounter the slew of bugs that plague C++ development, but still being able to dip into unsafety in order to create the safe constructs.
>>
/!\ A L E R T /!\

New thread

>>61833713
>>61833713 >>61833713
>>61833713 >>61833713 >>61833713
>>61833713 >>61833713
>>61833713

/!\ A L E R T /!\
>>
>>61827880
echo "Baka"
>>
>>61833072
>I don't understand why no one can give me a list of objectively bad things about Rust semantics.
>objectively
That's because you're stupid anon..
>>
>>61832052
>>61832069
>>61830450

SICP is for beginner Computer Science students and intermediate programmers. Don't start with it.

Start by learning Python or C first, Pythons good if you want to be getting shit done ASAP. SICP is an amazing book, but you will not appreciate it if you start with it.
>>
>>61827957
>not using python3
kys
>>
>>61832354
>Where the fuck do I find people I can talk about LEARNING STEM?
IRC
>>
File: look at this.png (124KB, 2710x925px) Image search: [Google]
look at this.png
124KB, 2710x925px
>>61826236

do you have to commit/push before gitignore takes effect?
>>
>>61831065

so feminism is destroying big companies...

holy shit guys im supporting feminism now
Thread posts: 323
Thread images: 29


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

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
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.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.