[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: 452
Thread images: 47

File: 1480308777510.jpg (475KB, 852x973px) Image search: [Google]
1480308777510.jpg
475KB, 852x973px
Previous thread: >>61024201

What are you working on, /g/?
>>
first for literally wat

>Array.prototype.sort

>If compareFunction is not supplied, elements are sorted by converting them to strings and comparing strings in Unicode code point order. For example, "Banana" comes before "cherry". In a numeric sort, 9 comes before 80, but because numbers are converted to strings, "80" comes before "9" in Unicode order.
>>
First for procastinating.
>>
I don't understand, why were both new threads deleted?
Mods could have just deleted the pepe thread and all the shitposting in the non-pepe thread.
>>
>>61029485
you even procrastinated posting so you didn't make it... anon please apply yourself
>>
File: hg.jpg (186KB, 1440x1080px) Image search: [Google]
hg.jpg
186KB, 1440x1080px
Does anyone program in old languages on old computers?
>>
>>61029499
Sadly I don't have a computer.
>>
>>61029496
They delete posts discussing it afterwards but it's standard procedure basically.
I say they should just look at post counts.
>>
>>61029467
What language is the nicest for doing simple regex text formatting stuff, Python or Perl?
>>
>>61029499
Bisqwit does: https://www.youtube.com/user/Bisqwit
>>
File: 1497468675610.jpg (48KB, 1024x632px) Image search: [Google]
1497468675610.jpg
48KB, 1024x632px
>>61029523
Please do not mention that abomination called "Python" again, this is a SFW board.
>>
>>61029481
>javascript
>>
>>61029523
I don't know about perl but in python you literally just use re.sub, I did a project where I had to mangle a lot of scraped data and I didn't have any problem at all
>>
How do I make an array of 5 arrays to 3 ints in D?
>>
>>61029532
>(((Bisqwit)))
>>
>>61029481
[900, 88, 9].sort()
(3) [88, 9, 900]

wow
>>
>>61029553
ask Buclaw, aka. the only other D user in existence.
>>
>>61029523
Any language is fine really. Since you're using a DSL inside the language it's not a big part of your work to use the language.
>>
>>61029522
>I say they should just look at post counts.
LOL

fuck off, you know how silly this is, if they would keep one it would be the one with the earliest timestamp, at least if it was posted after the old thread hit the bump limit

kill yourself
>>
all of you are fucking pieces of shit, i don't know why i came here in the first place, such a cancerous waste of time to be here
>>
File: perl-ha-ha-ha-python.gif (7KB, 468x60px) Image search: [Google]
perl-ha-ha-ha-python.gif
7KB, 468x60px
>>61029533
Python is actually pretty aesthetic looking. The flaws in the language are not in appearance, unlike Perl. Though I remember Perl being heavily recommended as a language based on it having a lot of those features. But they are both scripting languages so they are ideal for that sort of thing.
>>
>>61029533
what's wrong with it?
>>
>>61029608
Thank you for your feedback.
Your opinion is very important to us. We appreciate your feedback and will use it to evaluate changes and make improvements in our site.
>>
>>61029481
But isn't JS a dynamically typed language? Couldn't they just do compare operations without converting and catch an exception for types without. Since the strategy seems to be to not have errors but rather unexpected behavior.

>>61029589
>I like my *****
Yeah fuck off anon. The thread with the most posts clearly had the most attention and value.
>>
Trying to set up a not shit dev workflow for learning on windows 10. Not entirely sure what language I want to study with, leaning towards C, I have experience in scripting languages and C# as well as minor experience with c and c++. I'm honestly considering multiple languages. Not in the sense of "I can't decide between x and x" I mean an actual use of multiple languages. I'm past the stage of basic programming as I've been doing it for several years, have made some games and personal programs for myself. I'm not practicing for a job right now, just perusing it for the sake on knowledge and skill building. Implementing the same thing in multiple languages, preferably differing languages will help me focus on the concept that I'm trying to learn as well as problem solving using differing tools. I just want to get out there and try a bunch of shit out of curiosity now.
>>
>>61029633
>The thread with the most posts clearly had the most attention and value.
LMFAO it was mostly just shitposting about frogs and shit. probably a few dozen posts were by me
>>
if you post an illegitimate duplicate thread and spam the shit out of it it doesn't make it the more "valuable" thread
>>
>>61029553
int[3][5] arr;


[[0, 0, 0], [0, 0, 0], [0, 0, 0], [0, 0, 0], [0, 0, 0]]


?
Or do you mean something else?
>>
>>61029649
So you're saying the thread with frog posting that had 100% shit posts is better than the anime thread with some fraction of shit posts?
>>
>>61029724
For the record. I only see three serious posts in the frog thread. We had a bunch in the other despite anons decision to try to shit it up.
>>
File: old_hag_langs.png (173KB, 600x355px) Image search: [Google]
old_hag_langs.png
173KB, 600x355px
>>61029467
You think it's some cute lang? Too bad! It's just C-chan and Fortran-chan!
>>
>>61029724
both were shit because of anime shitposters with their reddit-tier "hurr frogs are bad" meme
>>
best db for storing configs and such for C?
unqlite looks really nice.
>>
File: 1479497937163.png (575KB, 519x551px) Image search: [Google]
1479497937163.png
575KB, 519x551px
this is now a frogposting thread
>>
>>61029758
They should have banned you anon.
>>
>>61029758
>-tier
>meme
I don't want reddit stink nearby. Fuck off.
>>>/r/abbit/
>>
#include <iostream>

template <typename ...Args>
static void print(Args&&... args) {
(std::cout << ... << args) << '\n';
}

int main() {
print("Hello world!\n", 30596, std::hex, " 0x", 123456789);
// VS
std::cout << "Hello world!\n" << 30596 << std::hex << " 0x" << 123456789 << '\n';
}

Hello world!
30596 0x75bcd15


What do you think?
Can it be improved?
Can type checked format strings (or similar) be implemented?
>>
@61029778
atleast post some code snippets or anything partially on-topic with it
>>
>>61029758
You seem to be new here. All the *chan websites are born out of anime culture.
We apologize that seems to intrinsically trigger your plebbit sensibilities.
>>
>>61029768
if it's just a configuration file, just use a text file.
>>
>>61029722

And to access the final element I use
arr[4][2];
?
>>
Writing a spambot in phantom.js and node
>>
>>61029778
>>61029782
this is now a programming thread
post things that you do with a computer that don't involve smug faces of the Oriental or amphibian varieties

I love Python, so this cute little guy can be our new mascot!
>>
File: 1432164169261.png (289KB, 586x634px) Image search: [Google]
1432164169261.png
289KB, 586x634px
>>61029836
>I love Python
>programming
Oh boy.
>>
>>61029788
>can type checked format strings be implemented
Templates are Turing complete but it's not worth bothering with realistically.
I'd rather wrap the hex number in a function like asHex(number) which just returns the stream and does the checking with your normal type checking.

Assuming we need to use C+cripple
>>
>>61029829
correct
>>
>>61029779
nice double standards you insufferable retard. these retarded trolls should be banned: >>61029782 >>61029798 >>61029779
>>
File: 1494459298053.png (14KB, 166x166px) Image search: [Google]
1494459298053.png
14KB, 166x166px
>>61029836
>programming
>things that you do with a computer
>>
File: m1fyus1w6l7f.png (10KB, 267x235px) Image search: [Google]
m1fyus1w6l7f.png
10KB, 267x235px
>>61029836
Sorry, I forgot the picture.

My friend and I are probably going to have a drunk programming contest tonight just for fun. What stuff do you recommend us trying to do? We usually do Python, but my friend is a more talented programmer than myself. Something fun with graphics maybe. Like trying to design a GUI while wasted.
>>
>>61029864
>complaining about someone making OT posts
>should be banned
Well maybe. But the person making OT posts should certainly be banned. Since it's even breaking the rules.
>>
File: 1477252788962.png (206KB, 486x444px) Image search: [Google]
1477252788962.png
206KB, 486x444px
>>
File: 1460040192334.jpg (10KB, 205x246px) Image search: [Google]
1460040192334.jpg
10KB, 205x246px
>>61029891
if i should "certainly" be banned why am i not banned
>>
>>61029851
What's wrong with Python? We can also do Java or something else if that's not cool enough. I know Java is really popular here!
>>
File: GNU nano.png (40KB, 596x366px) Image search: [Google]
GNU nano.png
40KB, 596x366px
Hi, what is the best text editor and why is it GNU nano?
>>
File: oh_boy_here_we_go.png (277KB, 416x406px) Image search: [Google]
oh_boy_here_we_go.png
277KB, 416x406px
>>61029929
OH BOY
H

B
O
Y
(You) for (You)?
>>
>>61029953
you sure seem cock thirsty & hungry for attention
>>
>>61029918
Good question.
>>
>>61029947
I know people will taunt me for being a Windows pleb, but I like Notepad++. Nano is perfectly good though, much better than vim and easier for a newbie, since there are basic keyboard shortcuts on screen.
>>
File: 1456126350457.png (78KB, 296x313px) Image search: [Google]
1456126350457.png
78KB, 296x313px
do people here unironically like rust? haskell? like wtf is wrong with you?
>>
>>61030000
I unironically like both, ama.
>>
File: 1457058536312.jpg (26KB, 222x222px) Image search: [Google]
1457058536312.jpg
26KB, 222x222px
>>61030000
quads of the gods

praise kek!
>>
>>61030000
Rust is like C but more focused on memory, right? I have no idea about Haskell or what's wrong with it.
>>
>>61030038
Rust is like if C++ was born from C + ML instead of C + classes.
>>
File: file.png (74KB, 800x500px) Image search: [Google]
file.png
74KB, 800x500px
>>61030000
people like programing in Haskell because Haskell is fun!
>>
>>61030038
>but more focused on memory, right?

Nah, Rusts whole gimmick is that you dont have to keep track of memory, just borrowed memory :^)
>>
>>61030050
>pointers
>a tag
Why.
>>
>>61030050
you're fucking retarded if that's how you choose to interpret those stats
>>
>>61030085
How do you interpret them?
>>
>>61030000
Haskell is a fun toy to play with. Rust is not.
>>
>>61030092
haskell has a high weekend/weekday difference because no one uses it at work, because it's worthless for serious applications, it's only used by neckbeards as a hobby
>>
File: c82.jpg (36KB, 400x422px) Image search: [Google]
c82.jpg
36KB, 400x422px
>they like haskell
lol you're so not worth my time

bye bye lardasses
>>
File: most_loved.png (40KB, 701x969px) Image search: [Google]
most_loved.png
40KB, 701x969px
Speaking of the SO survey.
>>
>>61030134
literally what is that list
>>
>>61030108
>it's not fun, it's just done as a hobby despite it not being used much professionally
Kill yourself retard.
>>
>>61030134
loved should be "trendy flavor of the month"
>>
>>61030134
rust is only used by mozilla shills
>>
>>61030134
>C that low
>Fortran isn't even on the list
JUST
U
S
T
>>
>>61030050
>>61030108
>only learn spreadsheets and IE because that's all you need at work
There's hardly anything programming related stuff, just boring office applications, server, and database stuff.

Python 3.x is a weekend tag? Do they use 2.7 at work? I like 3.x better but I use 2.7 now because everyone else still uses it.
>>
Trying to do no_std Rust has only made it far more obvious that it needs HKTs. Everybody else falls back on trait objects.
>>
I dug myself into a hole where I am forced to use multithreading in Python. I have some questions:

1) Is there such a thing as interrupts in Python? Say I spawn two threads where thread A modifies a variable and thread B needs to do something when that has happened; can thread A notify thread B of the update without thread B having to explicitly poll the variable for changes all the time?
2) Is there really no way to kill or stop threads? Do I seriously have to poll a termination request variable all the time from within the thread I want to stop?

Starting to regret I didn't specify a different language for this project. Even fucking Java might have been a better choice.
>>
>>61030134
why is Visual Basic so dreaded? I don't use it (except VBScript for some Windows tasks, but that's not the real VB language)
>>
>>61030152
>Fortran isn't even on the
I'll resurrect Fortran after I'm done with Pascal.
>>
File: most_dreaded.png (41KB, 697x957px) Image search: [Google]
most_dreaded.png
41KB, 697x957px
I have no idea that this actually means t b h
>>
>>61030198
>Lua that high
Kind of surprising.
>>
File: most_wanted.png (38KB, 692x960px) Image search: [Google]
most_wanted.png
38KB, 692x960px
>>61030198
Or even if it means anything at all.
>>
>>61030190
it's trash
>>61030202
it's trash
>>61030207
all trash
>>
>>61030169
Python seems like a good idea until your project grows over 200 lines, then you realize you should have used Java or Haskell.
>>
>>61030198
literally 100% - loved% = dreaded%
>>
>>61030207
>Oh yeah, Python-san, I want you! I want you so hard!
>>
>>61030216
Yes. Sadly, I have limited time to hand in this project, I'm already 2 months into it and I'd have to get back into the swing of things with Java or C because I haven't used either in almost a decade so that's out of the question.
>>
File: so_demographics.png (42KB, 703x1003px) Image search: [Google]
so_demographics.png
42KB, 703x1003px
>>61030207
And keep in mind this is the demographics we're talking about.
>>
>>61030169
Aha, this happened to me too. Python really does suck for multi threading. There's no easy way around that really.

We did a robot project where the sensors were polling on different threads and we also had two threads to send/receive data via sockets. We also had a lot of crashes on the client end (Windows machine). The thread dies when it's run() method terminates. I don't think there's a special "kill" function. I'm not sure about the first question.
>>
>>61030239
in order words, literal fags, a lot of them from san francisco, the gay capital of the world

https://heatst.com/tech/cancelled-tech-conference-electronconf-off-over-non-diverse-speaker-lineup/
>>
the bay area is a speculative bubble have fun with your hipster startup employer going bankrupt as soon as that VC tit dries up
>>
>>61030290
I heard they were selected blind.
How irresponsible.
>>
>>61030326
People have been saying this for 10 years, you can run a company with no prospects of ever turning a profit and not only get angel VCs riding your dick FOREVER, you can also get an IPO and still remain unprofitable.
>>
>>61030326
the 1% has infinite money they'll never stop buying up small businesses in the hopes for 1,000% returns
>>
>>61030239
>>61030290
>>61030326

I can't wait for this whole coding fad to get old and I can finally get back to programming without being compared to overpriced latte drinking code artisan fucks who write in languages like Rust and Ruby.
>>
>>61030341
>going public
>>
>>61030194
>I'll resurrect Fortran
How? Break new record for the lattice size of exact diagonalization?
>>
>>61030341
Is that really the key to success? Making a useless product, the name of which ends in "-er" without the "e"?

Shit, /g/, I'm in the wrong business.
>>
>>61029756
>despite anons decision to try to shit it up
I'm the one who kept asking why frogs are bad. If you're talking about me, fuck you. It was a real and legitimate question, and true to my word, when I FUCKING FINALLY got an answer, I stopped posting about it. I wasn't trying to shit anything up, it was an inevitable consequence of everyone so insistently memeing at me instead of actually answering the question. Thank god someone finally actually did, I was starting to think I was on some kind of alien planet.
>>
huh, does 4chan filter bash scripts in code blocks
>>
>>61030384
I don't know yet. I'll find a way. I'd do anything for my loving harem of C, Pascal and Fortran.
>>
File: yukari_brain.png (771KB, 1280x966px) Image search: [Google]
yukari_brain.png
771KB, 1280x966px
>>61030539
Well I'm looking forward to it.
>>
How do I count to 10 in html?
What html editor do you guys use?
>>
>>61029499
Does writing batch files in MS-DOS 6.22 on a VM count?
>>
>>61029533
Python code is beautiful.
>>
>>61030601
if you're a sjw faggot.
>>
>>61030593
Yeah I guess batch counts as a scripting language at least.
>>
>>61030612

[citation needed]
>>
>>61029625
Nothing really, but it's the language of choice for normies, so I tend to avoid it.

(I'm not the person you replied to, just to clear that up.)
>>
>>61030626
lurk moar you fucking nigger.
>>
>CS grad.meme
https://pastebin.com/Tx4UA8uP
>>
>>61030676
>PHP
>>
>>61030676
Suddenly, I'm not all that concerned about getting a job.
>>
@61030587
>html
>>>/g/wdg/
>>
File: javascript file directories.png (60KB, 796x580px) Image search: [Google]
javascript file directories.png
60KB, 796x580px
if a page loads multiple javascript files and they're in different directories like pictured,

are those javascript files, as long as they're loaded by the page first, able to call functions from other javascript files?

or can loaded javascript files only call functions from the same directory as them even if they've all been loaded in the same webpage?

So for example, lets' assume all the js files in the picture have been loaded. can granite.min.js call a function from the trackinghub js file?

I'm just getting started with web development, sorry for this question, don't really know what the scope of js files calling functions from each other is.

On stack exchange it says it's fine as long as they've been loaded but it doesn't say anything about them being in different directories like pictured.
>>
>>61030718
No, you should be.
These are the people who get hired over you.
Corporate environments DO NOT CARE how extendable or maintainable your code is, so long as they have a working online storefront done NOW so they can start making money.
>>
>>61029625
It has clear, nice looking syntax and it has one obvious way to do a given thing. It's well liked by experienced programmers and easy for beginners. It is well supported on many platforms and has lots of libraries available to help you make anything your heart desires. That's what's wrong with it, and why /g/ hates it.
>>
>>61030718
Actually:
>>61030640

>>61030737
Reportedly this took 2 hours of parsing for their dataset VS a regex that took a minute.
>>
>>61030749
You're forgetting the part where it's really slow
>>
File: reasoning.png (723KB, 306x1122px) Image search: [Google]
reasoning.png
723KB, 306x1122px
>>61029625
It's the language for brainlets.
>>
Doing some Clojure challenges.
I get 'no response on stdout', but it works in the REPL. How come?
(defn odd [s]
(apply str (map first (filter #(= (mod (second %) 2) 0) (zipmap s (range))))))

(defn even [s]
(apply str (map first (filter #(= (mod (second %) 2) 1) (zipmap s (range))))))

(let [t (Integer/parseInt (read-line))
ss (for [i (range t)] (read-line))]
(map println (map #(format "%s %s" (odd %) (even %)) ss)))
>>
>>61030749
Real Programmers don't use Python.
>>
>>61030796
Of course. Python is a script language for scripters, not programmers.
>>
>>61030749
Slow, dynamic and error prone typing. Realistically only a good choice for small scripty programs. And even there there's mostly better choices. It has a lot of libraries though.
>>
>>61029467
I need to learn VBScript and Java for a job I got. I have some background in Java but I'm not familliar with VBScript. Where be a good place to start? I couldn't find any good tutorials on Memesoft's website and VBScript In a Nutshell seems to be web development oriented book but I'm going to use VBScript for automation.
>>
>>61030822
Thanks. Finally a good response. I use Java for a lot of other stuff and I'm trying to do more C++ stuff. Not interested in /g/'s language of the month though.
>>
>>61030865
I feel like Python is no longer useful for scientific programming with Julia around and it was one of the biggest niches.
>>
>>61030779
Fixed it. map is lazy so it doesn't work with println.
(defn odd [s]
(apply str (take-nth 2 s)))

(defn even [s]
(apply str (take-nth 2 (rest s))))

(let [t (Integer/parseInt (read-line))
ss (for [i (range t)] (read-line))]
(doall (map println (map #(format "%s %s" (odd %) (even %)) ss))))
>>
File: saveme.png (60KB, 837x333px) Image search: [Google]
saveme.png
60KB, 837x333px
Can someone explain to me why the code on the left works as intended, but when I run the code on the right, the image I'm trying to change on mouseover changes immediately and doesn't change again when mousing over the other links?
>>
>>61030134
Link?
>>
>>61030207
>Common Lisp not even there
J U S T
>>
>>61030779
Hold on, does Clojure have partial application?
>>
>>61030982
Is there even a substantial CL project on github?
>>
>>61030982
Why would anyone *want* to use CL?
>>
>>61030996
yes
>>
>>61030953
On the right you execute the function immediately. You probably want a closure
>>
>>61029515
So how did you post this?
>>
>some mad-man is unironically writing an OS in commen lisp
https://github.com/froggey/Mezzano
>>
>>61030959
https://insights.stackoverflow.com/survey/2017
>>
>>61031001
no sane persons uses github.

>>61031031
Reader macros, easy live coding because every implementation is required to provide compiler, interpreter and debugger.
Nice syntax. none of that
fn Nigger_Digger({[<>]})~!@;
>>
>>61029625
>>61030749
for me, I just plain hate dynamically typed languages

it just introduces a tonne more run-time bugs you have to snoop down that would have been automatically caught for you in compiling

>just code better and you won't have type errors
you're usually not working with code you've written all yourself
>>
>>61031031
The memes.
>>
>>61031063
There's already lisp operating system genera. It ran on the lisp machines, currently you can only run it in virtual machine.
>>
>>61031078
>Reader macros
>Nice syntax
You do realize these are mutually exclusive points, do you?
Also
>lisp
>syntax
>>
>>61031103
>currently you can only run it in virtual machine.
disappointing
>>
>>61031048
Holy shit, I'm considering learning it.
List me some more feature pls.
>>
>>61029467

https://play.google.com/store/apps/details?id=com.altfolio.rmgsoftware
>>
>>61031115
You could run it in the hardware if you can find lisp machine somewhere which is unlikely.

>>61031106
Extending the syntax in lisp is easy.
You can't even do that in other languages.
>>
>>61031155
>You can't even do that in other languages.
because you dont need to.
>>
>>61031063
>5+ years of development
>600k lines of lisp code
>posix and self-hosting are not even goals
>has no gui(?)
>multitasking?
So... this is the power of lisp... woah...

Meanwhile, Redox is already capable of running gcc and is nearing self-hosting.
>>
>>61031203
Rust is just as useless and insubstantial as Lisp.
>>
>>61031203
>self hosting
Stupid meme.
>>
>>61031139
STM
CSP
>>
>>61031203
>777
why just give it executable
>>
>>61031203
The guy behind Redox seems really competent desu, and actually has kernel experience.
His interview with lunduke was neat, even though i have no interest in rust or redox.
>>61031229
>not wanting self-hosting
hello lisplet
>>
>>61031233
Expand on this.
>>
>>61031172
This, lispfags are always about muh macros and high level bullshit, but never even give examples.
>muh DSL
Such a slow language too.
>>
>>61031222
>he's provided with the evidence the statement he's about to post is false in the post he's answering to
>still posts it
y tho
>>61031229
Literally, the first thing you should aim for unless you're making an embedded RTOS.
>>
File: 1490039632710.jpg (580KB, 1000x706px) Image search: [Google]
1490039632710.jpg
580KB, 1000x706px
For a struct that has only 2 fields: a pointer and a size_t, would it be cheaper to pass by const reference or by value? given the default copy constructor is used.
Is it worth the extra syntax bloat to pass it by const reference?
>>
>>61031222
>Leaf and Servo were written in a fraction of the time of their big C++ contemporaries and they outperform them too
Right.
>>
>>61031294
>>61031320
No one uses Rust. It will never succeed in the industry.
>>
>>61031203
How many people work on redox?
The author of mezzano wrote his own compiler as well
>>
>>61031304
pass the value
>>
>>61031275
Lazy sequences
Maps
Runs on JVM
Java interop
>>
>>61031304
Wouldn't the compiler be smart enough to optimize a const reference to a a value in cases where that is more efficient?
>>
>>61031222
>>61031294
>>61031320
>>61031330
Rust is the opening salvo in a war to control what programming languages you legally can or can't use. Its very existence is a threat to free speech and gun ownership.
>>
>>61031399
Stop false flagging, faggot. Rust is hot garbage, nothing more.
>>
>>61031395
>trusting the compiler to """optimize"""
>>
>>61031418
>using a HLL when you don't trust the compiler to handle optimization
>>
>>61031359
>How many people work on redox?
More than one, that's for sure, and this is the sign of how easier it's to jump right into some unknown Rust code than into some hairy lispy mess.
>The author of mezzano wrote his own compiler as well
So the language doesn't support effective code reuse, I see. Meanwhile, Redox team takes a lot from rustc, libstd, for example.
>>
Lispfags btfo'd.
>>
>>61031417
This isn't a joke or a troll you petulant little ostrich. There's an ongoing campaign to portray C/C++ as dangerous, backwards, and "unsafe." You've seen their posts here on /g/, haven't you? How can you be blind like this?
>>
File: 1467008649838.jpg (155KB, 753x706px) Image search: [Google]
1467008649838.jpg
155KB, 753x706px
>spend literally all of 3 days writing a bash script to delete entries in an existing sqlite database
I'm not cut out for this, am I?
>>
>>61031514
>nearly destroy the industry
>play victim
>>
>>61031514
A loud minority on /g/ is trying to do this. ON /g/! Let that sink in for a moment. You really think everyone is going to suddenly think, "Hey, those noisy, shitflinging apes on /g/ have a good point. Time to spend time and possibly tons of money rewriting our entire codebase!" It just ain't gonna happen.
>>
>>61031495
>So the language doesn't support effective code reuse, I see.
Uh, where are you getting that from?

>>61031514
It is entirely true that C and C++ do provide little protection from incorrect code. They're fine for good programmers like Linus, but in big enterprise projects with hundreds or more contributors, many of whom are idiots, and where the schedule is so tight that spending time verifying code simply isn't an option, safety does become an issue. It's why Java became so important. The main reason Rust is not an adequate replacement for C is not because the "safety" issues in C are nonexistent or irrelevant, but because Rust currently lacks many of the advantages of C, namely being widespread, having a dynamic library pre-istalled on most platforms, and having a simple ABI allowing it to interface with nearly any language with little effort. When Rust can provide those things, and a code generator as efficient as the best C compilers, then it can be a suitable replacement. Its use of "unsafe" blocks IS a good idea IMHO - it lets you use "unsafe" code where you need to, while allowing the code to be clearly marked as such.
>>
>>61031514
C/C++ ARE backwards, dangerous and unsafe, that's why people use them, because the future is less efficient, and because safety is slow in one way or another and can be limiting
>>
>>61031203
Posix and Unix are memes anyway and need to be replaced by something new and better(both shouldn't be all that hard to do by OS and kernel developers).
>>
>>61031608
> Uh, where are you getting that from?
From the fact that the author of mezzano decided to write his own compiler instead of reusing any of the freely available ones.
>>61031661
I actually agree with you in principle, but supporting posix gives you a ton of fine software for free, even MS has realized it.
>>
>>61031589
>>61031599
>>61031608
>>61031614
You're all beyond help. Don't come crying to me when they take away your C compilers and your guns.
>>
>>61031614
The whole point of Rust is to use STATIC safety, meaning the only thing it worsens is compile time (which isn't usually that important - and furthermore, C++ is horrendously slow at compiling due to issues that have nothing to do with safety, fixing those issues will make Rust actually faster at compiling). Even C++ made some movements towards safety, such as classes (commonly used to provide implicit RAII) and vectors (which are a safer, but slower alternative to arrays). Rust on the other hand, provides even greater safety than C++, but without the run-time cost, and like C++, does give you the option to give up safety when you would rather have power. But you have to do it explicitly, so anyone editing your code later on KNOWS they need to watch their step.

>>61031661
Great, so we'll be back to the 1960s when everyone had their own incompatible standards.
>>
>>61031707
I didn't say people shouldn't use C
>>
im saying it.
We need a graphics API not written in C so we can finally move on.
>>
>>61031548
Persistence trumps talent

https://www.youtube.com/watch?v=KxGRhd_iWuE
>>
>>61031707
Please explain how someone is going to "take away" my C compiler merely by producing a language with better safety features?
>>
>>61031707
There's really nothing to worry about. Rust is too different for the common programmer.
>>
>>61031766
Vulkan is C++.
>>
>>61031766
C is lingua franca because of its stable ABI. Just wrap C in your favorite meme language and be done with it.
>>
>>61031766
>not written in C
So graphics API for one specific language, nah C ABI is just fine.
>>
>>61031746
>Great, so we'll be back to the 1960s when everyone had their own incompatible standards.
I just said that it needs to get replaced by something better and newer.
Also the most used operating systems aren't POSIX complaint anyway.
>>
File: CheesePizza-0011.jpg (618KB, 1200x674px) Image search: [Google]
CheesePizza-0011.jpg
618KB, 1200x674px
>>61031781
Certain combinations of 1s and 0s are already illegal, it's only a matter of time until C compilers are part of those.
>>
File: 2017-06-22-163411_776x904_scrot.png (524KB, 776x904px) Image search: [Google]
2017-06-22-163411_776x904_scrot.png
524KB, 776x904px
The current state of lisp fags.
>>
>>61031875
Who gives a shit? Why even waste your time with a dead language?
>>
>>61031825
> Also the most used operating systems aren't POSIX complaint anyway.
Not certified, no, but you'd be hard press to find a major OS which is not POSIX-complaint to some degree. Even Windows is now POSIX-complain with WSL.
>>
>>61031514
Well duh. It's just marketing and hype. On /n/ there is a thread RIGHT NOW saying 1 gear in the front is the future of mountain bikes and triple chainrings are dangerous. It applies to every industry and every form of technology. It's called FUD.

Java is a good language for the most part, but failed to kill C/C++ because it isn't as fast mainly. Keep in mind though, that in most circumstances, "safety" is not life and death unless you are writing defense or medical applications.
>>
>>61031320
>Right.
Right what?
Just writing new engines in C++ again would probably have similar gains just by virtue of hindsight.
>>
C newfag here, where to learn about threads and networking.
>>
jvm app vs web app?
>>
>>61032022
google, manpages, this one's got example of simple threading https://linux.die.net/man/3/pthread_create
>>
>>61032029
native apps are dead my man
>>
File: julia.jpg (140KB, 2048x1536px) Image search: [Google]
julia.jpg
140KB, 2048x1536px
Does your language make implementing complex objective functions possible?
>>
>>61032077
>objective
>object
muh poo
MUH POO!!!
>>
>>61032077
The fuck does that even mean?
>>
>>61032099
>can you add and subtract numbers in your language?
>well, can you?
>didn't think so


inb4 >and
>>
>>61032077
Now explain that in brainlet terms
>>
>>61032099
>>61032124
I have no idea, I was hoping someone here will explain it to me.
>>
File: idris trap language.png (3KB, 332x37px) Image search: [Google]
idris trap language.png
3KB, 332x37px
Are your programming socks ready?
>>
>>61032124
Something haskell fags call others when their religion is threatened.
>>
>>61031825
And that something better is going to have barely any compliant operating systems. POSIX only chose Unix as the base because Unix derivatives were ALREADY popular and well established.

>>61031875
At l east Lisp doesn't generate 6MB of garbage per second.

>>61031952
Safety is pretty important if you're writing kernels, drivers, or anything that has to do with security.
>>
I'm starting to use reddit.
This place is garbage, absolutely no discussion and just memes like >>61032093
>>
>>61032137
>addIfRight
B-but how do I know which of my socks is the right one?
>>
>>61032150
nigga, its 1gb/s
>>
>>61032140
>Julia
>Haskell

They're practically opposite languages
>>
>>61032150
> Safety is pretty important if you're writing kernels, drivers, or anything that has to do with security.
Everything has to do with security nowadays tho.
>>
>>61032159
The right sock is made with a left-end toe in mind
>>
>>61032099
>complex
either "complicated" or "partially imaginary"
>objective function
a function that you wish to maximize or minimize because doing so is your objective
>possible
is in any turing complete language
>>
>>61032162
Exactly, so Lisp is at the very least 170 times better than H*skell.

>>61032182
I don't think there's much harm that could come from security exploits in a notepad equivalent for example.
>>
>>61032199
also possible in many turing incomplete languages
>>
>>61031050
Thanks anon. I'll read on that and hopefully stop being dumb.
>>
>>61032150
Sometimes you just need to start pushing new stuff to make things better or you'll be forever stuck without outdated shitty stuff(Looking at you Windows) and you will just get crap build on crap build on crap until someone loses an eye and stuff.
>>
>>61032309
>Windows
>outdated
You are aware WindowsNT is younger than Linux, macOs and *BSD, and it's actually pretty well-designed without any of that that *nix legacy crap from the 70s.
>>
>>61032309
But you don't do that by pushing standards. You do that by actually making a better operating system, letting people realize how much better is, and once it starts becoming popular start advocating it be used as the basis as a new codified standard of operating system interfaces.
>>
>>61032350
And yet it still has to dress itself up as something DOS-based simply because of muh backwoods compatibility.
>>
>>61032371
It doesn't do that since Win7, m8.
>>
>>61032390
And it hasn't been good since Win7, either.
>>
>>61031781
I always worried if the problem with security/hacking/malware gets so bad that the government tries to take away programming tools, or operating systems don't let you execute or compile unauthorized code. You would need a license or work for some kind of recognized entity to write programs. It would be the end of computing as we know it. The UK would be the first to do this.
>>
>>61030000
I like Rust. \
>Haskell
I like OCaml better
>>
>>61032151
don't forget that two threads had to be deleted because people were fighting over the OP image being a frog or anime image. I finally managed to save the thread by starting a language war to distract from this.

Is the poo meme because Indians love Java and object oriented programming as a result?
>>
>>61032489
That's already the case with iOS and Windows 10 S. You can't run software unless it's in the app store, which requires at the minimum purchasing a license for a few hundred dollars.
>>
>>61031688
That's a non sequitur. Code that runs in one implementation of common lisp runs in any implementation, but that doesn't mean any of them were suitable for bare metal development when he started.
>>
>>61031707
Is it really that hard for you to write a c compiler if you had to?
>>
I can't find a better FP language than JS
>>
>>61032350
I am aware that NT is newer(only by 2 years) than Linux and BSD(macOS(OSX) is newer though but still based on BSD) but that doesn't change the fact that all of them have been building on ages old ideas and architectures. The folders System,system32 and SysWoW64 and Program files are one of the things that should have just been correctly implemented in NT6 but sadly we got the current mess.
>>61032356
The problem is no one has bothered to make something better but just stuck to the old posix ideas and stuck to try to be compatible with linux.
>>
>>61032583
Is JS the only language you know?
>>
>>61032600
of
>>
61032583
61032610
just install the FP lang finder extension :^)
>>
>>61032029
jvm
>>
Is there a portable way to use scanf() to read a decimal value into a short or char variable?
>>
>>61031514
I have a bold statement: Memory safety will kill C++
>>
File: abcd.png (26KB, 766x233px) Image search: [Google]
abcd.png
26KB, 766x233px
Has it finally gone too far?
>>
>>61032665
Ah yes, the B E A U T Y of rust
>>
File: 1495641113909.png (72KB, 1016x98px) Image search: [Google]
1495641113909.png
72KB, 1016x98px
>>61032680
>>
>>61032665
>>61032685
I don't even know which one is worse anymore
>>
>>61031746
>Rust on the other hand, provides even greater safety than C++, but without the run-time cost
>Rust's RAII just magically happens
>>
File: 1488455828323.jpg (71KB, 718x783px) Image search: [Google]
1488455828323.jpg
71KB, 718x783px
>>61032665
>defiling the Ocaml/ML syntax this much
>>
>>61032680
>>61032696
I'm actually incredibly proud of myself now because I've spent like half an hour trying to understand why my mut borrow won't end where I want it to end only to realize I was reusing lifetimes where I shouldn't have and to solve everything by introducing the 'd lifetime.
>>
>>61032696
I judge the readability of a program by the refactoring tools available for it. If there is a solid refactoring tool it means it's easy to read and follow

Sadly, C++ is not one of those languages.
>>
>>61032737
and yet Rust has """""""""""evolved"""""""""""" past C
>>
>>61032709
RAII could be implemented statically. For example, you could have a raii_malloc() function which does the exact same thing as malloc, except a preprocessing program would automatically insert corresponding free() calls to the end of the scope if they are not found.
>>
>>61032753
It actually has, because I've expressed non-trivial memory handling logic without any `unsafe` code and without any runtime overhead.
>>
>>61032739
so java is the best, as I suspected
>>
Why is D so comfy, lads.
module service;

import std.conv;
import vibe.d;

class MongoService
{
private MongoCollection collection;
const string title;

this(MongoCollection collection, string title = "")
{
this.collection = collection;
this.title = title;
}

void index()
{
logInfo("MongoService: GET /");
render!("index.dt", title);
}

void postAdduser(
string username,
string email,
string fullname,
uint age,
string location,
string gender,
HTTPServerResponse res,
)
{
import vibe.utils.validation;

logInfo(text("MongoService: POST /adduser : ", username));
enforce(age < 200, "wrong age");

auto bson = Bson.emptyObject;
bson.username = validateUserName(username);
bson.email = validateEmail(email);
bson.fullname = fullname;
bson.age = age;
bson.location = location;
bson.gender = gender.toLower;

collection.insert(bson);
res.writeBody("");
}

Json getUserlist()
{
logInfo("MongoService: GET /userlist");
return Json(collection.find!Json.array);
}

@path("deleteuser/:id")
@method(HTTPMethod.DELETE)
void pullOutUser(BsonObjectID _id, HTTPServerResponse res)
{
logInfo(text("MongoService: GET /deleteuser/", _id));
collection.remove(["_id": _id]);
res.writeBody("");
}
}
>>
>>61032793
Java is easy to read and easy to follow. Otherwise it would be impossible to track and maintain the shit codes that pajeets produced a couple of years ago.
>>
>>61032800
It just is, my man. It's good that we don't have any attention that attracts shitty devs and sjws (cough*rust)

module quicksort;

import std.algorithm: filter;
import std.array: array;

int[] qs(int[] arr) {
if(!arr.length) return [];
if(arr.length == 1) return arr; // optional
return qs(arr.filter!(a => a < arr[0]).array) ~ arr[0] ~ qs(arr[1..$].filter!(a => a >= arr[0]).array);
}
>>
>>61032800
Because its the c++ that should have been in the beginning.
>>
Ever noticed how D shilling starts every time Rust come up?
The Deep Unsafe must be really afraid.
>>
>>61029991
>Nano is perfectly good though, much better than vim

Topkek. nano is for people who are too lazy and/or stupid to learn Vim or Emacs.
>>
>>61032843
can we just agree that both sides are correct? (in saying that the other one is shit)
>>
>>61032843
Both Rust and D comes up in every thread.
>>>/x/
>>
>>61032843
Some rustlet last night told me my code was bad because it couldn't compile in Rust.
Rust needs to endlessly shill to garner popularity.
D just needs talked about and code snippets to sell itself.
>>
>>61031614
Protecting code from buffer overflow and format string vulnerabilities is really not that hard. Most people just don't bother to learn secure coding, hence why we have crutches like Intel's MPX to accommodate sloppy programmers.
>>
>>61032879
> D just needs talked about and code snippets to sell itself.
It's been talked about for 16 years already, doesn't look like it helped it tho.
>>
>>61031514

>Ongoing campaign
It's literally just one or two trolls.
>>
>>61032895
The switch and split of D1-D2 / tango/phobos really hurt it. But now that were stable, the momentum is coming.
>>
>>61030134
WTF is Smalltalk doing on that list? What fucking year is this, 1989?
>>
>>61032952
You should look lower and notice PHP and fucking Dart
>>
>>61032952
>she doesn't know what year it is
>>
>>61031514
>C/C++ as dangerous, backwards, and "unsafe."
well, it's actually the case, no?
>>
>>61032922
But it isn't special anymore as it was back in the early 2000s. I mean, Rust is better for system programming, C# is better for desktop application development, Go is better for network services, C++14 is not that bad, even Java advancing a bit, and don't forget Swift.
>>
>>61032991
>Rust is better for system programming, C# is better for desktop application development, Go is better for network services,
debatable.
why?
vibe.d
>>
>>61032763
Modern compilers can reason quite a bit about your code and go even further than what you suggest:

#include <cstdio>
#include <memory>

class S {
public:
S(int i) : val(i) {}
virtual void print() { printf("%d\n", val); }
private:
int val;
};

template<typename T>
void sink(std::unique_ptr<T> x)
{
x->print();
}

int main()
{
auto p = std::make_unique<S>(2);
sink(std::move(p));
return 0;
}


Assemby:
main:                                   # @main
push rax
mov edi, .L.str
mov esi, 2
xor eax, eax
call printf
xor eax, eax
pop rcx
ret
.L.str:
.asciz "%d\n"


No calls to new, delete, vtables or anything is there.
>>
>>61032969
Did you, like, not notice I was being facetious?
>>
We should make a hash function
>>
>>61033010
> debatable.
Only if you're a D-fanboy, t b h, nogc is a meme and borrow checker and 2x speed difference is not.
> why?
Because of WPF/UWP/WCF and tons of libraries, the best IDE out there and the MS support.
> vibe.d
Rrrright: https://www.techempower.com/benchmarks/#section=data-r14&hw=ph&test=fortune .
>>
>>61033051
>WPF/UWP/WCF and tons of libraries
What about people that don't suck Bill gate's micropenis?
>>
>>61033065
because it's still the only relevant desktop os?
>>
>>61033051
>and 2x speed difference is not.
id like to see those benchmarks.
>>61033051
>w10 shit thats dead and an IDE that can be done in VS Code
And whats that last link supposed to prove exactly?
>>
>>61033065
Qt is light years more mature and usable than anything D has to offer. Which is most probably half-baked bindings to Qt.
Oh, and Mono is the best way to do cross-platform mobile development.
>>
>>61033079
For computer illiterates
>>61033085
>Qt is light years more mature and usable than anything D has to offer
Qt is C++. C++ is a mediocre language.
>Mono
Might as well use Electron at that point
>>
>>61033085
>Qt
Oh that's C++'s 3rd standard library isn't it?
>>
>>61033079
>because it's still the only relevant desktop os?
This needs to be fixed though, not catered to.
>>
>>61033085
Qt is an outstanding example why C++ is so shit.

Notice that everyone writes gtk bindings and never touches Qt shit
>>
>>61033105
>keck
>>
>>61033133
LMMS is good software
>>
>>61032991
>and don't forget Swift
Don't be ridiculous. When Apple are dead their meme language will be forgotten within an hour.
>>
>>61033165
Yeah, and golly gee, when Canonical are dead their meme language will be forgotten within an hour too!
>oh wait no one will ever forget C oops
>>
>>61033181
Cannonical does not do anything to C, Apple does to swift/Obj-C/C++
>>
>>61033165
Apple is irrelevant considering they only compete with themselves.
>>
>>61033081
>id like to see those benchmarks.
Actually my bad, I confused it with Go, there is not D on the benchmark game. I wonder why.
>And whats that last link supposed to prove exactly?
vibe.d is like 3% of the max performance achieved and thus totally unusable as a serious alternative to Go. It's actually laughable for a compiled language to have php-tier performance. For comparison, in another benchmark, https://www.techempower.com/benchmarks/#section=data-r14&hw=ph&test=plaintext , Rust is on the 4rd place with 92%, Go is on the 7th with 74% while vibe.d has whopping 0.4%.
>>61033095
>Might as well use Electron at that point
We're talking mobile development here. The alternatives are either you write your code two times in Java and Swift, or you write it one time in C# and it works well everywhere. D isn't even an option.
>>61033105
So? It's meaningless to compare languages without the context.
>>61033133
Notice how everyone rewrite their gui from gtk to qt? Wireshark and subsurface for example, the latter is a Torvald's personal project.
>>
>>61033200
Why the fuck do people use the word "relevant" to mean "trendy"? That's not what it fucking means!
>>
>>61033095
>For computer illiterates
i.e. people who buy software you write
>>
>>61033221
>i.e. people who buy software
>buy software
>buy
>software
burn him at the stake
>>
>>61033202
>Notice how everyone rewrite their gui from gtk to qt?
No? Show me some big gtk apps that got rewritten in Qt

>>61033221
I don't write windows compatible software, they are meant for *nix
>>
>>61033198
>Cannonical does not do anything to C, Apple does to swift/Obj-C/C++
Canonical owns C and invented it
I thought this was common knowledge????
>>
>>61033232
>No? Show me some big gtk apps that got rewritten in Qt
https://www.youtube.com/watch?v=ON0A1dsQOV0
https://blog.wireshark.org/2013/10/switching-to-qt/
>>
>>61033202
Have you actually read the source of the benchmarks instead of blindly eating it up as gospel. For one, theres unnecessary casts everywhere. Lots of open issues, many implementation related.

Its trash, and so is Go.
>>
>>61033238
I said big gtk apps, mongrel
>>
>>61033242
>Have you actually read the source of the benchmarks instead of blindly eating it up as gospel.
Okay.
>For one, theres unnecessary casts everywhere.
Okay. Following so far.
>Lots of open issues, many implementation related.
Okay. Still following you.
>Its trash,
Okay. Alright. Agree so far.
>and so is Go.
You lost me.
>>
>>61033242
>LIES D IS STRONK
>>61033246
>LIES GTK IS STRONK
Rrright.
>>
>>61029481

There is no "array of numbers" in JS. You can put anything you want. You can push a string into an array of 1000 numbers. Were you expecting your browser to inspect every object and use a different comparator based on the combination? It's not entirely your fault, though, I've seen seasoned developers fall for this and get stuck for hours at my workplace.
>>
61033267
61033275
Go to bed Rob, no one actually like Go, not even you.
>>
>>61033275
I accept your defeat
>>
>>61033246
ida pro
>>
>>61033287
>Go
Okay.
>to
Got it.
>bed
Yes, understanding so far.
>Rob,
Got ya.
>no
Huh? Oh. Right. Okay.
>one
Got it.
>actually
Yes, yes, go on.
>like[s]
Right. Uh-huh.
>Go,
Wait... I don't follow.
>>
>>61033304
also x64dbg
>>
>>61032800
looks like a retarded version of kotlin
>>
C is better.
>>
>>61033246
LXDE -> LXQt
>>
>>61033341
you mean a better version?
fun main(args: Array<String>) {
println(max(args[0].toInt(), args[1].toInt()))
}

fun max(a: Int, b: Int) = if (a > b) a else b
>>
new thread: >>61033365
>>
>>61033341
Kotlin is a retarded version of Java
>>
>>61033370
see >>61033364
>>
>some people think C is better than D
>some people think D is better than C
>literally exactly one person thinks B is better than C
>everyone else thinks C is better than B
>some people like R
Only on 4chan can you find such zealous opinions on letters of the fucking alphabet.
>>
I think it's funny how threads about general programming topics always devolve into heated arguments over which programming language is better. XD
>>
>>61033384
>XD
>>
>>61033392
>>XD
>>
>people unorincally think this looks good
fun main(args: Array<String>) {
for (arg in args)
println(arg)

// or
println()
for (i in args.indices)
println(args[i])
}
>>
File: sort.png (68KB, 1092x684px) Image search: [Google]
sort.png
68KB, 1092x684px
>>61033284

You know, Ruby and Python also don't have a such thing as an "array of numbers", but they at least manage to exert correct behavior. If two objects can't be logically compared, you should throw an error, rather than try to force them to be comparable by coercing them into strings.
>>
>>61033364
>>61033401
>fun
Fucking bullshit. Programming should not be fun.
>>
>>61033364
Is that supposed to be impressive?
void main()
{
args
.map!(to!int)
.max
.writeln;
}
>>
>>61033430
lad, i meant kotlin is retarded, and bad
>>
>>61033401
>that is unironically not very different from:
int main(int argc, char** argv) {
for (char** arg = argv; arg - argv < argc; arg++)
puts(*arg);

/* or */
puts("");
for (int i = 0; i < argc; i++)
puts(argv[i]);
return 0;
}
>>
>>61033401
In D it's just
 void main(string[] args)
{
args.each!writeln;
}
>>
>>61033448
>lad,
wew
>>
>>61029481
does make sense actually
>>
>>61033401
fun main(args: Array<String>) {
args.forEach(::println)
}
>>
>>61033430

puts ARGV.max_by &:to_i
>>
>>61033482
in ruby this is just
puts ARGV
>>
>>61033511
That prints all args in one line, not in separate line
>>
>>61033529
incorrect
>>
>>61033543
Well, that's just sad. What's the difference between
args.each!writeln and args.writeln?
>>
>>>61033564
arg[0].writeln
arg[1].writeln
arg[2].writeln
vs
arrg[0..$].writeln
>>
>>61033586
Right now see >>61033529

>>61033511 does not make sense
>>
>>61033564
i don't know, i don't write D
but in the analogous ruby code there is no difference
ARGV.each {|a| puts a}

does the same thing as
puts ARGV
>>
>>61033599
>>>61033511 (You) does not make sense
well go whine to Matz about it, not me
puts ARGV
works no matter how you feel about it
>>
>>61033602
Input: ./main abc 123 def
>args.each!writeln
Prints
>abc
>123
>def

>args.writeln
prints
>abc 123 def
>>
>>61033624
Oh and I forgot the ./main
>>
>>61033624
point being what exactly?
input: ruby main.rb abc 123 def

>ARGV.each {|a| puts a}
Prints
>abc
>123
>def

>puts ARGV
prints
>abc
>123
>def
>>
>>61033655
Hint: "each!"
>>
>>61033690
1) there is no such method in ruby
2) even if there were, that would have nothing to do with anything
>>
>>61033655
>puts
Why is it \n terminated?
>>
>>61033426

Absolutely. But javascript is designed for the browser. This often means that it will try to guess what you want instead of hang.

This bug is particularly sinister, as it might appear to be working correctly if your first few numbers aren't imaginative enough. For the default behaviour I might have tried something glaringly wrong (like memory address), but this is also very wrong, no one ever realistically wants a sort like that, in contrast to toString() by default, which is always avaialble.
>>
>>61033701
because that's how puts works in ruby
if you want output without a line break you use print instead
>>
>>61033720
lol trash, it should have been named putStrLn
>>
>>61033746
ruby strongly discourages camel case
that's one of the good things about it in my opinion
>>
>>61033746
by the way, appending a newline is also how puts works in C
>>
So how do you reverse and print an array/list in your language?
>>
>>61033786
puts arr.reverse
>>
>>61033784
C is trash too, what's your excuse?
puts = put string
putstrln = put string in a line

Only idiots will disagree
>>
>>61033786
arr.reverse
>>
>>61033801
>puts = put string
>putstrln = put string in a line
yeah but puts doesn't necessarily mean put string NOT in a line, it just means put string
also it's shorter and putstrln is ugly
>>
>>61033705

I don't want it to guess what I want or to hang. I want it to stop everything and throw an alert in my face. When the site user sees the alert, they'll either stop using the site or spam the admin with emails about how the site doesn't work. Hopefully, this would encourage people to write better code.
>>
>>61033811
arr.dup.reverse

Practice safe programming
>>
>>61033836
yeah but why is javascript the client side web language though
we need a web browser whose client side web language is C
when it encounters a script it compiles the script and dynamically links it into the browser in order to run it on the page
>>
>>61033849
>arr.dup.reverse
not necessary
arr.reverse
copies the array anyway
you might be thinking of
arr.reverse!
which would reverse the array in place
>>
>>61033830
kys = kys and NOT your family too bot now one says that
>>
>>61033861
>is c
oh boy cant wait for more heartbleeds
>>
>>61033430
Is THAT supposed to be impressive?
Take that garbage out of here.
>>
>>61033908
Post yours
>>
>>61033883
>kys = kys and NOT your family too
not necessarily, it just means kys, whatever else happens is decided by the implementation and should be documented
>bot now one says that
this part of your sentence is gibberish
>>
>>61033913
not him but
puts ARGV.map(&:to_s).map(&:to_i).max
>>
>>61033761

PascalCase for classes and modules
snake_case for methods
SCREAMING_SNAKE_CASE for constants.

>>61033861

Nah, too easy for vulnerabilities to arise in websites and too difficult for webdevs to learn. A scripting language would be ideal for client side web programming, though it would have been nice were it something like a Lisp. Anything with strong typing would have been decent.
>>
>>61033946
Absolutely disgusting
>>
>>61033958
>mixing pascal case and snake case
jesus christ how horrifiyng
>>
>>61033946
>two maps
>two convs
kek
Why did you even try
>>
>>61033946
>current state of ruby
>>
>>61033970
oops you're right this is more efficient
puts ARGV.map do |arg|
arg = arg.to_s unless arg.respond_to?(:to_i)
arg.to_i
end.max

muh bad
>>
>>61031793
no it isn't u faggot
>>
>>61033988
>>61034003
see: >>61034009
>>
>>61034009
Even kotlin example was nicer than that garbo you just posted
>>
>>61033946
See
>>61033505

Also, your first map is unnecessary because ARGV comes in as an array of strings.
>>
>>61034009
3/10
>>
>>61034036
see: >>61034032
>>
>>61034051
>>61034036
>>
>>61033430
Please include your imports if youre going to post with mains.
>>
>>61033946
>>61034009
>webdevs
when will they learn?
>>
>>61034041
>puts ARGV.max_by &:to_i
oh shiiiiit
>Also, your first map is unnecessary because ARGV comes in as an array of strings.
OH SHIIIIIIIIIIIT
>>
>>61034072
>ruby is webdev
1) wrog
2) seeb: >>61034041

>>61034063
seeg: >>61034041
>>
>>61034095
ruby is a webdev language, wtf are you blabbering?
>>
>>61034122
>ruby is a webdev language,
1) wrng
>>
>>61034142
Are you having a mental breakdown? Ruby IS a webdev lang
>>
>>61033913
This is objectively better:
#include <stdio.h>
#include <stdlib.h>
#include <limits.h>

int main(int argc, char *argv[])
{
long max = LONG_MIN;

for (++argv; *argv; ++argv) {
char *ptr;
long n = strtol(*argv, &ptr, 10);

if (ptr == *argv)
fprintf(stderr, "Invalid argument: '%s'\n", argv);
else if (n > max)
max = n;
}

if (argc > 1)
printf("%ld\n", max);
}
>>
>>61034122
the largest ruby project is metasploit, and it's not a web application
>>
>>61034165
>This is objectively better:
it is not.
>c will never have basic type properties
>>
>>61034159
>Ruby IS a webdev lang
1) wong
>>
>>61034195
>Ruby is a programming language from Japan (available at ruby-lang.org) which is revolutionizing the web.

>the web
>not a webdev lang
???
>>
>>61034212
>Ruby is a programming language from Japan (available at ruby-lang.org) which is revolutionizing the web.
1) yres
>the web
2) yebs
>not a webdev lang
3) corrcet
>>
>>61034193
I was going to compare the two, but your shitty D example doesn't even compile.
Fucking deadlang.
>>
>>61033849
One of my main arguments against highly abstracted languages like Python, which is that most Python programmers haven't the foggiest clue what they're doing, because in Python you don't have to. A mindless programming language that does everything for you is a recipe for sloppy programming.
>>
>>61033986
You've never seen Ada_Case, have you?
>>
File: Screenshot.png (51KB, 802x349px) Image search: [Google]
Screenshot.png
51KB, 802x349px
>>61034238
>not a webdev lang
>>
>>61034252
this is good enough right, that guy wasnt me.

void main()
{
import std.stdio : writeln;
import std.algorithm : map;
import std.conv : to;
auto arr = ["1","2","3"];
arr.writeln;
arr.map!(to!int).writeln;
}
>>
>>61034252
Maybe you should try using a D compiler then.
>>
>>61034329
>Ada_Case
HEEEEEGH
HOOOOOOOOOOOOGH
HUUUUUUUUUUUUUUUUUUURGH
excuse me let me just go get something to wipe that up
>>
>>61034342
"Ruby is dying" in a WebDev context implies that it was once mistakenly regarded as a WebDev language, but is no longer considered such.
>>
Ruby is no more a web language than Python is. That is, while a number of users use it for web programming, it was not designed specifically for that purpose, and that is not its only use.

>>61034281

A different language for a different purpose. Sometimes you need to be able to hack together a program in 5 minutes, and that typically requires piecing together a bunch of modules you didn't build, sloppy or not.
>>
>>61034342
>being on r/webdev makes you a webdev lang
>you googled something that led you to r/webdev
>one of the links is visited
>therefore you were on r/webdev
>being on r/webdev supposedly makes you a webdev lang (reit 1)
>therefore you are a webdev lang
>qed
>>
>>61034238
>>not a webdev lang
>3) corrcet
Good question, what is Ruby good for? I mean it's slow as fuck, looks like shit and the community is full of substandard programmers
>>
>>61034170
The biggest framework of ruby is a webdev framework
>>
I hate using underscores all the time. Having to keep pressing and releasing the Shift key while reaching for the [-] key over and over with my pinky is a pain in the ass. I actually use spaces in my filenames like a normie.
>>
>>61034398
Because only WebDev people call libraries ``frameworks".
>>
File: Screenshot.png (45KB, 887x329px) Image search: [Google]
Screenshot.png
45KB, 887x329px
>>61034371
>>
>>61034378
Its implementation of OOP is highly reflective and allows for rare niche features such as stateful mixins and traits and while there are other niche features it allows for it just so happens these specific two are crucial to object oriented game programming but you can't really do 3d game programming since the language is slow but i want to make games inspired by earthbound anyway which was a 2d game and it's difficult to imagine a 3d game inspired by it
>>
>>61034411
Sorry to see that's the biggest library you got
>>
>>61034423
mixins and traits are not unique features of ruby
>>
>R*by
Not programming related
>>>/g/wdg
>>
>>61034419
>he googled what is ruby good for
>inherent to this question is the assumption that ruby is good
>he officially thinks ruby is good
>i am winned
>>
>>61034438
no they are not but:
1) stateful ones in particular almost are
2) other languages with mixins and traits are equally slow and also too weird
>>
File: Screenshot.png (37KB, 735x428px) Image search: [Google]
Screenshot.png
37KB, 735x428px
>>61034447
>>
>>61034423
I like the "pure OOP" approach that Ruby uses, where each object contains (at least on a logical level) an infinite tree of member objects. I like it because it's consistent and theoretically infinitely extensible.
>>
>>61034465
>other languages with mixins and traits are equally slow
Highly doubt that. Ruby is probably the slowest "language"
>>
>>61034471
>he can selected an textwords
wow i am v impress
>>
File: Screenshot.png (110KB, 958x395px) Image search: [Google]
Screenshot.png
110KB, 958x395px
>>61034489
Your tears are delicious
>>
>>61034485
Pretty sure Python is slower.
>>
>>61034499
>it are le meme in which he are selected an textwords
>am impress
>>
>>61034398
metasploit framework has 4 times more LOC than rails (over 1 million) and it's not a webdev framework

>>61034329
one of my classes had us write ada, but that was a couple of years ago
>>
>>61034485
PHP tends to run slower for me.
>>
File: Screenshot.png (101KB, 1151x598px) Image search: [Google]
Screenshot.png
101KB, 1151x598px
>>61034502
Ruby is literally the slowest ""programming"" language
>>
>>61034530
that graph shows that lua and python are both slor
>>
File: Screenshot.png (52KB, 623x355px) Image search: [Google]
Screenshot.png
52KB, 623x355px
>>61034512
Nice koders you got there
>>
>>61034530
>Perl and Erlang aren't programming
>>
>>61034544
But not as much as R*by
>>
>>61034548
this is an image board
>>
>>61034557
webdev is not programming
>>>/g/wdg
>>
>>61034544
This person apparently can't read box-and-whisker plots.
>>
>>61034378

Same shit Python's good for: quick scripts.

>>61034427

To be fair, it's a very bloated library, so it would be the biggest library in any language it were implemented in. An exception maybe given to Qt, since nothing is bigger than Qt. Texas is smaller than Qt.

>>61034443

>General purpose programming language
>Not programming related
>>
>>61034565
>Perl and Erlang are WebDev languages
>>>/trash/
>>
>>61034530
kek how can a language manage to be slower than Hasklel, it's pathetic
>>
>>61034558
yes as much as ruby
"slor" was supposed to be durspeak for "slower"
that graph shows lua and python are both slower than ruby
>>
>>61034584
Haskek is compiled.
>>
>>61034586
>slowest record out of the chart
>belongs to R*by
no wonder there
>>
>>61034581
>General purpose programming language
It's a webdev language, not programming language
>>
File: ss-2017-06-23-01-48-20.png (242KB, 974x736px) Image search: [Google]
ss-2017-06-23-01-48-20.png
242KB, 974x736px
>>61034530
yep
>>
>>61034581
Python with PyPy is pretty fast, ruby is an embarrassment
>>
>>61034600
No, the slowest record is for Lua.
>>
File: ss-2017-06-23-01-50-40.png (317KB, 938x905px) Image search: [Google]
ss-2017-06-23-01-50-40.png
317KB, 938x905px
>>61034617
I meant to include python
>>
>>61034617
>>
>>61034628
>Lua
R*by
>>
>>61034639
post github link
>>
>>61034639
>uses less memory than C#, Python or Javascript
>>
>>61034612

https://en.wikipedia.org/wiki/Ruby_(programming_language)

>Ruby is a dynamic, reflective, object-oriented, general-purpose programming language. It was designed and developed in the mid-1990s by Yukihiro "Matz" Matsumoto in Japan.
>According to its creator, Ruby was influenced by Perl, Smalltalk, Eiffel, Ada, and Lisp.[11] It supports multiple programming paradigms, including functional, object-oriented, and imperative. It also has a dynamic type system and automatic memory management.
>>
>>61034685
Anyone can write a wikipedia article. No one uses ruby without rails, which is a web framework
>>
>>61034684
memory is cheap

>>61034700
why are you ignoring the posts about metasploit? fuckon of pentesters use ruby without rails (except those who do webdev on the side)
>>
>>61034719
skid shit is not programming
>>
>>61034700

>No one uses ruby without rails
I do. The guys who wrote metasploit do. Same for the dude that made Homebrew, although he can't invert a binary tree.

>>61034726

>All of these things which involve programming are not programming because I say so
Why do you still choose to draw breath on this Earth?
>>
>>61034726
>manually finding vulnerabilities and writing exploits for them
>skid shit
okay
>>
>>61033314
autism
>>
>>61030730
As long as they're loaded before the calling file, then yes, subsequent JS files can call functions from previously loaded files. Otherwise no jQuery stuff used thru CDNs, for example, would work.
>>
>>61032159
If it isn't, just run
sock.split('').reverse().join('');
Thread posts: 452
Thread images: 47


[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.