/dpt/ - Daily Programming Thread

Old thread: What are you working on Sup Forums?

Other urls found in this thread:

joyful.com/blog/2015-04-20-ssh-darcs-hub-vulnerability.html
libav.org/.
twitter.com/NSFWRedditVideo

thank you for not posting a fag thread

C#

FIRST for Lua

First for asm

First for D

Sorry guys but CNN have officially revealed that ironic "first for _" posting in /dpt/ is no longer funny

C++ is a meme

What has damaged programming the most out of all the OOP languages?
Smalltalk, Java, ...?

friendly reminder that category theory and """purity""" are not silver bullets against shitty software

do not worship these false gods

C++, it was the first mainstream one

OOP has set programming back by decades

agreed. They are mathematical tools, not magic spells.

Patronizing reminder that types prove universal properties about code, whereas tests only prove existential properties.

My first script in Ahk-retrieves a specified file list, takes a screeny of said file, saves it, and loops back to do it for the rest of the 300 some labels I need a screenshot of.

I already feel like Mr Robot Famalam

good point

>Ahk
auto hot key?

Yeah.

aha here we go again. I wonder if you actually know what you're talking about, or if you're just parroting "OOP BAD, OOP BAD" to be edgy and different.

>i'm not like other programmers

joyful.com/blog/2015-04-20-ssh-darcs-hub-vulnerability.html

OOP encourages shared state.
I don't know how any retard could possibly argue FOR shared state.

I didn't say types obviate the need for tests.

>OOP encourages shared state.
the complete opposite you fucking retard, it encourages encapsulation of state

And then you pass that state around and encourage mutation of it. A recipe for disaster.

>the complete opposite of shared state
>encapsulation of shared state

b-but that's worse senpai

>OOP encourages shared state.
pajeet of the thread award goes to this user

drop your codeforces handle

types don't do anything put prevent the most basic retard-tier errors and enable autists to sit around and jerk off all day

Encapsulating state doesn't stop it from being shared.
Whenever you call a method on an object, you are indirectly modifying their state. If two or more objects modify the state of another object, there is shared state.
Encapsulating state like that is fundamentally flawed.
The better solution to is minimise the amount of state you have in the first place.

sort :: a -> array a -> { x : array a | isSorted x }

KILL YOURSELF YOU ARE FUCKING RETARDED AND I'M NOT GOING TO WASTE MY TIME ON YOU, JUST SAYING YOU'RE A PATHETIC IDIOT

(You) clearly don't know anything.

If you're using Java's type system, maybe.

Even Haskell's type system is quite limited.

nice gobbledygook idiot

Why do you need an initial a?

Are Haskell programmers TOO smart to be employed?

They also enable better tooling in general, eg. autocompletion and refactoring, which is desirable when you're working on large codebases that actually do things.

a is a parameter that's a type

it's the same as
sort :: forall a. array a -> { x : array a | isSorted x }

I dunno, but the first thing I do on any project is implement a Haskell interpreter

I see, the previous notation was ambiguous to me

Don't you need an Ord instance for it, though?

Define isSorted formally: I'm genuinely curious

isSorted (x:y:xs) = (x >= y) && (isSorted (y:ys))
isSorted _ = True

*y:xs
this is descending order, would want

Yeah nice, nice

>I'll just write everything by myself!
>I don't need pajeet shit like static analysis to hold my hand!
>both the design and implementation will be wholly correct the first time!
>it'll be purely functional and every line will bleed elegance!
/dpt/ - Opinionated Undergrads

well it's not haskell it's some ambiguous dependently typed language, it might not even have type classes

maybe something like

sort :: (a : ord) -> array a -> { x : array a | isSorted x }

>which is desirable when you're working on large codebases that actually do things.
oh so nothing haskell is used in.

I need a project. Something impressive and something that will take my skills from mediocre at best to where they should be as a senior software engineering student.

The most complicated piece of software I ever wrote was a simple calculator, just to give an indication of how shit my skills are. I'm OK in both C and Java and that is about it.

Bitcoin wallet.

>senior _ student

Write 2d game using lwgj and implement proper physics and for bonus isometric 3d

...

I like Haskell but I also like this joke

>reddit filename

you're a senior and the best you've done is a fucking calculator

please tell me this isn't real.

>C and Java
I don't blame him

but white man san in pajeet land schools not be that good

my school taught Java and C (among others) and there was no way to graduate without having done something greater than a calc. the fuck bumfuck school did this nigger go to?

oh my fucking god, this again. I don't fancy myself as some le epic software engineer man. Most in my program do not. it's just what my major is titled "Software Engineering".

I know, I know, we're not "real engineers". We don't hold a candle to "real engineers". It would probably be better named "Software Development" or maybe "Applied Computer Science"? I don't even know. All I do know is it's supposed to prepare me for a career in software development.

#include

int main() {

int number;

for (number = 1; number

>optimised
why didn't you join all the strings?

there improved your fizzbuzz
++++++++++[>++++++++++>++++++++++>->>>>>>>>>>>>>>>>-->+++++++[->++
++++++++[->+>+>+>+>++++++++[-]++++
+[-]>>-->++++++[->+++++++++++[->+>+>+>+++++++>++++++++[-]++++++[-]>>-->
---+[-+>[-]++[-->++]-->+++[---++[-->-[+
+++[----]++[-->++]--++[--+[->[-]+++++[---->++++]-->[
->+>[.>]++[-->++]]-->+++]---+[->-[+>>>+[->>++++++++++-[>+>>]>[+[-]>+>>]+>>]>[+[-]>
+>>]

I love lua. That's where I started my programming career was making WoW addons lol. What ya doing with lua?

My problem is for years now I've neglected to do much of anything during my breaks / outside of class. most always tend to start something, but then give up at the first sign of difficulty / confusion.

I made a calculator for one of my classes in my sophomore year. Other projects have been: multi-threaded scheduler, shell emulator in operating systems, "aliens vs humans", a simple game, in my design patterns class, implementations of sorting algorithms in my algorithms class

...and that's about it. I still have an entire year left of 400 level courses, so hopefully I'll get to work on something truly interesting / challenging

so shitty i don't even want to complete this
(function() {
function FizzBuzz(length, bool, map){
this.length = length;
this.bool = bool;
this.map = map;
};
FizzBuzz.prototype.fizzbuzz = function(){
console.log(
Array.apply(
null, new Array(this.length)).map(
Number.call, Number).map(
if (this.bool) {
var mapper = '';
this.map.forEach(function(value, key){
mapper += '(++a%' + key + '?'':' + value + ')+'
});
eval(mapper.split('').pop().join('').replace(/^/,"a=>") += "||a.join('\n')")
} else {

}
//a => (++a%3?'':'Fizz')+(a%5?'':'Buzz')||a).join('\n')
)};})();
var FizzBuzzer = new FizzBuzz(100, true, new Map([[3, Fizz], [5, Buzz], [7, Woof]]));
FizzBuzzer.fizzbuzz();

lua is love, lua is life

>Javascript: basically Lisp

Lisp fags on suicide watch

Sounds like an average CS student to be honest.

Fuck classes dude, go around town and talk to local business and talk to them. See if you can solve some technical problems people are having. Make a few websites for mom and pop restaurants and just put their hours/menu online or fix some of their computers.

>talk to them twice

i think i'm the one with autism nvm

When you start using neat tools like Greenshot along with ahk it's pretty awesome.
Effectively region of the screen capture.

And it's like 2 mouse positions and 2 clicks/presses.

How do i learn to make code go fast?
Beginners guide to optimizing something basically. Assume algorithmic optimization is done of course.

go read book on algorithms and datastructures first, then stop coding performance code in python

>impressive
For non- programmers?
Write a GUI interface for a neat CLI tool. Something like youtube-dl and libav.org/.

I recommend using C and imgui. It's really neat. And it allows you to focus on the things that people often lack. Things like exporting a youtube clip to a nicely sized gif/webm file.

It shouldn't be too hard. But if you ever struggle with libav you can just use ffmpeg and call that instead.

>go read book on algorithms and datastructures first
Yeah I already have. What kind of fucking suggestion is this though? I told you algorithmic optimization is already done.

Are you basically saying 'I don't know'? Because it sounds like it.

yeah, pretty much. I really don't deserve to have gotten as far as I've gotten. I've got a plethora of mental issues on top of being just truly mediocre and I can't ever imagine being an actual software developer. I browse /dpt/ all the time, and wonder if I could join in more often, had I applied myself, had I dealt with my borderline autism / crippling depression years ago before entering the program. or maybe I was doomed from the start, and I've always been destined to stock shelves.

sad thing is, I'm actually mid-range in my department. I know plenty of dudes in way worse shape than me. I remember last semester a senior had no idea what a regular expression was, hadn't even heard of the concept. This same guy could barely use a terminal and had no idea how to write a makefile. There was this other guy I was paired with in OS class, and he was a senior at the time. I remember writing 99% of the code for our various weekly labs because he struggled with even basic shit like switch statements and pointers in C.

Ramping up on a service that agregates 6 different backends, and provides a clean rest api for consumers.

Enterprise java project, 600+ devs, spring mostly.

#include

int main() {

int number;

printf("#include \n\nint main() {\n\n");

for (number = 1; number

C++ fags WILL unironically defend this.

#include

class Foo
{
public:
Foo() {
std::cout

defend what?

The CodeFag's Lamment

a b = c;

In C it depends on what a and c means.

In C++ it depends on wtf = means...

>I still have an entire year left of 400 level courses, so hopefully I'll get to work on something truly interesting / challenging
don't get your hopes up, it'll be mostly the same shit

thats why everybody should program in their spare time. University is here to provide general background and introduce you to concepts you otherwise might not have known even exist.

You learn to swing a hammer by swinging it, you cant read about it

You're making excuses for yourself to be mediocre instead of just improving.

#include
#include

int main()
{
char pass[20];
int checkUpper, checkNum, checkDollar;

printf("Please enter a password \n");
scanf_s("%s", pass, 20);

for (int i = 0; i < sizeof(pass); i++) {

if (isupper(pass[i])) {
checkUpper = 1;
}
}

for (int i = 0; i < sizeof(pass); i++) {

if (isdigit(pass[i])) {
checkNum = 1;
}
}

for (int i = 0; i < sizeof(pass); i++) {

if (pass[i] == '$') {
checkDollar = 1;
}
}

if (checkUpper == 1 && checkDollar == 1 && checkNum == 1) {
printf("That is an acceptable password. \n");
}
else {
printf("That is not an acceptable password. \n");
}

return 0;
}

This keeps crashing for some reason if I try to populate the char array with user input, but if I just do char pass[] = "Ding$dong1"; and don't take input it works fine.

Nothing wrong with OOP... try writing everything in assembler and get back to me in 15yrs... when your app is ready for sale!

this should not compile

python my dudes

Is anyone in Sup Forums that actually works at a company, and is not a student/basement dweller?

Your error called... it said "You had me at char *"...

What you wanna know?
About the coffee or the donuts?

LMFAO ALIENS VS HUMANS PLEASE TELL ME THIS ISN'T 5912

>Enterprise project, 600+ devs
would like to see some pytards try this with python

What?

Was just wondering what Sup Forums think about huge projects.

I feel like there are no actual coding challenges, other than handling tons of unskilled idiot devs that are in your team, and having a "hard" time coming up with a proper architecture.

I miss having coding challenges, since my work mostly consists of tackling architectural/soft skill/clean code/performance ones.

>get new job
>one of the employees finds out i have a degree
>he asks me for my school
>he starts questioning whether it's a state school in order to invalidate my degree

Why are programmers so mean

he just wants an explanation for why you're so shit

That's why most software development is done in India... they're used to being bored while wading through hip deep shit...

What do you think it will print out?

It does.

Insecurity. The only people that care about this shit are insecure cucks that have been fooled by the system to think a name means anything.

Although one could probably argue that the only people that say it doesn't matter are those that couldn't get into """"top""" schools. Catch 22 tbqhwy senpai.

While I agree that C++ code should never compile as it's an abomination that should be undone.

What's wrong with that code? No explicit return in main is a problem but it compiles.

Only the fittest survive the code jungle...

I, i didnt even start coding tho