[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y ] [Home]
4chanarchives logo
programming
Images are sometimes not shown due to bandwidth/network limitations. Refreshing the page usually helps.

You are currently reading a thread in /g/ - Technology

Thread replies: 255
Thread images: 19
File: 94_120224154929_1.jpg (36 KB, 439x477) Image search: [Google]
94_120224154929_1.jpg
36 KB, 439x477
programmers of 4CHAN, your favourite weapon?
>>
regex
>>
Can someone objectivly explain to me why python is so hated?
>>
>>55461163
Ive been wondering this my self; selfish, pointless bump
>>
>>55461163
why do you think this picture resembles python as a shit language?
its fuckin great weapon man
it is not spoon, is it?
>>
>>55461163

Just a bunch of kids hating it because it's popular.
>>
>>55460954
At least i can butter me some delicious toast
>>
>>55461252
when actually it is not that popular at all
>>
>>55461163
/g/ hates it because it's kinda a good intro language. And /g/ hates when normies get in their hobbies
>>
>>55460954
>c is not a machete
Are you even trying?
>>
>>55461302

How is Python not popular? The bio/chemoinformatics industry uses it a lot, and even for a beginner programmer it's known for being a stepping stone. I'm not being rude or sarcastic at all, I'm genuinely curious as to why it isn't considered popular?
>>
>>55461351
because its nonusable at all
and the things it is used in are easier and better with other languages
>>
>>55461302
It's popular in the financial companies, web development, academia. How is it not popular?
>>
>>55461163
White spaces
>>
>>55461409
> I don't know what I'm talking about
>>
>>55461163
>>55461217
>>55461244
>>55461252
yeah right, best language ever!
read about its best features and you will love it:
garbage collectors
typeless variables
whitespaces as part of the syntax
bytecode generation
confusing API and documentation
migration from python 2 to 3 (my favorit, just read about what the major differences are and why its not downwards compatible)

if __name__ == "__main__":

i love it
>>
Can we get a version in a not shit resolution?
>>
I like python
>>
>>55460954
c# for high level
c++ for computing intensive tasks
c for low level

web dev fags can fuck off
>>
>>55460954
I wouldn't have put Perl as a Katana, more a Swiss Army Knife made of chainsaws
>>
>>55461485
>It's popular in the financial companies
No it's fucking not
>>
>>
>>55461744
Bank of America, JP Morgan to name a few.
>>
>>55461305
Or /g/, in their pretentious ways, wants to be distinguished from noobs. And python is a noob friendly language so it's got to go.
>>
>>55461818
Wow, two banks use it, most likely for some tiny job that the CEO's wet behind the ears nephew was brought in to do so he could earn thousands and put something on his CV.

The *REAL* financial shit is written in Assembly by men (and it is always men) with aspergers so crippling they make the average R9K fag seem like a normie, or in Cobol or Fortran in a dialect so ancient and krufty that only one ancient balding tech actually knows what half of it does. You know, the kind of guy who has a first edition of Kernighan and Ritchie on his desk - that he's never read (he'll try this newfangled 'C' language when they get it stable), who'll regale you with stories about getting locked out of the machine room because a disk drive the size of a washing machine walked across the room and blocked the door, or the great tab key crisis of '82.

That's *REAL* financial computing, not chicken shit hotdogger "Hello, World!" crap
>>
>>55460954
>python is a chainsaw

I... Agree actually.
>>
File: 207 - Wqwke.gif (2 MB, 351x276) Image search: [Google]
207 - Wqwke.gif
2 MB, 351x276
>>55461943
I think you're the one with aspergers, mate
>>
>>55462030
I've got a pair of shoes older than you are kid, so shut up
>>
File: 018 - LEmKh.png (466 KB, 580x482) Image search: [Google]
018 - LEmKh.png
466 KB, 580x482
>>55462039
>>
>>55461594
ok NEET.
>>
>>55460954
C/C++

java in extreme cases where cross-platform is
>>
File: 1406859033078.jpg (45 KB, 1024x682) Image search: [Google]
1406859033078.jpg
45 KB, 1024x682
>>55461163
Python is literally the best weapon pictured
>>
you can't directly deploy a cross platform in C++ without recompile it and make it available to lot of users in short time to test it, so C++ isn't as a multi-use as you tried to make it look like, Javascript in the other hand is everywhere there are even little JS parsers that can run in µC, so JS is the real power tool.
Python sucks like shit if you wanna do something useful you need numpy that its like using octave or matlab because python is slow by itself.
Javascript loops are fast by itself.
>>
>>55460954
php without mysql
>mysql an specific sql engine
>so the other languages understand sql by itself oh wow!

the person who made the image is an idiot.
>>
>>55460954
lisp should be a knife-making tool knife
perl should be a sword that you only sharp once
pascal should be an old and blunt letter opener
haskell should be some exotic fucking asian polearm extremely sharp and indestructible but pretty hard to use
C should be a bastard sword
ruby should be a decorative kukri, one of those fake bullshit weapons you can buy in some chinese store
for the rest, it's pretty much correct
>>
>>55461163
its like basic but nonprogrammers who use it have MASSIVE egos about the one time in the late 80s they automated a math problem that wasnt even hard with a calculator
>>
>>55462333
>C should be a bastard sword

No, C should be an indestructible hammer to make other tools.
>>
>>55460954
And what of Fortran?
Fucking cs people not even mentioning the fastest programming language for doing numerical calculations.
>>
>>55462361
no, c should be a banana
>>
>>55462361
You may try and write a programming language in C, but it will be an extremely slow process due to the amount of the moving parts and to the verbosity of the language.
Lisp, instead, allows you to write macros out of the blue to be universally used everywhere, every time in your code, without distinction between compile/run/whatever time.
So, C would be a hammer, - yes, but to be used with cold steel.
>>
>>55462399
>fastest programming language for doing numerical calculations

Assembly?
>>
>>55462399
Nobody gives a fuck about which language is fastest. “Programs must be written for people to read, and only incidentally for machines to execute.” - Harold Motherfucking Abelson, the author of SICP
>>
>>55462424
Assembly is for when you want to really have fun. My last assignment was to code qbert in assembly that would play over uart and my partner were the only ones to get color gfx going
>>
>>55462417
>hur durr lisp
http://git.savannah.gnu.org/cgit/gcl.git/tree/gcl

all those .c files, if lisp is so good why everything its transpiled first to C?, because C is the ass kicker language of world all languages, C is like the old magic master you'll never overpass because he is from other dimension and the other languages are just students living because C want it.
>>
>>55462475
your fucking right.
>>
>>55462486
>assignment

/g/ is no place for children
>>
>>55462486
assemblers are the easiest, dumbest and unproductive languages.
>>
>>55460954
Assembly.
>>
>>55462399
>2016
>hur dur memetran
>hur dur fast calculations
bitch please, JS in V8 runs same or faster than that shit.
>>
I want to learn programming as something to do, What language should I learn if I want to make shitty video games?
>>
>>55462560
Learn Java
write once, run it everywhere (specially on android) with good performance.
>>
>>55460954
Holy fuck this makes no sense. Have you ever used any of these before?
>>
>>55462496
>gnu common lisp
toppuru kekkuru
No, seriously. Lisp is already not among the champions among the most used languages... and then you go and pick the most obscure implementation.
Aside of that, the first release of every language is written in an older language, just to pass to the same language afterwards. The first C compiler was written in B, just to make you an example.
But my objective was not to state that C is not used to write languages, or that it's not suitable to do that. The substantial difference is that a new language in C is a whole new project to take care of, while writing a DSL in lisp is a really common technique. You write macros with almost the same frequency as the functions. (For those who don't know lisp: macros may add/modify the language while it's being used; it's something like adding a logical construct similar to IF in C on runtime)
>>
>>55462560
Javascript
>>
Cpp11 the best
>>
>>55462560
>C++
>C#
>Lua
>Java

pick one
>>
>>55462627
I choose prolog.
>>
>>55462536
Easy when you get the hang of it yea, but it's only unproductive when you have to optimize code, that takes forever and a day

Also how is it dumb? It's literally as basic as it gets to get that extra speed when you don't feel like trusting you're compiler
>>
>>55461163
easy to get started, so all the programming forums got flooded with script-kiddie tier questions/comments coming from people claiming to be python programmers.

>>55460954
clojure/clojurescript master race.

>C++
i'm not a game developer
>javascript
literally why ever write javascript directly when there's better languages to transpile from?
>java
JVM is my waifu, Java is not
>php
I don't work at facebook
>ruby
I'm older than 20
>perl
im younger than 40
>lisp
lisp isn't a weapon, its a class of weapon
>visual basic
i'm older than 12
>haskell
i'm employed
>python
never needed it
>C
I have release cycles shorter than 2 years.
>>
>>55461163
python is programming for non-programmers
>>
File: 1457552759734.jpg (436 KB, 1182x966) Image search: [Google]
1457552759734.jpg
436 KB, 1182x966
>>55462696
this post
>>
File: 1454733157657.png (483 KB, 529x470) Image search: [Google]
1454733157657.png
483 KB, 529x470
>>55462712
Its my first language though , I just want to be like you guys!
>>
>>55460954
Java. I'm building a front end to store all my small business important data, including payments and client info. The data is stored in mysql.
The UI is made on javaFX.

I tried to migrate to Qt but the bindings for Java sre outdated.

Java was the second programming language I learned but it just feels so comfy I rather use it than deal with pointers. Yes, I'm lazy and that's okay since I'm not a professional programmer anyway.
>>
File: CWsalQ5WIAAXedb.jpg (39 KB, 542x490) Image search: [Google]
CWsalQ5WIAAXedb.jpg
39 KB, 542x490
>>55462750
Thats alright
>>
>>55461013
This.
>>
>>55460954
C#
hah
>>
>>55461163
It's an intro language, which is why a chainsaw is a perfect visual. New programmers are wild and untrained, while a trained programmer will use something that can specialize in multiple roles, like C or C++

Haskell as mushrooms is also accurate
>>
>>55461409
nigger u retarded
>>
>>55462750
then learn a compiled language.
scripting is for prototyping.
>>
>>55462966
>literally artificial difficulty
Compiled language are just for prototypes , why don't you use assembly? :^)
>>
>>55460954
As an American I demand you add a gun to that pic to help me make up my mind.
>>
>>55460954

I don't view programming languages as weapons, but instead, accessable tools.

If you consider everything alone, then technically, it's useless. Sure, you can do more with some things alone than others (such as being able to do tons with C++ over PHP), but being able to truly adapt and know what to use each tool for is more important than picking a single tool for a job.

Sure, it's also important to be versatile, but like a Swiss Army Knife (C++) some languages can do things much better than C++ can, even though C++ can bundle them all in one. It's why even though Swiss Army Knives are useful, it's a jack-of-all-trades, master of none situation. I'd rather use my own pliers than a Swiss Army Knife, but there still is just that - pliers.

So yeah, I choose PHP.
>>
>>55460954
>visual basic
>a fucking spoon

As someone who had to learn visual basic for mechanical engineering requirements (fucking why? Python is a lot more useful in the real world, if not sloppy and unrefined), I can attest that it's a miserable language that has no real purpose when things like C/C++ and Haskell exist.

TL;DR if you only have visual basic, you can make it work, but if you possibly can use any other language fucking run from VB.
>>
>>55461409
>python
>non usable
fuck off
>>
>>55463008
Let me rephrase it another way.

Python is 000 buck in a 12-gauge or an AK, C++ is a gun safe full of specialized firearms like suppressed handguns, long-range rifles, close-quarters carbines, etc.

You can do most things with python- not well, but you can do them. But C++ is better because it's far more precise when used properly.
>>
>>55461511
>garbage collectors
nothing inherently wrong with this unless you're the kind of idiot who thinks one language should do everything
>typeless variables
I'm not a fan of this though. makes for poor readability. I much prefer static typing with type inference .
>whitespaces as part of the syntax
elaborate on this otherwise I'm going to assume you're repeating shit you overheard
>bytecode generation
also elaborate on what you think is wrong with ILs
>confusing API and documentation
there's some truth to this. it's all over the place.

3/10 mediocre post
>>
>>55462516
did you read the assignment? fuck off basement dweller
>>55462989
he can pretend to be cool, not that cool
>>55463008
same
>>
>>55461163
It's commonly a beginners language, so people think that automatically makes it shit.
Also, it has the significant whitespace thing, which is not actually bad at all, but since people like to argue over pointless syntax details, it's easy to pick on Python's whitespace.
Also, because it's interpreted and isn't C, it's not super great in terms of performance, so people like to act like that's a deal breaker (when reality it makes no difference).

I could actually explain to you the pros and cons of python, which there are plenty on both sides, but people rarely collectively hate things, rationally.
>>
>>55463081
More like python is an AK and C++ is a knife, you can kill with both, but one's way easier to do it than the other.
>>
>>55460954
Everyone should use Assembly and end this cycle lazy code, every time an advancement in hardware comes along the code gets sloppier and sloppier, to the point where it negates any benefit from the new hardware.
>>
File: 1467916833879.jpg (91 KB, 439x477) Image search: [Google]
1467916833879.jpg
91 KB, 439x477
>>55460954
lmftfy
>>
>>55463147
Apart from shitty multithreading and rather young async programming support, what other disadvantages does it have?
>>
Lua would be Stick and Stone as it runs almost Everywhere.
>>
>>55463147
I actually make a living from programming, working with Python for 3/4 year now (because my employer requires it). I really dont get the 'hate'
>>
>>55462966
summer is here
>>
>>55461163
One word: the forced indentation of code
>>
Which language would you recommend for an autistic neet that couldn't graduate middle school due to ADD and never understood Algebra? Seriously guys help me get off of welfare.
>>
>>55463209
>shitty multithreading
The GIL is actually an amazing design decision in my opinion, you don't have to worry about any problem normal multithreading brings up, and accessing/modifying variables and objects is as easy as passing it to the thread as arguments
>>
>>55463267
and that's bad because..?
>>
>>55463284
but that leaves fewer benefits of multithreading, in terms of executing the Python's bytecode.
>>
>>55463433
Performance-wise?
If you're performance min-maxing you wouldn't be using Python on the first place
>>
>>55462989
The difficulty of a problem is not the language.
Sure your fizzbuzz is slightly shorter in your meme language, but it doesn't change anything.

You use programming to solve problems.
Those problems are not easier because you use python.
Leaving out data structures does not make it easier for beginners.
Having a syntax dependent indentation is not a substitute for a coding standard.

That does not mean it should never be used.
I get that there is a need for quickly setting things up.

If we compare it to C++, you have a higher learning curve, as you need to learn how to write makefiles, cmake or qmake files as well as the language.
Sometimes these things are too much for people.

But you could use an IDE, that would automatically generate templates, so you don't have to spend too much time on these things.
>>
>>55463275
You cant really into programming without algebra
>>
>>55463469
I use python to solve problems.
Those problems are easier because I use python.
Leaving out data structures does make it easier for beginners.
Having a syntax dependent indentation is a coding standard.
>>
>>55463275\
>couldn't graduate middle school

https://scratch.mit.edu/
>>
>>55463275
https://blockly-games.appspot.com/maze
>>
>>55463469
>python having a higher learning curve than C++

literally how many LOC have you written in each language? your posts reek of "I only know one language so that language is the best".
>>
what people think about D on the board?
>>
>>55463298
Because it makes auto indent effectively impossible
>>
>>55462696
opinion on D language?
>>
>>55461163
Pip and virtual env dont do what you think they do. they don't isolate system level libraries (like for ssl) so it is very very hard to completely lock down a python project at build time.
>>
>>55463686
never been on my radar, sorry.
.
.
.
said every programmer.
>>
>>55463516
>Those problems are easier because I use python.
I don't know what sort of problems you are solving, but are they really dependent on the language?
I mean, complex problems is usually handled through the api to a library.
If there is a good library, it becomes easy on any language.
If there isn't a library, then I spend a bit more time to make sure it is designed correctly, according to my own needs here and now, and how to make it general, so it can be used in the future.
These things takes time.
More time than it takes to type the words.
I don't think using a compiled language slows me down.
>>
>>55463686
It's like C...
except it's intended for games...
except it doesn't have any libraries...
because nobody uses it.

7/10, good language for making yourself feel special, but the C-like syntax prevents it from reaching the heights of Brainfuck.
>>
>>55463565
>>55463595
Oh Ha Ha Ha making fun of an autist to prove that you are slightly better than an autist, well you accomplished it you autistic fucks
>>
>>55463597
I primarily work with C++, but I have written some python as well.
I don't have a count of how many LOC, how many times have you posted here?
>>
personally i hate Javascript for being the means for Fbi and Nsa of tracking every single step you do on the web and the means for FB to create your virtual personality preferences model to make shitload of money by shitty ads. Happy to hear that if you use it correctly Tor has possibility to make them go fuck themselves and leave you anonymous
>>
>>55463809
How do you decide what to write yourself and what to use a library for?
>>
>>55461163
I'll give you my reasons :
- No type safety, when it could actually be possible and optional (see: type hints in Python 3.5)
- The. Fucking. GIL
- No JIT
These two first are my main concerns and made me waste a lot of time. The lack of JIT basically forces you to not write critical code in Python, which is fucking retarded when you think about it.

And yes, I know about Cython and PyPy and I don't give a single fuck.
If I wanted to write statically typed code I'd go straight to C++ and PyPy doesn't support the libraries written in C, namely numpy.
>>
>>55463850
ok dude if you can't do basic algebra and you didn't graduate middle school, and you're on welfare, BUT YOU STILL POST ON 4CHAN, then you 99% likely will NEVER pick up programming. I was being optimistic with you by sharing that link, but my honest recommendation is that you go try to be a welder, or save enough money to get HVAC training, because that's about the best thing you can aspire to, save a miracle.
>>
>drop out of middle school
>clearly mentally disabled
>thinks he can get a job if he reads a single book about learning how to use a single programming language

Where are these code monkey jobs that only require someone have basic proficiency with a programming language and nothing else?
>>
>>55462696
>clojure(script) master race
mein neger
JVM sucks though, it's being held back by retrocompatibility and the retarded choices made during the early stages of its development. It doesn't even have TCO because of its retarded policies.
>>
>>55463972
My bad I thought you were trying to make fun of me, I can do basic algebra, I just can't memorize equations, to get the correct answer I would solve it in my head but I couldn't explain how I did it so I was not able to advance past pre-algebra.
>>
>>55464174
You will be fine then
>>
>>55464110
desu I don't even miss TCO after grokked more and more of the sequence library. Recur does a 90% good enough job tho.

I don't even glance at other general-purpose languages anymore. I'm gonna be an old man bitching about how ring didn't support async handlers until 2016.
>>
>>55461511
>bytecode generation
import sys
sys.dont_write_bytecode = True
>>
>>55463972

>welder, or save enough money to get HVAC training

You actually have to understand the fundamentals of electricity. Some welding jobs even require heavy use of AutoCAD. Algebra is heavily used as well, especially when it comes to fitting pipes/other crap into small or tiny spaces.

>Journeyman Pipefitter
>>
>>55461511
literally your own legitimate complaint is the confusing documentation
>>
>>55464439
which is objectively wrong
python's documentation is great
>>
>>
>>55462333
Haskell is a ship mounted gun with a complicated set of gears that you have to re-assemble every time you want to shoot at something different.
>>
>>55463864
does any of you thinks i am right?
do you feel the same?
>>
>>55464587
here's your (you).
>>
>mfw Java/C# is my language
>Java/C# represented as butterknife
>I cut everything irl with a butterknife because it's safe

This is definitely accurate.
>>
File: rimat.jpg (110 KB, 352x502) Image search: [Google]
rimat.jpg
110 KB, 352x502
My job is mainly Java and JavaScript so those are the languages I've become most comfortable with out of necessity. I've worked with them for thousands of hours now. As far as programming for entertainment I like low level C programming. There's something cool about being closer to the hardware and not in a virtual machine.
>>
>>55461293
toast
>>
>>55462610
why java when u can c plus plus?
OP HERE
>>
>>55463664
D is an even bigger meme than rust
>>
>>55464947
I heard FB uses D and that's why i wonder if someone thinks it sucks. would not believe to hear FB, which is one of the most popular social media websites, uses that bad language.
>>
What is ruby? A blender? That abortion sucker thing?
>>
>>55464960
facebook also uses haskell, you are not seriously saying haskell is a good language for right?
>>
>>55464960
Facebook also uses more PHP then anyone else, draw your own conclusion.
>>
>>55465225
>>55465340
I HAVE NO PROBLEM OF ADMITTING THAT LANGUAGES SUCK
BUT I JUST WONDER WHY THEY CHOOSE TO USE THAT LANGUAGES...
ANYONE HERE TO EXPLAIN TO ME WHATS POINT OF THEM AND WHY THEY CHOOSE THEM?
WHAT IS THE REASON THEY CHOOSE THAT LANGUAGES?
I BET YOU CAN STATE SOME REASONS
>>
>>55465487
language hipsters work there, just like why sjwzilla chooses sjw languages
>>
>>55463673
You are fucking retarded
>>
>>55464544
Very cute and agreeable cartoon.
>>
>>55460954
>favourite weapon
whatever I'm getting paid to work with
>preferred weapon
clojure(script) and GNUtils+bash.
>>
>>55463896
I'm an idiot, what exactly does the GIL do?
>>
>>55460954
>single-edged sword for Perl
it's the little things
>>
>>55461943
awful as a post, great comedy
>>
>>55463107
whitespace being significant in any sense other than delimiting tokens is confusing for both the parser and programmer. just denote nested things with some form of bracket ffs.

nesting with hanging indents is fine on the chalkboard but it's stupid in text.
>>
>>55464544
That was pretty spot on except for Perl. It never stopped being a good language any more than C/C++ did.

Perl is like a butterfly knife, it's easy to wield if you just open it up and use it like a fixed blade, but experienced users can twirl that shit around like nobody's business.
>>
>>55467596
yea and if you use it at all you look like a complete loser
>>
File: 1467916833879.png (237 KB, 438x728) Image search: [Google]
1467916833879.png
237 KB, 438x728
>>
>>55461546
Agreed. What the fuck is Ruby supposed to be anyway? Some kind of prostate stimulator?
>>
Perl is my fav, but why is it a katana?
>>
>>55469034
perl sucks

state at least one reason perl should ever be someone's favourite language
>>
>>55469686
Because people like you hate it
>>
>>55466543
The GIL is the Global Interpreter Lock.
It doesn't allow multiple threads of the same process to run simultaneously, making any attempt to write parallelized code a pain in the ass. Instead, you have to use the
 multiprocessing 
library and then you don't have any shared memory unless you use very basic data structures or implement them yourself.
>>
>>55460954
> tfw no python qt to pet and caress.
>>
>>55469686
>Avoiding the question
>>
>>55462938
I though they were UFO's
>>
>>55460954
Python for scripts and automation
C when performance counts
Java for general purpose

The holy Trinity. Can't beat it.
>>
>>55469686
the burden of proof is on the accuser. what ISN'T great about perl?

It's the fastest interpreted language
Works well without the need for extra packages, but has a great package manager when they do become necessary (or convenient).
Uses semicolons and braces instead of being indent based.
Experienced programmers can write what would take another language 10+ lines of code in 1 or two without a huge loss in readability, because Perl is just so intuitive. For example, look how easy it is to count the number of a certain character in user input:
print <> =~ tr/a//;

That works because running a transliteration regex returns the number of replacements made. Little things like that make the language a great tool for writing few lines of code with a lot of meaning.
>>
>>55472654
Okay, you've convinced me it would be nice to know. It still looks like somone had a stroke in the middle of trying to type a sentance.
>>
>>55472654
I love perl, which is also why I hate it, the vast majority of stuff I'd want to write is possible in perl (sometimes easy, sometimes not so) which is wonderful, but at the same time it means that I never feel the need to learn something new.
>>
>>55460954
>c# and Visual studio.
Fucking love it.
>python
love it. Love the syntax not sure what I can do with it though. I'm more of an app dev than SW Dev.
>JavaScript
It's okay, looks ugly as fuck. I hate parts of it. Really like JQuery though.
>PHP
Shit.
>Java
Pretty much the same as c# but the IDE's are fucking dog balls.
>>
>>55460954
Your image is retarded in every way.
>>
>>55464110
>>55464302
JVM is going to support tail recursion eventually, don't worry. Java is getting more functional features and the big new JVM languages all would benefit a lot from TCO, so it got bumped up in the priority list.
>>
>>55472654

>Fastest interpreted language
Javascript/Lua

>package manager
Literally every mainstream language has one. Some good some bad

>Uses semicolons and braces
Only python uses indentation, also there are far more important things to a language than syntax

>Experienced programmers can write what would take another language 10+ lines of code in 1 or two without a huge loss in readability, because Perl is just so intuitive. For example, look how easy it is to count the number of a certain character in user input:

Perl was largely discarded because of how unreadable it is. Yes you may condense LOC count but it comes at the cost that only someone intimately familiar with the language can figure out wtf is happening. Python was inspired by Perl in this way which is why it makes everything more verbose and readable. Same with ruby.

That line of code makes no sense to anyone but you.

Perl is garbage.
>>
>>55472945
>no sense to anyone but you
Still easier to understand than C++ code.
>>
>>55472945
>Something something bad workmen
>Something something blaming their own tools
>>
Lawful evil: Java
Neutral evil: C++
Chaotic evil: Javascript

Lawful Neutral: ADA
True Neutral: Python
Chaotic Neutral: C

Lawful good: Haskell
Neutral good: Lisp family
Chaotic good: Perl
>>
>>55472945
>That line of code makes no sense to anyone but you.

pretty sure most intermediate perl programmers understand it. just because you don't or can't be bothered to doesn't mean no one gets it.

Most everyone on /g/ loves Vim for some fucking reason, but we get people who hate Perl. Why? The argument for Vim is once you learn it it's way better than any other method, and that's about the same argument made for Perl. Except Perl works fine without having to learn all the shorthand; it's just a nice extra.
>>
>>55460954
I write java in vim and nobody can stop me
>>
>>55460954
Assembly/C/Perl/Python/PHP/JavaScript/HTML
>>
>>55468690
It's a black hole because it sucks.
>>
>>55461163
People have different reasons, and sure, some of it is hatorade. The whitespace things is unusual, but not really a showstopper for me.

What kills it for me are it's lack proper scoping (lexical block scoping is best scoping) or proper variable declaration. Of course, this is just my opinion because I prefer languages with these features.... The lack of them has bit me in the ass and slowed me down enough times that I stopped using it.
>>
>>55460954
i consider myself more of a coder than a programer but i exclusively use binary and then turn it into assembly with a hex loader so its more portable
>>
>>55464580
Absolutely right. But you should add the fact that it shoots damn straight :^)
>>
>>55465225
Haskell is one of the best programming languages in existence. The problem is: it's hard for the average code monkey who learnt some imperative '80 meme bullshit in codecademy/bootcamp/DESIGNATED pajeet "university" to understand an excellently implemented declarative functional language.
>>
>>55466076
mein neger. Clojure(script) fukken rules.
>>55472654
>perl
>throw_it_into_le_garbage_maymay.tiff.psd.MANIFEST
>>
>>55473632
>i consider myself more of a coder than a programer
Whats the difference
>>
>>55474074
meme points on a chechenian popular throat singing BBS
>>
>>55472964
>C++
>Hard to understand
You are a true currynigger if you can't understand this code I wrote 4 years ago
http://pastebin.com/2EHeUyEy
>>
>>55474074
pretty much that i'm better than u in every wya
>>
Fortran
>>
>>55464544
Quite good, except for Rust. Rust has progressed a lot in the last 2 years, and I think it will become very popular
>>
>>55474135
>all those libraries
lazy nigger
>>
>>55474135
not him. It's not hard to understand, but to write correctly. In other words, C++ makes easier writing a bunch of unoptimized bullshit than good code.
And, since I'm not a C++ programmer, I understand your code but I'm unable to tell it from one or another.
>>
I'm a beginner in C programming, my only experience with programming was with Java, with everything pretty much handed on a plate to me.

It took me like 2 to 3 hours to write a simple function to sort integers in an array from smallest to largest, should I just give up programming and kill myself?
>>
>>55474420
nah. That's how much time an average C begginner employs to write functions. C is absurdly verbose.
>>
>>55462339
If you really think Python is as bad as BASIC, then you haven't used BASIC.
>>
>>55474272
>Standart Template Library

>>55474310
Wrong C++ makes it easy to write bunch of very optimized code because it contains 95% of C
Here is an example from my old stabby crow thread

The task was to rearange an array in such a way that the 9s will go to the end while maintainging the relative order of the array.
This piece of code can sort 100 million arrays each with 10 elements for half a second

void sort_nine(int *arr, size_t n)
{
int *ptr, *sav;

for (ptr = arr, sav = ptr; ptr < arr + n; ++ptr) {
if (*ptr != 9) {
*sav = *ptr;
++sav;
}
}

for (; sav < ptr; ++sav) {
*sav = 9;
}
}


And if you understand pointers you will see how simple it really is.
>>
>>55461252

Exact opposite:

Kids and students think the world of Python, where anyone else who has actually worked for a living avoids dynamic typing like cancer (unless you're webdev) and Python's sluggishness.

Rapid POC and prototyping tool, aside from that is out classed by other languages.
>>
>>55474453

This course is making me do everything with pointers. I am already starting to fucking hate them.
>>
>>55474780
if you want to develop low-level/embedded/ultra-fast software - learn to love them. It's really useful to know pointer logic, even outside the above mentioned areas.
>>
>>55463107
>elaborate on this otherwise I'm going to assume you're repeating shit you overheard
the whole point of a programming language is to encapsulate complex, abstract operations in defined symbols and combinations of symbols. giving an implicit meaning to the absence of a symbol goes against the reason we use programming languages in the first place.

using the position of a block of code to imply meaning is a layer of syntactic complexity that was never necessary and only serves to complicate the programming experience by making the programmer consider a hidden dimension of information carried in every line of code

and fuck, it's not even an internally consistent experience - sure, you can try to convince yourself to think of whitespace as a meaningful symbol that's just not displayed, but what then about all that whitespace on the other side of the screen? does that have an implicit meaning?
>>
>>55474694
congrats you made an O(n) efficiency solution ?
>>
Can someone tell me why the following piece of code is giving me Valgrind segmentation fault?



int count_substr(const char *str, const char *sub)
{

char *ret;

int a = 0; // used to tell where the pointer has moved to
int count = 0;
ret = strstr(str,sub);

while(ret = strstr(ret,sub)){


printf("The substring is: %s\n", ret);
for ( a = 0; a < strlen(sub) ; a++){

ret++;

}

count = count + 1;

}







return count; // replace this
}


>>
>>55474914
void sortN(int* a, int aSize) {
int i = -1;
while (a[++i] != 9 && i<aSize) { };
int posN = i;
for (;i < aSize; ++i)
if (a[i] != 9)
swap(a[i], a[posN++]);
}


This one is O(n) too but it takes twice the time for the exact same input
>>
>>55463467
Arguably, but when you have a Python program that is kinda-sorta in the performance envelope that you need, it's just annoying to not be able to simply scale it up to the CPUs you have in your system.
>>
>>55475039
thats not O(n) though, that one is O(2n)
>>
>>55463284
>you don't have to worry about any problem normal multithreading brings up
That's not very true at all. Sure, dict/list operations are atomic on the language level, but as soon as you do anything that doesn't involve simple, singular objects, the usual issues are just as applicable as in other languages. You can't count on "a += 1" to be atomic, for instance.
>>
>>55463688
There have to be like 10 instances globally where this is actually a legitimate problem.
>>
BBC BASIC
>>
>>55474851
>using the position of a block of code to imply meaning is a layer of syntactic complexity that was never necessary and only serves to complicate the programming experience by making the programmer consider a hidden dimension of information carried in every line of code
if(a) dothing();
{
doOtherThing();
}
if(a)
{
doOtherThing();
}
>>
>>55475119
Which counts as O(n). Are you completely unaware of what big-O notation actually means?
>>
>>55460954
Perl
I wirr defending da honoru
>>
>>55475344
true, it is common practice to embed information in whitespace for the convenience of the programmer, but it was never strictly required. removing the whitespace does not alter the meaning of the code, however. scope does not change no matter how many or few tabs the programmer uses.
>>
>>55472654
>without a huge loss in readability
thats because perl is a write only language
>>
>>55475119
O(n) = O(2n)
that's kind of the point of o notation
>>
>>55475039
>This one is O(n) too but it takes twice the time for the exact same input
Just to prove your bullshit, I compiled both and timed them. The one in >>55474694 took 3.88 seconds for my dataset, and the one in >>55475039 took 3.91 seconds. So yes, it's 1% slower.
>>
>>55475738
?
it's possible to make two algorithms that are both O(n) but one takes exactly twice as long as the other. O(2n) = O(n)
>>
>>55475779
Of course, but the point is that the one in >>55475039 does not actually take twice as long.
>>
So is C supposed to be the harder programming language to pickup, compared to the other mainstream languages like C++ or Java?

Is it mandatory to deal with pointers all the time in C?
>>
>>55475976
>So is C supposed to be the harder programming language to pickup, compared to the other mainstream languages like C++ or Java?
You're deluding yourself if you think C++ is easier than C. Rather, I'd argue knowing C is a prerequisite for knowing C++, or you're just going to have no idea why things don't work as you expect them to.

Other than that, C isn't actually hard. The only disadvantage is that it's sometimes a bit tedious since you have to do many things a bit more manually than other languages that give you a lot of stuff for free.

>Is it mandatory to deal with pointers all the time in C?
Yes, but pointers aren't actually difficult.
>>
>>55476012

But is learning C a more fundamental step to learning programming as a whole? I want to be able to know how to write all the basic, tedious stuff rather than just have it all in some inbuilt library function.
>>
>>55476133
yes
>>
>>55476133
Yes. In C, you're programming for the actual hardware, rather than some abstract environment.
>>
>>55461013
It's not even Turing complete.
Learn some theory of computation pal it'll help in the long run.
>>
>>55476249
can you replace the fifth a in a text with a b using regex anon?
>>
Fortran 77
>>
>>55461409
This is bait right...lolz
>>
>>55461594
c# for high level...I'm smelling a winblows faggot.
>>
>>55476133
Not really.
If you want to learn it, go right ahead. It's always useful to know more languages, and there are some applications where you will absolutely need a low-level language like C. Just don't expect everything to suddenly make sense afterwards. It's just another set of tools, not a path to enlightenment.
>>
>>55476325
Nope!
>>
File: Capture.png (33 KB, 1065x631) Image search: [Google]
Capture.png
33 KB, 1065x631
>>55475795
>>55475738
Check this
>>
>>55476508
(a[^a]*a[^a]*a[^a]*a[^a]*)a
replace with \1b
note that replacement strings are a regex feature.

can you determine if a unary number(3= iii, 8=iiiiiiii) is prime?
>>
>>55476814
You know that regular expressions are just finite state machines which are one of the most basic of automata, right? You know that they can't even accept context free grammars right?
>>
>>55477019
both of these are possible
if your classification of regex doesn't allow them then your classification is wrong.
>>
I like Emacs lisp and C.
>>
>>55477463
It's ok if you were too poor to go to college, just don't try to tell me a finite state machine has the same computational power as a Turing machine. Your regex tool may be able to do those things, but the automata which regular expressions are made of are not capable of changing any input string, only accepting a language.
>>
>>55477532
>Your regex tool may be able to do those things, but the automata which regular expressions are made of are not capable of changing any input string, only accepting a language.
>Your regex tool
yeah c code can't do anything either, your compiler might be able to do these things but your c code itself can't
>>
>>55477618
You see the difference is that c can emulate a Turing machine. What you are trying to tell me is that a finite state machine can emulate a turing machine. Please read up on theory of computation. Sipsers introduction to the theory of computation book is pretty much the standard and you can get a paperback copy for ~$15 on amazon or just torrent it if that's your thing.
>>
>>55477532
http://www.noulakaz.net/2007/03/18/a-regular-expression-to-check-for-prime-numbers/
this is generic regex, i. e. nothing specific to certain interpreters
>>
>>55477532
>>55477673
Modern regex has little to do with regular languages. With captures and backreferences, regexes can parse context-sensitive languages.
>>
>>55477692
That's not a regular language please.

Assuming that there is some finite state machine which can in fact accept the language of all prime numbers, then the language can be split into xyz where x= the 1/2 of the string of unary digits, y = 1, and z = the remaining string of unary digits. By pumping y once you can see that the string is no longer accepted and therefore the language is not regular.

Please read up on pumping lemma, finite state machines, and regular languages. All these subjects are covered in detail in the sipser book I recommended to the other pal.

>>55477794
That's why I said your regex tool might be able to do the things you had said, but actual regular expressions can't.
>>
File: ss.png (20 KB, 1596x1170) Image search: [Google]
ss.png
20 KB, 1596x1170
>>55476782
I can't help that you're using a piss-poor compiler, Anon. At the same test size that I'm using, your sorry excuse for a compiler would have taken over 10 seconds for each test.

For the record, I'm running this on a Core i5-2400.
>>
>>55461511
>typeless variables
Except Python is a strongly typed language with type inference/dynamic typing.
>>
>>55468983
Bread/cake slicer I think? In other words, something that no-one uses. Ever.
>>
>>55477884
>strongly typed
>dynamic typing
pick one
>>
>>55477937
>>55468983
it's an electric knife https://www.youtube.com/watch?v=lZjNSpijD_g
>>
>>55471211
Almost. It prevents multiple threads from running Python bytecode, but the lock is released for disk/network I/O. Essentially useless for CPU-bound work, however multiprocessing is very easy to use and even shared memory is handled easily with it.
>>
>>55461163

Python is common in academia. 4chan trolls skip out on higher education, and they're bitter.
>>
>>55477884
What are you talking about? Strong typing and type inference are terms that are used for compilation processes, and Python has no conception of types during compilation.
>>
>>55477997
>Amerifats being too lazy even to cut their own bread
>>
File: Capture.png (32 KB, 967x633) Image search: [Google]
Capture.png
32 KB, 967x633
>>55477821
SURE
>Xeon e3-1231v3
>>
>>55477973
They're not mutually exclusive. Strong typing prevents you from adding a string and an into, dynamic typing is having the type inferred from the usage.
>>
>>55477884
Python doesn't have type inference. Type inference only make sense for statically typed languages, which Python isn't.

>>55477973
Python is strongly typed though, every variable has a type that is known at runtime. However, there is no idiomatic way of systematically enforcing type safety.

>>55478014
Didn't know about the exception for io, but I disagree with the claim that shared memory is easy to use. The basic data structures are quite poor, and I shouldn't have to implement a specific version of each complex data structure for shared memory. It's just goes against the "Python philosophy", to which I don't even adhere, but I don't like inconsistent languages.
>>
>>55478059
The type is not infered in dynamic typing, it's just that even immutable symbols have a type, so the variable just take the type of the immutable it's pointing to.
>>
Best language for a beginner? trying to get into programming.
>>
>>55478364
C
>>
>>55477673
my point is that saying "regex can't replace something" may be strictly, theoretically speaking correct. But in practice everybody will tell you that that's wrong, in fact, that's one of it's primary uses!
Let's take C for example. The Linux kernel is written in C. C doesn't allow setting the alignment of a variable. Therefore the Linux Kernel C source code can't do that. But it does! You see, it's not written in pure C, it's written in whatever gcc accepts as "C", which includes a lot of extensions.
You see, when talking about C people don't mean pure C, they mean C combined with common (very useful) compiler extensions.
The differences aren't that big for C, but they are there.
For regex on the other hand
>Many features found in virtually all modern regular expression libraries provide an expressive power that far exceeds the regular languages
see https://en.wikipedia.org/wiki/Regular_expression#Patterns_for_non-regular_languages
for more clarification.
>>
>>55478057
What optimization options are you using?
>>
>>55478014
>It prevents multiple threads from running Python bytecode, but the lock is released for disk/network I/O.
It can actually be released for any work done outside the Python interpreter. It is not uncommon for CPU-intensive libraries written in C to also release the lock. Numpy, for instance, does this (or so I've heard; I don't actually use Numpy myself), so that large array operations can be done in parallel.
>>
>>55478144
>every variable has a type that is known at runtime
No, the variables have no types; it is the objects that they point to that have types. That is the difference between strong and loose typing, by definition.
>>
File: image.jpg (20 KB, 256x256) Image search: [Google]
image.jpg
20 KB, 256x256
>>55478144
>>55478183
>https://herbsutter.com/2008/06/20/type-inference-vs-staticdynamic-typing/
Welp, now I'm more confused than I was before.
>>
>>55478364
Depends what you want to do.
If you're mainly impressed by being able to easily make nice interfaces for your programs, then maybe C# or Java or Delphi.
If you're more interested in math and algorithms and you really want to get into the things that computers are best at, then maybe C or Fortran or Forth.
If you are a lazy fucker and want to do as little work as possible then maybe Python or Perl.
If you want something that's useful with an even shorter learning curve, you might try AutoHotKey, Bash, or Powershell.
>>
>>55478057
That is likewise very far from twice as fast, though.
>>
>>55478577
Good point actually, though that can only be done from a Python C-extension and it's only safe if no Python code will get run, I think?
>>
Python for scripting
Java for regular software
Bash for OS bullshit

I value productivity over performance.
>>
>>55478678
>productivity
>java
>>
>>55478691
>implying
>>
>>55478661
Pretty sure that's exactly what I said.
>>
>>55460954
disagree with the C one

its being used in every way imaginable and very versatile so I dont think such a shitty toy knife is fitting, maybe for python or php but not for C
Thread replies: 255
Thread images: 19

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

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.
If a post contains personal/copyrighted/illegal content you can contact me at [email protected] with that post and thread number and it will be removed as soon as possible.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com, send takedown notices to them.
This is a 4chan archive - all of the content originated from them. If you need IP information for a Poster - you need to contact them. This website shows only archived content.