Old thread: What are you working on, Sup Forums?
/dpt/ - Daily Programming Thread
Other urls found in this thread:
hackerrank.com
twitter.com
first for ALGOL
C++
Python is shit.
Go is shit.
What about Swift and Rust tho
How's that unemployment treating you?
import bad opinion
>projecting
How do we make the Java Virtual Machine better?
What do you shit on Python? It's really comfy compared to bash for quick stuff, nobody forces you to design large projects in it
Penises are not sfw
swift is like the shitty python
Rust is like what you get when you put C++, Erlang and C# in a blender and what hard to swallow substance comes out in the process
I can kind of understand why Sup Forums hates on Python, simply because it is often overhyped. It's not a bad language (as long as you hate performance), but it's not the Solution to Programming that it's often made out to be.
>It's really comfy
No
>nobody forces you to design large projects in it
But people do, and so we end up with garbage like docker
Has Apple moved from obj-c? I member obj-c being alright. Sorry, just woke up from a coma
>Has Apple moved from obj-c? I
no
>I can kind of understand why Sup Forums hates on Python
Performance actually. Nim will solve this problem by translating directly to C
>Python is shit.
Why?
Can someone write me a pseudocode on how to swap 2 chars in Java String, move to positions, do it again, and so on...
String is guaranteed to have an even length.
For example:
abcd becomes badc
or
abcdefgh becomes badcfehg
and so on...
Rust is what you get when you mix ML and Cyclone dumbass.
>Rust
Everybody I know, whether it’s personal or corporate, selects a subset and these subsets are different. So it’s not a good language to transport an algorithm—to say, "I wrote it; here, take it." It’s way too big, way too complex. And it’s obviously built by a committee. Reddit campaigned for years and years and years, way beyond any sort of technical contributions they made to the language, to get it adopted and used. And they sort of ran all the standards committees with a whip and a chair. And they said "no" to no one. They put every feature in that language that ever existed. It wasn't cleanly designed—it was just the union of everything that came along. And I think it suffered drastically from that. -RMS
And yet it still doesn't have HKTs.
>tfw I like both
>It's really comfy compared to bash for quick stuff
But that's wrong. Bash is so integrated with desktop Linux that it just makes sense to use. Can you even replace bash scripting with Python?
Based Rust
>desktop Linux
>desktop Linux
>desktop Linux
that's too much user
What's wrong with nested functions?
Too hard for a c tard
This is some solid bait.
>desktop windows
/dpt/ are to much of brainlets to solve this easy problem and explain it properly
sorry friend
like dis?
for (i = 0; i < str.len; i += 2)
{
c = str[i];
str[i] = str[i+1];
str[i+1] = c;
}
Of course you do. You are a retard.
>halve the string
>join the two halves
wew lad
>RMS
Stopped reading right there.
How do we save web development?
Start over from scratch.
>stopped reading at end of post
wew lad
...
59407432
Okay
>being this new
>C++ leads to really really bad design choices. You invariably start using the "nice" library features of the language like STL and Boost and other total and utter crap, that may "help" you program, but causes:
> - infinite amounts of pain when they don't work (and anybody who tells me that STL and especially Boost are stable and portable is just so full of BS that it's not even funny)
> - inefficient abstracted programming models where two years down the road you notice that some abstraction wasn't very efficient, but now all your code depends on all the nice object models around it, and you cannot fix it without rewriting your app.
> - Linus Torvalds
Where did I say that?
The end only has meaning relative to the beginning. In this case they are both equal.
Nobody reads large blocks of text. They skip to the end for a summarization, if any, or skim for relevant keywords.
Having no libraries is better than having this library
Stop langposting.
The more the find out about Deadlang, the more it seems like a stupid joke.
>Nobody reads large blocks of text.
real niggas program in php
The codes still look 5.15 times beautiful than most compiled languages
>katie_kloss_programming.jpg
?
What's the issue?
lacks so many things 2bh. I am thinking of adding more to the algorithm lib
> (let ((x '(a b c d e f g h)))
(loop for n from 0 below (length x) by 2 do
(rotatef (nth n x)
(nth (1+ n) x)))
x)
(B A D C F E H G)
perfect
Perfect. Thanks
What's so bad about it?
>codes
Hello Pajeet
goto
>The ulimit -v command makes little sense with ASan-ified binaries because ASan consumes 20 terabytes of virtual memory (plus a bit).
59407666
You thought I'd give you a (you), didn't you?
hackerrank.com
So why didn't
SELECT name
FROM city NATURAL JOIN country
WHERE continent = 'Africa';
work as a solution to this challenge? The resulting table is empty. This worked:
SELECT c.name
FROM city c JOIN country o ON c.countrycode = o.code
WHERE continent = 'Africa';
My computer doesn't even have that much virtual memory.
While you're all arguing over inane shit I'm gonna go be productive in C.
>C
>productivity
Choose one.
Isn't Docker written in Go? And while people do choose to use Docker in production, it's usually a very small percentage.
>I'm gonna go be productive in C.
>c
>productive
>C
>Productive
as much as you guys bitch and complain and mock OOP (Java gets it the worst), you sure looove C++.
...
>as much as you guys bitch and complain and mock OOP
only 2 people; one of them is the gate keeper kid
I understand that you're not capable of it, but I am.
Don't you know Sup Forums?
It's better to just fight over what language is ''""better"""" with strangers on the internet than actually do something productive
- all/any aren't stupid functions, but the syntax for using it is stupid.
- balancedParens is stupid, and has no business being in a standard library
- boyerMooreFinder is a fucking stupid name for the function. The name should be what it does, not how it's implemented. Even C's strstr is a better name than this.
- canFind is also another dumb name. 'contains' would be better.
- count and countUntil are very different functions, despite having very similar names. countUntil is a stupid, unnecessary function, anyway.
- I don't think commonPrefix has any business being in a standard library. It's too niche and too easy to implement yourself.
- find is what boyerMooreFinder should be. Why the hell are there two functions which do the same thing?
- findAdjacent is stupid, too niche, and doesn't belong in a standard library.
- findAmong name isn't clear enough.
- findSkip seems too similar to the facilities provided by other functions, including findSplit, findSplitAfter, and findSplitBefore
- minCount and maxCount are stupid and unnecessary. You already have the more general 'count'.
- minElement/minIndex and maxElement/maxIndex are not sufficiently different. It would make a lot more sense to just return a pointer or some shit.
- minPos and maxPos are stupid and unnecesarry. The above functions can easily be used to to this.
- mismatch has no business being in a standard library
- skipOver is the fucking same as findSkip.
- startsWith probably isn't general enough. I normal string comparison with a maximum number of characters to check would be better. Does this really belong in the "searching" module?
C++ is a fine language as long as you avoid the enterprise OOP bloat.
>but I am.
"sure"
>The tired "my subset of C++" argument
You sure convinced me, bud.
Keep telling yourself that.
>The name should be what it does, not how it's implemented
The implementation algorithm make a difference.
Add
-No array concatenation
-No findCommon()
-Literally no maths method like avg, mean, total etc
>all these people buttblasted over user just doing things
Lmao keep up the good fight senpai.
It is the solution to allow even retards to program
Programming is not really anything special
Why do we want everyone to learn to program? Isn't that a guaranteed way to end up with a world of 99% garbage code?
programmers are glorified typewriters anyone can learn to write good software
...
Did you guys hear the news?
Retard Bitcoin Unlimited devs
Thanks to non peer reviewed code, 75% of nodes just crashed!
Thats why you don't trust software written by two people.
Bitcoin core all the way.
this
We don't. All I am am saying is Python is designed with the intention to retain high level functions while catering to retards. Why do you think it is the most popular language among apple fags?
...
"The most powerful programming language is Lisp. If you don't know Lisp (or its variant, Scheme), you don't know what it means for a programming language to be powerful and elegant. Once you learn Lisp, you will see what is lacking in most other languages." -Richard Stallman
Keep up the good work user
Both Boyer-Moore and a linear search are going to return the first occurrence of the substring, it's just that Boyer-Moore is a better fucking algorithm with a O(n+m) runtime and naive linear search being O(nm).
Why isn't there just a find function that is "overloaded" with Boyer-Moore when you're searching for a string in a string?
>Richard Stallman
Stopped reading right there.
anybody can program. anybody can produce software. anybody can understand simple algorithms. anybody can make a calculator program in Python or Java. not anybody can produce quality software. it takes years of practice to get to that point.
programming is easy to learn, hard to master.
yeah, its the end of the sentence
>inb4 took the bait
"".join(a + b for a, b in zip(s[1::2], s[::2]))
Prototyping Snake Battle with classic vibe
>Unity
That garbage doesn't belong here.
Is that a problem?
Whats wrong with Unity?
Another brain damaged idiot detected.