[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: 325
Thread images: 39

File: 1481234393653.png (102KB, 1000x1071px) Image search: [Google]
1481234393653.png
102KB, 1000x1071px
What are you working on, /g/?

Old thread: >>58232551
>>
File: anime.png (201KB, 335x365px) Image search: [Google]
anime.png
201KB, 335x365px
Functional programming thread; >>58212017
>>
so i wrote an operating system in haskell but it literally broke my pc? i press the power button and nothing happens anymore, i even replaced my hdd and ssd and it doesn't power on, wtf?
>>
>>58240012
Spent 15 minutes on writing a solution to a discussion in a meme thread.

-module(countdown_gen).
-behaviour(gen_server).

-define(SERVER, ?MODULE).

-export([start_link/1]).

-export([init/1, handle_call/3, handle_cast/2, handle_info/2,
terminate/2, code_change/3]).

start_link(Start) ->
gen_server:start_link({local, ?SERVER}, ?MODULE, [Start], []).

init(Args) ->
[Start] = Args,
self() ! iterate,
{ok, Start}.

handle_call(_Request, _From, State) ->
{reply, ok, State}.

handle_cast(_Msg, State) ->
{noreply, State}.

handle_info(iterate, State) when State > 200 ->
io:format("~p~n", [State]),
self() ! iterate,
{noreply, State - 13};

handle_info(iterate, State) ->
{stop, "Clean Exit Reached", State};

handle_info(_Info, State) ->
{noreply, State}.

terminate(_Reason, _State) ->
ok.
>>
>>58240032
Stop splitting /dpt/ you sick fucks
>>
Applying for another PhD application. Woo!
>>
Someone please post the current programming challenges list.
>>
>>58240064
Functional programming isn't programming, hence why it doesn't belong here.
>>
>>58240078
No. That stupid crap only shits up the thread with pointless rolling posts.
>>
>used to program a lot every day working on a lot of different projects
>get hired by Google
>start working at the company
>get home every day tired
>just laze around the house playing videogames until it's time to go back to work again

How do I start coding for fun again? This is breaking my soul
>>
>>58240070
Stanford or MIT, I assume?
>>
>>58240053
Haskell has made your computer pure. No more mutable state for you.
>>
File: 1479540322452.jpg (263KB, 550x778px) Image search: [Google]
1479540322452.jpg
263KB, 550x778px
>>58240012
Well after around 2 years of doing fuck all I'm ready to start programming again. I'll be freshening up on C and will probably look into algorithms and data structures. Wish me luck!
>>
>>58240090

WSU. First application was to UW, which is still pretty well rated. MIT would be... a shot in the dark, and I'm not really certain I could get in there. I've got research positions on my CV, and decent GRE scores, but I'm not literally the smartest researcher in the fucking country. Also, the deadline was December 15th. Stanford... I really don't want to spend 3-5 years living in California. In fact, if possible, I should like to never live in California if I can avoid it.
>>
>>58240138
Good luck, Anon!
>>
File: avatar.jpg (96KB, 480x581px) Image search: [Google]
avatar.jpg
96KB, 480x581px
>>58240138
>C
>algorithms
>data structures
You can do it anon.
>>
>>58240143
>Ruby !Sempai.oWA
Very important to the discussion at hand!
>>
What I've gathered from /dpt/ is that I should use C for personal projects, Java for getting a job, and assembly and Haskell for impressing my friends on /g/.
>>
>>58240147
>>58240181
Thank you. I really needed that boost.
>>
I want to learn C. Should I use the K&R book for learning or as a reference? I only know Python.
>>
>>58240255
yes but there are some things in that book that aren't correct in newer versions of C
>>
>>58240143
>I should like to never live in California if I can avoid it
but you'd be cool with living in eastern washington? it's just another shitty desert hell
>>
>>58240143
Do you have a particular area of Informatics in mind as your research direction?
>>
File: fragezeichen yui.png (94KB, 396x395px) Image search: [Google]
fragezeichen yui.png
94KB, 396x395px
http://www.sndio.org/tips.html#section_8

>Anyway, using multiple threads to handle audio I/O buys nothing since the process is I/O bound.

If multiple threads aren't necessary in sound programming, how do I play back two or more WAV files more or less concurrently? What kind of data structure should I be looking at to manage this, if not just a bunch of threads?
>>
>>58240338
Loop through all your currently playing streams, and mix them
Repeat
>>
>>58240338
use epoll or equivalent
>>
>>58240338
combine samples from both files into the same buffer. the process of playing the buffer is synced to the sample rate of the output device, but you can use a swap chain (have one thread play a "front" buffer while another thread populates a "back" buffer to be played next) if you want
>>
>>58240053
>move mouse
>recomplie computer because state has changed
>>
>>58240431
we need to have make respond to input events

2ez
>>
>>58240338
You mix them together like SDL_mixer does.
>>
>>58240375
>>58240360
Mixing would literally just be the integer value of each sample divided by the number of currently playing files, right?

Even with say, 8 or 16 files at once (a la a dum machine/sampler) this would be fast enough to fill up the buffer in time?
>>
File: oemt4qm7no6y.jpg (48KB, 1256x1041px) Image search: [Google]
oemt4qm7no6y.jpg
48KB, 1256x1041px
What's up with Rust circlejerk today? There were like 6 articles today about how Rust is the best thing after sliced bread and literally Software's Salvation.
>>
>>58240475
Rust subreddit was haskelled lately.
>>
>>58240475
https://www.reddit.com/r/rust/
>>
>>58240475
Rust is not very good
>>
>>58240475
until the linux api comes with a rust variant, I'm not using rust
>>
>>58240461
Usually mixing is done at higher bit depth, and then normalized back to 16 bits
>>
>>58240461
>>58240522
and i think you'd want it to be additive. if i'm not mistaken, averaging would make it so that if you played a loud stream and a quiet stream together, the final result would be quieter than the louder stream alone
>>
>>58240338
>>58240461
Also: I'm guessing I should use a linked-list to manage currently playing WAVs? Since the number will fluctuate and any given file in the order can end at any time?
>>
>>58240542
>you'd want it to be additive
this

if you turn up one fader on a mixer, the rest of the tracks don't get quieter
>>
>>58240475
Yesterday Steve, the main fucking reason people on here bitch about rust because he's a massive hipster faggot, got in a blog argument with the language creator. In it he made some "monads are burritos" level of bullshit involving mario and fireflowers. Then a bunch of other people made fun of him for meme'ing by meme'ing harder at him in an ironic way.

Honestly, it's something all of /g/ should understand as that's basically all we do here all day.
>>
File: tYVLN61.png (45KB, 500x500px) Image search: [Google]
tYVLN61.png
45KB, 500x500px
>>58240475
>Rust is about productivity
http://www.ncameron.org/blog/rust-is-about-productivity/
>Why Rust?
http://anowell.com/posts/why-rust.html
>Rust is Software's Salvation
https://redox-os.org/news/rust-is-softwares-salvation-17/
>Rust is more than safety
http://words.steveklabnik.com/rust-is-more-than-safety
>Rust is mostly safety
http://graydon2.dreamwidth.org/247406.html
>Safety is Rust's Fireflower
https://thefeedbackloop.xyz/safety-is-rusts-fireflower/
>Fire Mario, not Fire Flowers
http://words.steveklabnik.com/fire-mario-not-fire-flowers
>Fire Flowers and Marios: Marketing Rust
https://medium.com/@ag_dubs/fire-flowers-and-marios-marketing-rust-996b3fdbe8f3#.f1bvjhkff
>>
>>58240064
I'm fairly happy that they can move there. It's a very different kind of programming from the imperative/procedural/structured/etc paradigms.
>>
File: blessed keks.gif (2MB, 300x174px) Image search: [Google]
blessed keks.gif
2MB, 300x174px
>>58240593
>>58240597
>even Haskell hasn't reached this level of autism
>>
>>58240607
The difference is that the rust people are doing it in a self-aware way. The haskell autists would be doing this in earnest.
>>
>>58240614
>just pretending to be autistic
>>
>>58240593
is Steve the reason people say Rust is full of sjws?
>>
>>58240642
Nope. The reason people say rust is fulla SJWs is that rust is fulla SJWs.
>>
File: webdev_is_literally_patriarchy.png (45KB, 719x587px) Image search: [Google]
webdev_is_literally_patriarchy.png
45KB, 719x587px
>>58240642
Gee, I don't know: https://medium.com/@ag_dubs/fire-flowers-and-marios-marketing-rust-996b3fdbe8f3#.le618f8uc
>>
File: a_faggot.jpg (117KB, 1920x1080px) Image search: [Google]
a_faggot.jpg
117KB, 1920x1080px
>>58240631
I'm not saying it's _not_ autistic...

>>58240642
Pretty much. A lot of the main team is pretty chill and just goes along with it to avoid friction. Steve is a passive-aggressive Ruby faggot who has unironically used words like intersectionality. He's been called out before, but instead of owning up to it he bitches and then crawls under the team's skirt. I was using Rust will in it's pre-release development and remember what it was like before he showed up. Not only is he a faggot personally, but he brought more rails douchebags with him.

pic related: the panty-waist xerself
>>
So for my portfolio on shithub for software engineering jobs, I have:

>shmup written in Lua
>basic django site
>java snake clone

Think that'll do for the moment for entry level jobs?
>>
File: ruby irl.png (266KB, 339x589px) Image search: [Google]
ruby irl.png
266KB, 339x589px
>>58240702
>>
File: steve-klabnik.jpg (16KB, 240x240px) Image search: [Google]
steve-klabnik.jpg
16KB, 240x240px
>>58240708
The nose knows
>>
>>58240688
that is a good article and the tweet isn't written by the author
>>
>>58240707
>writing a shmup in the cutest language
you qualify for an entry level bf desu
>>
>>58240732
Ada is much cuter than Lua
>>
>>58240732
>the cutest language

I'm glad I'm not the only one who has a hard-on for Lua's cuteness.

>>58240739
You shut your whore mouth. Does Ada have a clean and simple source code that can fit in an L1 cache?
>>
File: fFMLSDw.jpg (148KB, 3106x1678px) Image search: [Google]
fFMLSDw.jpg
148KB, 3106x1678px
>>58240727
It spawned 24 hours of autism. Not really effective and therefor not a good article. His point isn't wrong, he's just an asshole.
>>
>>58240765
>he

did you just?
>>
File: ada.gif (23KB, 399x310px) Image search: [Google]
ada.gif
23KB, 399x310px
>>
The hipsters are trying to create artificial hype for <the new best language>. Because it's new they can later claim that they have there from the start. Because it's new they can implement some simple library and say that they have been maintaining the language libraries for n years.
Because it's new every flaw "will be fixed" because it's still in development.

Don't fall for the Rust/Go/Clojure/... meme
>>
>>58240790
Add Haskell to that list
>>
I just want C with RAII without all the garbage C++ has
>>
>>58240821
So Vala without the object orientation?
>>
How do I use a .jar file with a file and import stuff from it?

In the java file I try to do "import algs4.StdRandom;" at the start, and I have algs4.jar in the same folder. It just says that algs4 doesn't exist.

I try "javac -classpath ".;/home/anon/Desktop/Alg/1/;" PercolationStats.java" but it says the same thing.
>>
>>58240817
Haskell is not new
>>
>>58240844
still gets hipster-meme'd
>>
>>58240867
Haskell is good
>>
>>58240867
Haskell hasn't been hipster-meme'd for a couple of years now. Hipsters moved on to Rust, Go, and JavaScript.
>>
>>58240821
>without all the garbage C++ has
so without the C parts? yeah, me too
>>
>>58240893
GIGABYTES PER SECOND OF GARBAGE COLLECTION
>>
>>58240905
that would be java but with silly ruby syntax
>>
>>58240906
yes?
>>
>>58240941
yes.
>>
>>58240999
yes
>>
>>58240821
> C with RAII without all the garbage C++ has
Literally Rust.
>>
>>58240732
>:3
>>
>>58241007
It's literally gay, is what it is.
>>
>>58241020
>;3
>>
>>58241024
Should fit you like a glove then?
>>
>>58241007
I actually was going to say that, but it uses things like UTF-8 and non-null terminated strings which don't feel very C like. It has too many restrictions so you cant do stupid, yet fun stuff you can do in C.
>>
File: 1415995482008.jpg (27KB, 640x477px) Image search: [Google]
1415995482008.jpg
27KB, 640x477px
What area of programming can i make the most money from whilst putting in the least amount of effort?
>>
>>58241075
God says...

Kill yourself
>>
>>58241075
I know what area you can make the least money with the most effort.
Functional Programming
>>
>>58241075
web dev
>>
Partially implemented xmonad style screen independent tabs for awesomewm to make my real development workflow more effective. I'll do the rest later.

For those interested, add this code somewhere above the keybindings:
function move_tag_to_screen(tag, mscreen) 
local clients = tag:clients()
for key,value in pairs(clients) do
awful.client.movetoscreen(value, mscreen)
end
end

function steal_clients(tag_index, mscreen)
mc = mouse.coords()
for s = 1, screen.count() do
move_tag_to_screen(tags[s][tag_index], mscreen)
end
mouse.coords(mc)
end


Then put:
steal_clients(i, screen)


under the existing line:
awful.tag.viewonly(tags[screen][i])
>>
>>58241075
Malware embedded in ads or ransomware.
>>
>>58241007

Except that Rust's safety bullshit makes that a problem.
>>
>>58241101
Shoo shoo C# shill.
>>
>>58241075
prepping the bull
>>
>>58241101
   unsafe {

}
>>
>>58241101
>manageable safety
>somehow bad
You can alway turn bound checking off and use CString if you hate youself.
>>
>>58241144
>no way to use epoll in rust

trash
>>
>>58241144

The point is that Rust is not 'C with RAII', it's an entirely different beast.
>>
File: rust.png (25KB, 799x215px) Image search: [Google]
rust.png
25KB, 799x215px
>systems programming language
>can't work with the system
>>
What does /dpt/ think of the no (You)s?

An easy fix, sure, but still doesn't feel the same.
>>
>>58241210
Except, you know, via the C api directly, or via mio, a library which makes a Rust api directly on top of epoll.
>>
>>58241244
>an easy fix
Yeah, I can't believe Moot didn't do it sooner
>>
>>58241244
Have some dots.
>>
>>58241244
They were always an ugly hack, and spawned annoying memery.
>>
File: 76.png (17KB, 900x900px) Image search: [Google]
76.png
17KB, 900x900px
What are vectors?

Just the x and y position of a point? Is that a vector?
>>
>>58241253
They're an extension of a field
>>
>>58241253
>Is that a vector?

Don't. You'll summon it.
>>
>>58241243
Rust can't into select(), because Rust can't into fd_sets at the same cost as C does. No proper macros, you see -- only that godawful_bullshit!(with_the_exclamation_point_for_clarity);, you see.

They also don't have a way to do indefinitely recursive macros, such as for a Haskell-like "do" syntax.
>>
>>58241253
This is pretty good stuff to get a pretty so-so grasp on linear algebra
https://youtu.be/kjBOesZCoqc
I really enjoy the geometric explanations that math professors rarely deliver well.

It reeks of reddit but it's pretty OK.

But I'm not sure if you're seriously wondering because you posted the meme frog.
>>
>>58241309
they could just make fd_set and opaque type in rust and handle it using the FFI

but they wont
>>
>>58241243
They mean in an idiomatic fashion. You could always use raw fd in rust, you mong.

also
>2014
It's not even true anymore. There IS an epoll api now. Even a high level one that works in terms of futures that compiles down to a simple state machine.

>>58241309
>Rust can't into fd_sets at the same cost as C does

Wrong. There is no overhead in calling C apis.
>>
>>58241332
Because it already exits:

https://github.com/nix-rust/nix
>>
>>58241092
Reminds me of a random anon boasting he was making a very livable salary via making and selling WordPress themes iirc.
>>
>>58240821
you know you can pick and choose which "garbage" to use, right? and you don't have to use OOP, if that's what you're worried about. have you actually looked into C++11/14/17? modern C++ is a collection of great shit like RAII, lambdas, constexpr, pack expansion, fold expressions, decltype/declval, return type deduction, constexpr if (static branching), and even (my new favorite) higher-order constexpr generic lambdas (with which you can easily/concisely define complex compile-time-executable code, allowing for bullshit levels of const-propagation and baking, often with little to no template syntax)
>>
>>58241359
>just use this third party thing in order to make rust usable!
>>
>>58240821
>raii
Why do you want raii?
It's shit. Please stay out of C. Linus was right.
>>
File: leoeoal.jpg (61KB, 995x992px) Image search: [Google]
leoeoal.jpg
61KB, 995x992px
>>58240012
>Read in some thread about stupid girl not being able to do FizzBuzz
>suddenly get scared of not being able to do the simplest FizzBuzz,
>"Omfg whad if its not modulus 3 and 5".toCharizard
>do FizzBuz,
>relief
>tfw she really was retarded
>>
>>58241370
What are you spazzing about? If it's because it's "third party" you're wrong, because it was basically made by the team, it's just not part of stdlib. If it's the badge, it's wrong, it builds. I just tested it right now to make sure.
>>
>>58241400
show us your fizzbuzz
>>
>>58241365
>I'm a dummy who defends the C++ committees idea of them not creating C++ dialects
Just don't market it to us here and it wouldn't bother me.
You see how you find all those things you mentioned ok/great? It means that I have to label you a dummy and not associate with you. If I want a more sensible use of the language. But you don't label yourself. I'll have large issues finding hires who aren't dummies and tons of other issues in projects. At least they admit to there being lack of support for restricting feature use. Maybe we'd get somewhere there if they'd get on that.

But you can't just say 'pick and choose'. Languages don't work like that outside of single programmer projects.
>>
>>58241415
### Functions ###
range = $(if $(filter $1,$(lastword $3)),$3,$(call range,$1,$2,$3 $(words $3)))
make_range = $(foreach i,$(call range,$1),$(call range,$2))
equal = $(if $(filter-out $1,$2),,$1)


### Variables ###
limit := 101
numbers := $(wordlist 2,$(limit),$(call range,$(limit)))

threes := $(wordlist 2,$(limit),$(call make_range,$(limit),2))
fives := $(wordlist 2,$(limit),$(call make_range,$(limit),4))

fizzbuzz := $(foreach v,$(numbers),\
$(if $(and $(call equal,0,$(word $(v),$(threes))),$(call equal,0,$(word $(v),$(fives)))),FizzBuzz,\
$(if $(call equal,0,$(word $(v),$(threes))),Fizz,\
$(if $(call equal,0,$(word $(v),$(fives))),Buzz,$(v)))))


### Target ###
.PHONY: all
all: ; $(info $(fizzbuzz))
>>
File: 1464320180262.jpg (58KB, 580x679px) Image search: [Google]
1464320180262.jpg
58KB, 580x679px
>>58241400
>.toCharizard
Show us the fizzbuzz
>>
>>58241415


public static void main(String[] args) {
String fizzBuzz = "FizzBuzz";

for (int i = 1; i <= 20; i++) {
if (i % 3 == 0 || i % 5 == 0) {
System.out.println("FizzBuzz");
}else{
System.out.println(i);
}
}
}
.
>>
>>58241440
Looks like you didn't get the job
>>
>>58241440
Woaps, dat str was not supposed to be there
>>
>>58241210
>you can use epoll directly via libc crate
>you can use mio - low-level async io library based on epoll even loop
>you can use tokio - high-level futures-based async io library based on mio
You're, like, trice wrong.
>>
>>58241440
>>58241451

I hope you're memeing.
>>
File: digouteyes.png (61KB, 252x221px) Image search: [Google]
digouteyes.png
61KB, 252x221px
>>58241429
Is this what Haskell looks like?
>>
>>58241440
>>58241451
You've misunderstood the task but obviously you can do it.
You're supposed to print fizz when it's divisible by 3,buzz when it's divisible by 5 and fizzbuzz when it's divisible by both.
>>
>>58241467
No, it's Make dumbass.
>>
>>58241429
>>58241476
>>58241467
How can it be Make, it's not possible to do arithmetic in Make?
>>
>>58241499
You just saw it.
>>
File: brett kane.jpg (131KB, 1280x720px) Image search: [Google]
brett kane.jpg
131KB, 1280x720px
>>58241475
t. (im him) retard

public static void main(String[] args) {

for (int i = 1; i <= 20; i++) {
if (i % 3 == 0) {
System.out.println("Fizz");

} else if (i % 5 == 0) {
System.out.println("Buzz");
}else{
System.out.println(i);
}
}
}
>>
>>58241499
Make is a fully functional programming language, anon. You don't need much arithmetic to do FizzBuzz, it basically creates a list by taking the old list and adding the length of that old list as the next element and then it does textual matching in order to find three's and five's and write Fizz and Buzz accordingly.
>>
>>58241513
>i'm too stupid for fizzbuzz
>>>/g/wdg
>>
>>58241513
It doesn't print FizzBuzz when it's divisible by both 3 and 5.

Do not hurry, try to read exactly what is expected of you.
>>
>>58241513
You're still a retard, because now it doesn't print FizzBuzz for 15, only Fizz.

>>58241513
>>58241440
>>58241400
>laugh at someone who's unable to do fizzbuzz
>can't do fizzbuzz yourself
>>
>>58241513
t. pajeet
>>
>>58241510
Does it work?
>>
>>58241513
>.t (im him) retard
Now I'm confused.
Are you using that wrong or are you calling me retarded for pointing out you did it wrong?
>>
>>58241543
He is calling himself a retard, so yes he's using it wrong.
>>
>>58241499
Arithmetic is not required to do fizzbizz (aside from the stuff the processor is doing in the background)
fizzes = cycle ["", "", "fizz"]
buzzes = cycle ["", "", "", "", "buzz"]
fbs = zipWith (++) fizzes buzzes
main = putStrLn . unlines . take 100 . zipWith (\a b -> if null a then show b else a) fbs $ [1..100]
>>
>>58241543
He's retarded. Dude needs to lurk the fuck more.
>>
>>58241541
Yes.
>>
>>58240012
Why does /g/ hate c#?

I thought you guys were into open source languages. Instead you all shill for Java which is from Oracle, a company that doesnt respect ypur freedoms and runs around sueing people if they acidentally turn on the wrong feature or use the wrong library.
>>
>>58241571
>you all shill for Java
???
>>
>>58241558
>>58241429
Is this functional programming thing a meme?

Why would anyone write fizzbuzz this way other than for just showing off? Seems pointless and stupid to me.
>>
I wanna make ransomware so I can get nudes from the bitches in my programming class. Any tips?
>>
>>58241425
the hell are you talking about? i'm a "dummy" for using the features that make the language more concise, intuitive, and efficient? sounds pretty backwards. many of those features are such that nobody who actually understood them would in their right mind choose not to use them where applicable for anything but an arbitrary or political reason. i welcome you to provide some actual arguments against them

>Languages don't work like that outside of single programmer projects
maybe not in the private sector, but that's a major contributing factor to the generally shit code that it generates. i work on projects by myself anyway, and i assure you the process is greatly simplified and expedited by my not using an outdated and crippled version of the language
>>
>>58241578
It is pointless writing it that way. I was just demonstrating that it's trivially possible to write fizzbuzz without using any arithmetic in the code.

>>58241582
1) Help them with their homework
2) Get live-action nudes
Worked for me.
>>
>>58241571
1) OpenJDK is open source.
2) Nobody shills for Java, Java is AbstractPooInLooFactory
3) C# is for Pajeets
>>
>>58241571
There's a lot of people who know and love C# here. Here it's either "C#>Java" or "both are garbage".
>>
>>58241571
>hate C#
We don't though. Generally people hate on java and languages like java but C# seems to jive with people surprisingly.
>>58241578
Yes to all of those questions.
>>58241582
That's nasty anon. And illegal.
If you want their nudes just talk to them.
>>
>>58241571
>same speed or worse than java for the Core version (not counting Mono which is lol-tier)
>uses way more system memory than java
>FUCKING JAVA

You need to rethink your life. C# is basically MS Java. Same bloat, same pajeet developers.
>>
>>58241332
>>58241350
Cyka blyat, you are both wrong. Look into how fd_sets work. Kurva.

How does Rust FFI into a C macro with zero overhead? It doesn't. Blyat.
>>
>>58241571
when it comes to C# and Java the scales tip back and forth basically every thread. it's just a matter of how many fanboys of each is present. C# is significantly better tho
>>
>>58241429
>go to interview
>get ask to implement fizzbuzz
>do it in GNU Make

Instant hire or "don't call us, we'll call you"?
>>
>>58241597
do I just ask them for nudes?
>>
>>58241609
this is concentrated autism right here
>>
>>58241622
Yes, although that only works if you're moderately attractive and charismatic. If you're a creepy loner, then they will just say "ewww no" and you'll have to go Elliot Rodger on their asses.
>>
>>58241622
Ask them out for a drink. Go on a few dates. Acquire nudes and then some.
>>
>>58241589
>everything I do is great
OK OK anon whatever you say, that's your opinion. You're still a dummy though.
>private sector
Well in OS its an even bigger problem as you're not even in control of 'hiring'.
If there's submitted patches for everything but they're crap patches because they're using crap features then people will be discouraged from contributing. Because it'd be seen as redundant.
>outdated and crippled version
Yeah. No disagreements from me there. But we're really talking about the difference between backing a quadriplegic person and a quadriplegic person with a stick for a cage fight.

They both suck at what they aim to accomplish.
>>
>>58241622
Usually that works yes.
Women fancy themselves porngraphic actresses now it seems. At least in my experiences.

Though I can't say it would work when I went to university.
>>
>>58241609
Because optimizing compilers exist...
>>
>>58241664
>Women are insecure as fuck and easily manipulated it seems. At least in my experiences.
>Though I can't say it would work when I went to university because by then they had grown up and become more secure about themselves.

ftfy

I miss being 18.
>>
>>58241634
>>58241637
>>58241664
what if I want some of my professor too?
>>
>>58241685
Write the wittiest fizzbuzz you can send and email it to him. Bonus points if it is in some esoteric language. Double bonus points if it's a polyglot
>>
>>58241685
Old bearded dudes are not as keen to give out nudes.
Maybe if you dress up like a girl. Makes you seem like a really expert programmer. I'm sure a professor would like that.
>>58241681
>manipulated
What are you talking about?
>grow up and become more secure
Maybe. Still not particularly relevant. Maybe you're misunderstanding. I was saying that asking for nudes when I went to university would have been very crude and probably wouldn't have gotten you anywhere.
Nowadays people send tons of nude pictures of themselves everywhere.
>I miss being 18
That was a terrible age. You had no idea what to do because people hadn't prepared you to make your own choices at all. Or you were deluded into thinking trusting others is the best thing you could do.
>>
>>58241243
He's talking about the standard library, which has to work on all the supported platforms with different async io APIs. By the same logic, you can say that C has no epoll because it isn't in the C standard library.
>>
>>58241645
given your lack of argument i can currently only assume you don't understand what many of those features actually do. what language would you argue does it better? can you provide concrete examples of how that language would not benefit from (or perhaps be made worse) by some of those features, or perhaps how that language achieves the same effect as those features in a better way?
>>
File: wut.png (127KB, 836x277px) Image search: [Google]
wut.png
127KB, 836x277px
Woah, dude...
>>
>>58241697
okay, I made a send nudes fizzbuzz in x86, I hope they'll like it
>>
File: no-memes.png (4KB, 301x77px) Image search: [Google]
no-memes.png
4KB, 301x77px
>>58241819
:^)
>>
File: gonnagetsumpussyman.jpg (175KB, 1920x1079px) Image search: [Google]
gonnagetsumpussyman.jpg
175KB, 1920x1079px
>>58241836
I also decided to look for something that will activate their cams
>>
>>58241860
>Something to activate their cams
It's called money, anon
>>
why does rust use static linking by default?
>>
Does any know of any development oriented podcasts that aren't leftys whinging about trump and white people the entire time or is this literally all podcasts are used for now?
>>
>>58241917
Terry
>>
File: 1459163719280.png (2KB, 142x138px) Image search: [Google]
1459163719280.png
2KB, 142x138px
>>58241075
Teaching...?
Like a tutorship where you charge $10 an hour and spend the first two hours trying to set up the IDE and then go over all the basics.
After that, always stay one step ahead of the student.
>>
>>58241799
>argument
Well you never had one either concerning the C++ language features. You had claims of these features you're using giving you advantages.
But I'm not looking to discuss C++ features here.
>there has to be a language that does it better
No that's practically ad hominem (which may not be directly apparent).
The features themselves need to necessitate their use. They're not what we go to because there's no other languages that try (if that were the case).
I have my reasons not to use language features and they're based on experience and preference. I haven't perfectly verified that C++ is a terrible language overall. That'd take a lot of time and practice. But I have determined that it's very unlikely you will find productive C++ programmers. Productive meaning C++ programmers that produce code that performs well in many ways throughout the code life cycle.
>>
>>58241836
>okay, I made a send nudes fizzbuzz
You mean, like...
int i;
for(i=1;i<91; i++){
if(i%15==0) printf("send nudes ");
else if(i%3==0) printf("send ");
else if(i%5==0) printf("nudes ");
else printf("%d ", i);
}
?
>>
>>58241993
yeah but it shows a picture of my dick at the end with send nudes written on it
>>
https://www.reddit.com/r/Needafriend/comments/5l2iy4/17f_i_cant_masquerade_as_an_exciting_cool_person/

this girl wants to talk about computer science, go get her tigers!!
>>
>>58241905
Because most OSes don't come with Rust std library yet.
>>
>>58241571
.NET Framework is windows only and /g/ doesn't like windows.
>>
>>58242055
There's net core now.
>>
>>58241905
The non-excuse of muh portability?
>>
>>58242055
Pajeets only like wangdooz because microsoft has deep pockets
>>
>>58241905
Do people really like the idea of dynamic linking?
It made sense in the past. But now for the most part it's just a pointless hassle.
>>
>>58242055
> .NET Framework is windows only
Stale meme, m8.
>>
>>58242072
2MB hello world vs 9KB hello world
>>
>>58242030
Not sure why you post that here but
>wanting to talk to a 17 year old girls about how she's moody sometimes
I don't have time for that. I have tons of sharp instruments to poke into my eyes before I do that.
>>
>>58242072
Yeah, fuck sharing libraries in memory. Lets make exact copies over and over again. That will show those hardware makers who's boss.
>>
>>58242030
too young and too 3D
>>
>>58242094
Also unpatchable security vulns without releasing a new version of every program.
Because programs will be maintained forever.
>>
okay im >>58240053 my computer turned on but smoke started coming from the psu and the fans didnt turn on so my case just literally filled with black smoke? and i tried to turn it off but the power button didnt work and the screen froze? so i had to turn it off at the wall

im so fucking sick of this functional programming meme, haskell has no real world application, you cant even write an operating system without it breaking your pc
>>
How do I write a polyglot in C and Haskell?
>>
>>58242091
Not even sure I accept that as a problem.
>>58242094
Have you even checked how much that is? We're talking about the general case here to be clear. Not stuff like GNU.
>>58242113
This is the biggest upside I've thought of. But should security patching concerns be primary all the time? Most software people write is not critical in that way.
>>
>>58242030
Connect her to god king Davis.
>>
>>58242091
So what?
>>58242094
Funny how with Docker we basically made the full circle, every app now has it's own libs again.
>>
>>58242169
Don't even get me started on that autism. I hate VMs and docker and they both a poor excuse for better OSes.
>>
>>58242072
Just to prove a point, take it as you may, but all software internally compiled at Google uses static linking.

Just saying...
>>
rust lets you use the -- operator on an immutable variable with no warning. it doesn't decrement the operand either
>>
>>58242210
That's just double negation
>>
>>58242222
oh
>>
>>58242210
that operator doesn't exist in rust...
>>
>>58241944
it's unfortunate that you have arrived at this conclusion before becoming aware of the intuitive and practical nature of some of the new features. coming to truly understand them could very likely have caused you to reach a different conclusion

>Well you never had one either concerning the C++ language features
fair enough. here is a great concrete example i encountered recently:
when C++14 originally added constexpr generic lambdas, only a first-order lambda could be constexpr-qualified. i very quickly encountered use cases where higher-order constexpr generic lambdas would have been extremely useful, but at the time, this functionality could only be accomplished with a very wordy, ugly, perfect-fowarded, templated wrapper function (a separate one for each lambda in question). i wished very quickly that the standard would add the option of constexpr-qualification of inline and/or higher-order lambdas, as it would achieve the same effect but drastically cut down on syntax. the programmer of the very interesting C++14 Boost.Hana functional metaprogramming library also encountered this problem. lo and behold, a technical specification regarding exactly that functionality was accepted into the C++17 standard. now, for example, a C++17 version of Boost.Hana could be written that achieves the exact same functionality, with the exact same performance, with *literally less than half the amount of code*

>The features themselves need to necessitate their use
the above is just one example, but they don't add a TS to the standard unless it describes a strong, concrete, practical use case. and i still don't use all the features. i use the ones that have immediately intuitive, practical use cases which i have personally encountered many times

>it's very unlikely you will find productive C++ programmers
sure, absolutely. that's because C++ is a very difficult language. but it remains that someone who has learned it well can write extremely robust and efficient code
>>
>>58241440
>blog post about being able to fizzbuzz
>can't actually fizzbuzz
wew lad
>>
>>58242261
Do you write videogames by chance?
>>
>>58242261
>when C++14 originally added constexpr generic lambdas, only a first-order lambda could be constexpr-qualified. i very quickly encountered use cases where higher-order constexpr generic lambdas would have been extremely useful, but at the time, this functionality could only be accomplished with a very wordy, ugly, perfect-fowarded, templated wrapper function (a separate one for each lambda in question). i wished very quickly that the standard would add the option of constexpr-qualification of inline and/or higher-order lambdas

Jesus fuck, when did lambdas get so complicated?

Oh wait, it was when C++ got hold of them.
>>
Trying to figure out a side project to work on. Over the past year I finished a Torrent tracker and distributed KV storage in Go (for better or worse) and they're both at stages which I'd prefer not to work on them too much and focus my efforts elsewhere.
>>
is there a point in OOP without a database?
>>
That's right, retards.
You don't know how to use a for loop
>>
>>58242620
So they rely on iterators? Implementing an iterator should be a single function for most cases then if it's so core to the language.
>>
File: fragezeichenmödchen.jpg (36KB, 500x375px) Image search: [Google]
fragezeichenmödchen.jpg
36KB, 500x375px
Hi, it's me the music retard again.

If I have an audio port set to play at 16-bits, 2 channels, and 48000 Hz, then that's 192000 bytes being written per second, every second.

Earlier I was wondering about timing notes. If I am constantly writing to this audio port in one thread, even if it's zeros of silence, then could I create a reliable clock off of this writing rate? Like every time it empties the buffer into I/O it does a "tick", and I can have a different thread counting the number of ticks to derive precise note lengths from the number of buffers emptied.

Does that sound correct, or do most people implement timing a different way?
>>
>>58242401
Lmao, I don't even understand what half of those words mean in that context
>>
A stupid joke website: https://entirebeemovie.com/ I'm proud of mobile support, what do you think?
>>
>>58242654
btw I timed this method manually with my phone and it seems to translate bytes written into real time easily enough, but I don't know how accurate it really is
>>
>>58242656
It's because C++ is a "difficult language".
Difficult being code for convoluted. He's really not saying much in that paragraph.
>>
>>58242686
>>58242656
>>58242401
C++ isn't difficult, you two are just fucking retarded.
>>
>>58242620
for i in 0..100 {
println!("You're a faggot");
}


Why anyone would want C style over this is beyond me. It's easier to read and write.
>>
>rust's stdlib
this is some CS grad material right here
>>
>>58242713
I'm sorry my sire, I'm clearly of inferior intelligence of thy greatness, I shall commit suicide at the next convenient time to rid this world of my subhuman presence oh lord
>>
>>58242344
yes, among other things. not that i'd be able to use some of my favorite C++14/17 features for a game, since the MSVC devs are taking their sweet-ass time with standards support. i love using them in my own personal projects, though, since GCC 6 has full C++14 support and GCC 7 has very nearly full C++17 support. i'm working on a fully constexpr-correct linear algebra library which will be all kinds of handy, and a constexpr/lambda-based software renderer, which is mostly just for fun, but it could also be pretty handy for doing complex texture/mesh/scene generation and transformation in code at compile time (for the purpose of baking data into the binary in a fast, clean, and concise way, as opposed to other more ugly and/or tedious options like those previously available)

>>58242401
it sounds complicated, but the C++14/17 features regarding lambdas have made them much more concise and easier to use, mainly by removing template syntax altogether in the majority of use cases. generic lambdas make it so you can just use "auto" as a parameter, and that parameter becomes automatically templatized behind the scenes, and return type is automatically deduced (even in complex cases) unless you explicitly qualify one. constexpr higher-order lambdas means you can pass in and/or return an inline generic lambda to/from a function, and the lambda will automatically be constexpr-qualified if it is constexpr-valid, all still without template syntax
>>
>>58242750
The point is "those words are unknown, I don't understand them" does not mean that C++ is difficult, it just means that you are unfamiliar with C++. And if you are unfamiliar with a language, it's pretty balsy to call it shit.
>>
>>58242561

pls respond
>>
>>58242748
>tfw no integer generics
>>
>>58242772
>The point is "those words are unknown
I didn't say that.
>I don't understand them"
I didn't say that.
>does not mean that C++ is difficult,
I didn't say that.
>it just means that you are unfamiliar with C++.
I didn't say that, but it's true.
>And if you are unfamiliar with a language, it's pretty balsy to call it shit.
I didn't say that.

>>58242762
This is a well-worded and well-reasoned response.
>>
>>58242091
9kb + the full shared libary
static linking allows you to only link the parts of the library that are actually uses, so for most use cases, static linking actually produces smaller binaries

>>58242094
space used by the binary is an almost irrelevant factor. maintenance costs and related issues are way more important.

>>58242113
at the same time, updating a library that fixes an issue in one program may open up a security issue in another or possibly break it, there's two sides to that argument.

overall static linking should be preferred over dynamic linking to avoid breakage through updates. the more complex the dependency graph, the more shit will fuck up.
no, this cannot be fixed via better automation because parts of dependency hell are undecidable and parts are np complete.
dynamic linking should obviously be preferred for security related libraries.
most libraries/software doesn't benefit from dynamic linking at all, and projects with large dependency graphs are essentially unmanagable, which is why any competent company operating at a large scale has been attempting to reduce the issue via using containers.
>>
>>58242811
Backpedalling - the post
>>
>>58242713
The person who wrote that paragraph claimed it was difficult. And it is. But not due to the words but because of what
>>58242401
said.

C++ complicates things because it's not a planned language. It's as janky as any software project turns out if you never refractor.

And if you seriously don't consider C++ difficult you just don't know enough about it.
>>
>>58242824
I'm the guy who asserted that lambdas had become complicated by C++ implementation of them. None of that sentence is in your lovely, daft post.

Do please go on, though. I think I might have confused you by responding to your post in response to someone else :)
>>
>>58242762
Every word you write makes me think you should realise how much crusty semen from the cpp committee you're ingesting. It's really revolting.
You're jerking off over these basic features too.

Yes of course they improved something that was absolute crap. But are we supposed to praise them for that? These are the people who made some of the most nasty and weak metaprogramming you can find. I don't see how anyone who has a moderate idea of what they're doing isn't just sick of the language.
>>
>>58242830
>C++ complicates things because it's not a planned language
No, that's not it. Many languages are designed and evolved this way, including Python and Java.

>It's as janky as any software project turns out if you never refractor.
This is more on track, because the real issue with C++ is that no matter what, it has to stay backwards compatible with C. This is what's really causing modern paradigms to awkwardly being crowbarred into C++.

>And if you seriously don't consider C++ difficult you just don't know enough about it.
I seriously don't consider C++ to be difficult, no. I consider it complex and I will probably never know everything, but it's not difficult. It's actually quite intuitive, once you get a hang of it.
>>
>>58242882
>Many languages
>Names 2 of the most hated languages besides C++
ha
>>
>>58242880
>I don't see how anyone who has a moderate idea of what they're doing isn't just sick of the language.
Not the guy you're responding to, but as a long time C programmer, the few chances I get to use C++ instead of C is fucking heaven.
>>
>>58242898
>/g/ hates them = most hated
Python and Java are by far some of the most popular languages out there, and both have enormous user communities.

Anyway, that wasn't even the point. The point is that ALL modern languages are designed by committee, and every revision is evolved. This also includes Haskell, C#, <insert your favourite language here>.
>>
>>58242882
>I consider it complex
I would agree with this.

My only assertion has been that lambdas are now complicated (by C++).

I think most of my pedantry has revolved around the idea that while I asserted that lambdas in C++ were complicated, I never said 'difficult', 'shit', or similar.

>>58242898
I don't think Python's that widely hated. Other than /prog/'s residual FIOC sperging, maybe.
>>
>>58242922
>My only assertion has been that lambdas are now complicated (by C++).
I don't see how C++ style lambdas would complicate lambdas in other languages?
>>
>>58242899
Yeah templates, classes, constexpr are p nice; features are nice. It's ridiculous that C can't be grown as a language separate from C++. They are trying to grow C by growing C++ and keeping the C base. Really, the two languages need to split. For both their own benefits.
>>
>>58242932
Yes, that was the tongue-in-cheek part: the idea that lambdas as a concept have been irrevocably tainted by C++'s implementation of them.
>>
>>58242882
>no, that's not it
Well I'd guess java and python are less terrible because they give up on old features. But I'm not intimate enough with them to say.
It could be they're just shit at making a language. But there's so many things they motivate retroactively. std::allocator is a perfect example.
>it's C's fault
So the reason lambda's were (if anon is to be trusted) wonky and templates are wonky is because C?
I certainly don't think C is closing them in that much really. It's their own doing.
>complex vs difficult
>its intuitive
Yet you admit you won't ever know everything.
Anon you may have to wake up and realise that your assumptions aren't necessarily true.
>>
File: 1477172406211.png (8KB, 398x293px) Image search: [Google]
1477172406211.png
8KB, 398x293px
>rust has runtime array bounds-checking
>systems language
>>
>>58242944
Yes. I couldn't agree more.

The committee needs to the kill backwards compatibility.
>>
>>58242960
You can turn them off.
>>
>>58242899
How so? Doesn't sound like you're a C programmer actually.
>>58242944
>templates, classes and constexpr
Constexpr arguably removes some of the small side programs or metaprogramming you sometimes write. But I really find it limited. Certainly not enough to justify calling it heaven.
>classes
Why?
>templates
Absolutely ludicrous. Who would ever want to have those? Especially from a C programmer pov they're just shit.
>>58242961
They really should. The more separation we get the better. But I don't see how it helps C++ at all.
>>
>>58240642
>>58240668
>>58240702
The original designer was a massive SJW. Mozilla is a whole company of SJWs. You're deluding yourself if you think this one guy is the problem.
>>
>>58242958
>Well I'd guess java and python are less terrible because they give up on old features
>It could be they're just shit at making a language.
Early Java typecasting and lack of generics was still an issue up until 8, where failing to specify generic interface would resort in compilation error.

The infamous ThreadDeathException, that would, when thrown, release mutexes and locks held by that thread and put them in a broken state is still lurking deep in the standard library, despite being deprecated in a very early revision.

Python 2 suffered from backwards compatibility, and they had to redesign the language in Python 3 to sort things out. Even so, Python 2.xx is still around because there are still essential libraries that haven't yet been ported.

>So the reason lambda's were (if anon is to be trusted) wonky and templates are wonky is because C?
Not C directly, but the extremely conservative mentality of the committee.

C++11 was not the first time lambdas and closures were considered (but the committee back then came to the conclusion that functors, which people already implemented, would still suffice), but C++98 is the reason why we are stuck with the current template syntax and SFNIAE behaviour.

For C++11, the C++14/17 constexpr was considered but postponed until 14 and 17.

>Yet you admit you won't ever know everything.
Because I don't program C++ often enough to sit down and read the standard by heart. But if I was primarily a C++ programmer, I would have already.
>>
>>>58242944 (You)
>>templates, classes and constexpr
>Constexpr arguably removes some of the small side programs or metaprogramming you sometimes write. But I really find it limited. Certainly not enough to justify calling it heaven.
>>classes
>Why?
>>templates
>Absolutely ludicrous. Who would ever want to have those? Especially from a C programmer pov they're just shit.

You have never written OOP-style code in C? You have never written type generic libraries with the fucking preprocessor? It's awful.
>>
>>58243010
>How so?
Because of lack of modern features such as generics and containers. In fact, I would jusitfy using C++ over C if the only C++ feature I could use were STL containers.

>Doesn't sound like you're a C programmer actually.
I am. I don't program C because I enjoy C so much, it's more out of necessity. I used to program C++ in my last two jobs, but in my current one it's 99% C.

>They really should. The more separation we get the better. But I don't see how it helps C++ at all.
See >>58243050

There is no good reason why C++, a modern multi-paradigm programming language, should still be stuck with preprocessing directives and symbol name mangling in a day and age where the concept of modules and components exist.
>>
>>58242960
>manually accessing elements when you have iterators
>implying you CANT get it without checks if you really need to

>>58243042
>The original designer was a massive SJW
[citation needed]
>>
>>58240821

http://echorand.me/site/notes/articles/c_cleanup/cleanup_attribute_c.html
>>
Right, so I was doing my sister's homework (because I'm fat and unemployable so I'll just leech ill-gotten course material off of my CS-majoring sibling for the hell of it) and I came across a problem.
#include <stdio.h>

typedef unsigned long long long_t;
typedef unsigned short short_t;

typedef struct{
short_t a;
long_t b;
} structure;

const int SIZE = 360;

main(){
printf("Start!\n");
structure array[SIZE][SIZE];
printf("Success!\n");
}

C code. Compiles fine.
The problem arises when I try to have SIZE as larger than 360: it crashes.
It did this when I had it as int[][][] (though I never checked what the largest array was then).
My question is this: why am I having difficulty creating an array bigger than 360x360?
I assume it has to do with allocating memory.
>>
>>58243050
>know the standard by heart
Good luck. Last time I read it it made itself perfectly clear. You work with C++ on gut feeling until you have an issue.
>C98 is to blame for template syntax and SFINAE
Where can I read about this? Can't ask you to explain it all obviously. I really don't see the connection.
>java and python also have issues for the reasons you hypothesised C++ does
Wait so your point is that I'm wrong because other languages do it too but they have the same issues?
How does that make any sense.
Why even make that response then?
Python 3 made a split and presumably they're better off.
>>
>>58242729
It's still a new thing you have to learn, with whole new ways to fuck it up.

The C-style loop syntax is simple and intuitive. People who keep making mistakes with it are just bad programmers.
>>
>>58243177
array gets allocated on the stack

the stack can only be so big

try having array be a global variable
>>
>>58243187
>Wait so your point is that I'm wrong because other languages do it too but they have the same issues?
I didn't say that. I said that the evolution of C++ is no different than any other language.
>>
>>58243102
>I'm a C++ programmer who stumbled into C
OK. Well that's why I'm saying you're a C++ programmer. If a functional programmer had to use C you wouldn't start calling him a C programmer and he's taking the C programmer point of view when he's complaining about how he can't be functional.
>see [Post]
That's just a claim. How does that motivate anything?
>there's no good reason they should be stuck
Well. There is the C backwards compatibility. That's their reason. I really don't see how it helps the language to any significant extent though. Are preprocessing directives and symbol name mangling a daily struggle for you or something? The latter can be easily avoided and the first I haven't felt as a major problem ever really. There's been some annoyances but overall no. Certainly not a problem professionally where you're already in a fairly well established environment.
>>
>>58243198
So you only have buzzwords as a rebuttable then. Hmm.

>People who keep making mistakes with it are just bad programmers.

It's not about typos, it's about memory safety. Even C++ iterators get fucked over by invalidation. Doing indexing manually is just asking for trouble. That's why for loops are iterators in rust. Implementing another style of for loop for the rare case of using it to generate a list of integers when this style can do that too is just dumb. If you want to be fully autistic you could make a for loop macro that works like for loops in C.
>>
>>58242880
>These are the people who made some of the most nasty and weak metaprogramming you can find
a major reason for constexpr was to correct the problem of template metaprogramming being a nightmare, so it serves to invalidate arguments about TMP being shitty

>>58243010
>Constexpr arguably removes some of the small side programs or metaprogramming you sometimes write. But I really find it limited
then you clearly aren't aware of its real potential. a massive amount of regular good code is already constexpr-valid by nature, and much more with minimal modification. qualifying it as such (and shooting for it where applicable) not only makes for clean, independent code that avoids side-effects, but also allows for potentially many complex layers of const-propagation resulting in very optimizable code
>>
File: 7db255f0e6.png (2MB, 1074x973px) Image search: [Google]
7db255f0e6.png
2MB, 1074x973px
Hold the phone, has anyone ever made actual programs in Rust, or do they all just blog about it and shill on 4chan?
>>
>>58243287
There's the weeb who made a terminal emulator with sixel support
>>
>>58243236
OK. So you basically said java and python are just as bad.
To me it looked like you were responding to me as you quoted me.
I don't care how bad java or python are really. They can be as bad as they like (except when I use them). But for a discussion about C++'s issues with supporting C they're very irrelevant.

The 'no that's not it' makes it especially confusing as if you put your statement about java and python in sequence it _really_ looks like you're trying to make a point. Not just an exclamation.

Yes I'm typing this long post explaining how you currently look like a sophist because I really hate when people are intentionally being deceptive like this.
>>
>>58243275
If you want safety, use Ada. It's FAR, FAR beyond Rust, and has been since the 80s.
>>
>>58243259
>OK. Well that's why I'm saying you're a C++ programmer.
You're wrong. I programmed C for 5-6 years before ever writing a single line of C++. Then I got a job as a C++ developer for 3 years, then another one for 6 months, before I went to my current job.

>If a functional programmer had to use C you wouldn't start calling him a C programmer and he's taking the C programmer point of view when he's complaining about how he can't be functional.
I know C a lot better than any other language.

Why are you obsessing about this?

>That's just a claim. How does that motivate anything?
Read the post I linked to for christ's sake.

>Well. There is the C backwards compatibility. That's their reason.
I said good reason.

>Are preprocessing directives and symbol name mangling a daily struggle for you or something?
Actually yes. Preprocessing directives and header files is the reason why template libraries are painfully slow to compile.

Symbol name mangling is one of the main reasons why I can't trivially write a kernel module in C++.

>The latter can be easily avoided
Precompiled headers are a hack, not a fix.

>and the first I haven't felt as a major problem ever really.
Then you obviously haven't dealt with the struggle of linking C++ code with other code.
>>
>>58243314
Don't they use ada for nuclear missile guidance systems?
>>
>>58243299
its shit
>>
>>58243338
Yes. It's certified under DOD safety protocols, something Rust will never qualify for.
>>
>>58243309
>OK. So you basically said java and python are just as bad.
No, I didn't.

>To me it looked like you were responding to me as you quoted me.
I did quote you, because you claimed that gradual evolution of C++ somehow is the exception rather than the rule.

>Yes I'm typing this long post explaining how you currently look like a sophist because I really hate when people are intentionally being deceptive like this.
I'm not being deceptive, you're asserting things I never wrote or meant.
>>
>>58243314
>changing the subject

So you admit your for loop complaint was inane?

>>58243338
$.10 has been deposited into your account
>>
>>58243373
Thanks, fampai. I wasn't sure they payments would come through
>>
>>58243284
>you aren't aware of its real potential then
I am though. And it does just what I say. Constexpr is very simple.
I suppose if your code is appropriate for use with constexpr its slightly easier to use that than having a side program that outputs what you want. Though there's a bit of a difference in what control you get. If I know compilers well enough anyway.
>const propagation
Constant propagation I hope you mean. And the side programs have the exact same effect if you're not being stupid about it.
It's a very minor difference in the grand scheme. Calling it heaven is silly.
>>
>>58242960

Ada does it, and it's still a systems language.
>>
>>58243403
ada is ugly though and so is rust
>>
>>58243368
>I claimed that a granular evolution..
No I didn't. I clearly associated the faults to its granular evolution. I didn't claim it to be exceptional in any way. I didn't mention other languages.
>I'm not being deceptive
Well. Perhaps it's a misunderstanding but it's very sloppy reading on your part I have to say.
>>
>>58243338
They use it for all kinds of rockets :^)

https://en.wikipedia.org/wiki/Cluster_(spacecraft)#Launch_failure
>>
Anyway. Fuck this discussion. It's just you (one or multiple) who don't know how to develop C code assuming that C++ is great because it does simple features fairly poorly. (as demonstrated with the claims about constexpr)
How you're an employed C developer is beyond me. Must be in very short supply where you live.
I can't be bothered anymore.
>>
File: totally_useless.png (28KB, 1089x234px) Image search: [Google]
totally_useless.png
28KB, 1089x234px
>>58243287
I've actually made λ2/λω typed lambda calculus type checker/beta-reducer, it worked well enough, but I've lost interest before I implemented dependent types.
>>
>>58243452
thanks babe
>>
>>58243460
add row polymorphism
>>
>>58243460
I have no idea what that is so I'll assume it's a lie.
>>
>>58243215
>try having array be a global variable
I'm afraid that can't be done.
Declaring SIZE as a constant was misleading of me. The array size needs to be input by the user when it runs.
Your suggestion does work but only when SIZE is known beforehand: having the array size as a variable and the array as a global variable throws up errors.
>>
>>58243460
Now make it emit gigabytes of garbage a second
>>
>>58243420
>I clearly associated the faults to its granular evolution
You did say that C++ is not "a planned language" and that it never sees a "refractor" (which I assume you meant refactoring).

I'm saying that this is obviously wrong, and the basis of my claim is the granular evolution every other language also have which do not lead to the same problems C++ have.

I'm saying that the problem is an overly conservative committee that insists on keeping it backwards compatible with a portable assembly designed some time during the late 70s and early 80s.

Let me be clear here, because you are apparently having a hard time understanding what I'm saying: Those things are not the same thing. Granular evolution is not somehow unique to C++ and there isn't anything wrong with this process. It's a natural consequence of standardisation, so people can adopt your language and not have to rewrite everything when you release the next revision.

The bad thing is the overly conservative attitude of the standardisation committee in charge of C++ revisions. They kill of good ideas because they might break backwards compatibility with legacy code. This leads to a mentality where maintaining legacy takes priority over all else, something that obviously leads to stagnation.

I hope this is clear enough for you.
>>
>>58243425
That happened because they turned off the safety features in the Ada compiler. Human error can happen in any language.
>>
>>58243485
You want a heap allocation.
See alloca/malloc/dynamic allocation.
As he explained you can only have so much on the stack.

Also multi dimensional arrays in C are a bit of a mess imo.
>>
>>58243485
Dynamic allocation is your friend.
>>
>>58243517
You don't know what :^) means, do you?
>>
>>58243419

So is C++. Systems languages are not known for being pretty.
>>
File: 1453821978468.png (17KB, 511x654px) Image search: [Google]
1453821978468.png
17KB, 511x654px
>What are you working on, /g/?
I'm playing around with bitshifting. Seems weird, honestly.

#include <iostream>
#include <bitset>
#include <climits>

using namespace std;

int main()
{
const int bits = sizeof(int) * CHAR_BIT;
int ar[] = {INT_MIN,-4,-3,-1,0,1,3,4,INT_MAX, 1<<(bits-2)};
for(auto i:ar)
{
auto j= i>>1;
auto k= i<<1;

cout << "pre : " << i << ' ' << bitset<bits>(i) << endl;
cout << "shift r: " << j << ' ' << bitset<bits>(j) << endl;
cout << "shift l: " << k << ' ' << bitset<bits>(k) << endl <<endl;
}
}

4chan won't let me post the output.
http://pastebin.com/AzQkD9bn
>>
>>58243573
What's weird about it? Can you be more specific?
>>
File: Untitled.png (2MB, 1920x1080px) Image search: [Google]
Untitled.png
2MB, 1920x1080px
>>58243549
>>
>>58243597
haven't done this in awhile. let's see if it still werks

>>58243549 >58243517 You don't know what :^) means, do you?
>>58243425 >58243338 They use it for all kinds of rockets :^) https://e
>>58243366 >lock device down so idiots cant install anything >complaints e
>>58242740 >58242058 U mad, freetard? :^)
>>58242695 >58236182 Hi kevin :^)
>>58241950 >58240596 This >58240599 >58241833 Never forget :^)
>>58241857 >58241819 :^)
>>58241732 >58241725 >not just downloading the higher quality versions of
>>58241712 shitposting from my lg v20 :^)
>>58241293 >rename my folders to be just /Album/ >upload 100% FLAC >it's
>>58241138 >58240136 >58240779 Theory 1. Assuming you flip three tim
>>58240820 Daily reminder that if you care about (You), you're a virgin with
>>58240779 >58240136 Technical 1. An address is the memory location, a
>>58240752 >58240710 :^)
>>58240696 >58240620 Actually, HDB is at the top of the raiding list. It'
>>58240101 >58240054 I have no CP to hide, so... :^)
>>58239489 >58236541 There are microscopic ones :^)
>>58239488 >58239471 If you like shitty encodes then sure. :^)
>>58239485 http://filesharingtalk.com/threads/430222-AOM-s-recruit-site-(wtf
>>58239063 >58238174 Hacked :^)
>>58237621 >58237609 :^)
>>58237605 >58237601 :^)
>>58230218 >58229661 Seems everyone left :^)
>>58227288 >58227234 :^)
>>58226653 get engaged :^)
>>58219224 >58219130 Nah, I brought it on the day for the old price and t
>>58215192 >58215176 >germany >gender neutral sounds about right :^)
>>58207483 it just works :^)
>>
File: 1443695938208.jpg (42KB, 538x613px) Image search: [Google]
1443695938208.jpg
42KB, 538x613px
>>58243573
>I'm shifting signed numbers without understanding how negative numbers are represented in binary
>>
>>58243614
>>58243597

Now THIS is shitposting :^)
>>
>>58243583
Check the output. Shift righting a negative number adds in a 1 in the most significant digit area. I didn't know it did that.. That and overflow math is pretty fun.

I mean, it's nice that it tries to have the representation similar. Bit shifting something right makes you expect it divides by two and rounds down. I just didn't know it added the '1' bit.
>>
>>58243618
there are a few ways
>>
>>58243389
having to build a separate program whose output you embed in your main program is ugly, tedious, fragments your build process, complicates operating at different levels of abstraction, and is more prone to breakage (potentially having to redefine constants in your main program when data changes, for example). constexpr allows the whole process to be intuitive, unified, and consistent. i understand that you can technically get by without it, but why would you if the option was available?
>>
>>58243618
Oh no, I understand
https://en.wikipedia.org/wiki/Two%27s_complement

I just thought a bit shift would shift everything. I didn't know it keeps the one.
>>
>>58243658
its the msb that tells it if its positive or negative.
there is also a difference between logical and arithmetic shifts in intel at least and a few architectures ive come across
>>
>>58243658
shift_result & 0x80000000
>>
>>58243707
Fuck, meant to use an OR
>>
>>58243658
>>58243635
>I just thought a bit shift would shift everything. I didn't know it keeps the one.
It's undefined behaviour.
>>
>>58243704
Right. Now I'm just thinking of finding ways to find out how signed numbers are stored during runtime. And other abstracted low level stuff like Edianness

>>58243751
I'm well aware. I'm trying to use undefined behavior to learn more about representations in hardware. Maybe find a way to optimize for different representations using undefined behavior.
>>
This thread is pathetic. It is not about programming. It's just a bunch of computers illiterates and first semesters memeing about whatever they just learned.

A quick search shows that most arguments used here are not original and have been copied from some trendy tech blog or other shit site.

The only real programming questions I have seen so far are from beginners(it's fine to be a beginner btw).

This entire site is shit and I don't know why anyone would regularly come here.
>>
>>58243786
>I'm well aware. I'm trying to use undefined behavior to learn more about representations in hardware. Maybe find a way to optimize for different representations using undefined behavior.
That's ridiculous for many reasons.

In most cases, the outcome of undefined behaviour is determined by whatever the compiler outputs, and not the architectural state.
>>
>HaskLEL is useless and, pure functional and stateless languages are a meme
>Lisp is only used for third class text editors
>SICP is not a good book and this is why it's given away for free
>Anime is shit
>Maki a slut
>C++ is much better than C
>Java is the language of the future
>JS is a good choice for server side
>The best software engineers are indians
>>
>>58243821
>In most cases, the outcome of undefined behaviour is determined by whatever the compiler outputs, and not the architectural state.
gay
>>
/g/ cool kids club checklist

[x] hate OOP
[x] hate IDEs
[x] use only Haskell
[x] never produce actually useful software (this is important)
[x] wear knee socks
[x] tiling window manager
[x] dark-like-my-soul customized colors
[x] hate popular Linux distributions (because too intelligent for them)
>>
>>58243834
There's a reason why GCC used to open nethack or Emacs and run a tower of hanoii simulation upon encountering #pragma once directives.
>>
>>58243815
>>58243832
You are spamming by posting this copypasta every thread.
This is a violation of the rules.
>>
>>58243815
>>58243832
>>58243845
>The thread at bump-limit
>Posts copypastas
For what purpose.
>>
>>58243848
I'm violating your mom

>>58243862
Didn't notice. Will post in the next one too. ty
>>
>>58243834
youre gay?
ill teach u about computers if u be my bf
im a hacker ;3
>>
>>58243845
>tfw using haskell at work and being paid for it
feelsgoodman
>>
>>58244156
can i have your job please
>>
File: FatPepe.jpg (274KB, 1500x1000px) Image search: [Google]
FatPepe.jpg
274KB, 1500x1000px
>>58244156
>lying on the internet
>>
New thread:
>>58244274
>>58244274
>>58244274
>>
File: rick_dagless_sad.png (761KB, 1280x800px) Image search: [Google]
rick_dagless_sad.png
761KB, 1280x800px
C newb here. I'm messing about with a simple malloc program, but for some reason I run into problems when I try to free the pointer to the allocated memory. When I run the program, I get

>malloc: *** error for object 0x7fb5cec02800: pointer being freed was not allocated

Is this because the pointer is pointing at the last spot in the allocated memory? Also, the program seems to work fine when I don't use free.

#include <stdio.h>
#include <stdlib.h>

int main(void)
{
int *ptr, *plc;

ptr = (int *) malloc(4 * ((int) sizeof(int)));
plc = ptr;

for (int i = 0; i < 4; i++) {
*ptr++ = i;
}

free(ptr);

exit(0);
}
>>
>>58243521
>>58243532
>Allocating memory
Aye, I thought as much.
Yet to be successful implementing it.

>>58244352
Your program compiles fine for me but doesn't give the expected output: getting random numbers instead.
I'm a complete newb as well, so I don't know what's going on.
>>
>>58244254
Not lying, it's true. To be honest with you, I actually fucking hate Haskell, it's a great language but holy fuck we do have a lot of issues because of the goddamn retarded quirks of the language (type system, laziness, unnecessarily strict-yet-broken stuff, language limitations, etc).

In theory it's a great language but when you try to do a lot of really complicated stuff (our software is very complex), like all languages, the language problems all come up at once and it's frustrating.

We actually found (and fixed) several bugs in the compiler, for example.
>>
File: 1464830231101.png (534KB, 650x720px) Image search: [Google]
1464830231101.png
534KB, 650x720px
# Here's another Car Talk Puzzler you can solve with a search:
# "Recently I had a visit with my mom and we realized that the two digits
# that make up my age when reversed resulted in her age. For example, if
# she's 73, I'm 37. We wondered how often this has happened over the years
# but we got sidetracked with other topics and we never came up with an answer.
# "When I got home I figured out that the digits of our ages have been
# reversible six times so far. I also figured out that if we're lucky it would
# happen again in a few years, and if we're really lucky it would happen one
# more time after that. In other words, it would have happened 8 times over
# all. So the question is, how old am I now?"
# Write a Python program that searches for solutions to this Puzzler. Hint: you
# might find the string method zfill useful.
>>
>>58246004
>I also figured out that if we're lucky it would
lucky about a deterministic event that is easily computable? Is it serious?
>>
>>58246004
Literally print the multiplication table for the number 9.

Are you 10 years old?
>>
>>58246004
11 years?
>>
>>58246270
57 is the answer.
>>
>>58246370
You didn't understand what I said. It wasn't the solution, but the explanation.
>>
>>58246004
a = 100
b = 1
while(a>0):
print(a,'\t',b,'\n')
a = a - 9
b = b + 9

Going off of what >>58246152 said.
Not tested the script.
>>
>>58246152
>>58246440
That's not what the exercise is asking and it's just plain wrong.
Thread posts: 325
Thread images: 39


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