[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
why does python suck ?
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: 158
Thread images: 7
File: python.png (114 KB, 1487x645) Image search: [Google]
python.png
114 KB, 1487x645
why does python suck ?
>>
Because it does. /thread
>>
I dont know, I like Python for coding scripts
>>
>>53381854
should i learn C instead?
>>
>using interpreted languages
>any year
>>
>>53381830
It's alright. Not so great for big complicated projects, but if you just need to throw something simple together it's great.
>>
>>53381830

You're mom sucked my Python last night m8
>>
>>53381830
I like it more than bash.
>>
>>53381878
Yes.
>>
>>53381830
It actually doesn't suck.
If you need extreme speed or work on an VERY big codebase with a sizeable team, it might not be the first choice, but odds are you don't.

Python is designed with practicality and developer productivity in mind for most work. If you like to Get Shit DoneĀ® you should really give it a try, even if only for the awesome community.
>>
>>53381830
This >>53381903 combined with the fact that CPython is about the only actually working implementation. And CPython is a wreck where the developers confuse good interpreter craftsmanship with premature optimization. The result is, that the embedding API sucks and that the interpreter has a comparable huge startup time, rendering having an interpreter a moot point.

Also for "careful language design choices", aka GVR did what he wanted to and the community praised.
It's not terrible, but people praising 90s ad hoc scripting languages like Python over PHP for webdev are mostly fucking hypocrites.

>>53381878
Nice bait.
>>
>>53381830
python sucks just as much as the person coding it

when you dont know that what you just wrote and your code runs in O(n^4) because of that then its you own fault

I know this because I once did it myself
>>
https://www.youtube.com/watch?v=YW8jtSOTRAU
>>
>>53382187
Meanwhile, averaging two numbers in C...

a/2 + b/2 + (a%2 + b%2)/2
>>
>>53381830
Here is why: 0.1 + 0.2 = 0.30000000000000004

https://docs.python.org/2/tutorial/floatingpoint.html
>>
It doesn't

It's decent
>>
>>53382315
Decimal(0.1) + Decimal(0.2) = Decimal(0.3)

If you can't program, don't.
>>
>>53382315
That's not language specific

If it bothers you just
from decimal import Decimal
>>
File: himZD0M.gif (993 KB, 250x250) Image search: [Google]
himZD0M.gif
993 KB, 250x250
>>53382352
>Decimal(Decimal(Decimal(0.1) + Decimal(0.2)) = Decimal(0.3))
>>
File: node.jpg (23 KB, 463x283) Image search: [Google]
node.jpg
23 KB, 463x283
>not using Node.js for everything
Why do you hate yourself?
>>
>>53382471
It's just about as mediocre, but at least comes with a working package manager.
>>
>>53382315
>Here is why: 0.1 + 0.2 = 0.30000000000000004
Every language that has floating-point has this issue.

Its a shame they don't actually teach anything in computer science courses, or maybe we'd stop designing languages that use stupid obsolete shit like floating-point, which made perfect sense in the 1950s, and instead just use Dec64 instead

http://dec64.com/
>>
>>53382583
>>53382436
>>53382352
>>53382315

I learned this is how floats were stored, but I never saw an example that bad! Holy Shit!
>>
>>53382315
so this means you cant even add something correctly in python?

jesus, what a turd
>>
>>53382753
Yeah and you know why they do it like that? Its so that in the 1950s they didn't have to build a subtract circuit out of fragile and expensive vacuum tubes.

That's literally the only reason. But we still use it anyway.
>>
>>53381830
because you need to download it.
>>
>>53382902
Care to tell more about the story or give sources?
>>
>not using Go for everything
>>
>>53381830
Dynamic typing, mostly. Even that doesn't really much though for what I use python for.
>>
>>53381830
Slow as balls, late erroring, inconsistencies everywhere, muh whitespace, shit, barebone features.

def faggots(x=[]):
x.append(3)

print faggots([1])
print faggots()
print faggots([3, 4])
print faggots()

Enjoy your keks!

Or perhaps you'll like
i = 42
for i in range(10):
print "current i:", i
print i
print [i for i in range(20)]
print i
>>
>>53382940
Can read about it here
http://dec64.com/
>>
>>53383030

list comprehension -> synthactic suggar

also try:
#include <stdio.h>

int main() {
int i = 42;

printf("%d\n", i);

for (i = 0; i < 10; i++) {
printf("current i: %d\n", i);
}

printf("%d", i);

return 0;
}
>>
>>53383030

What's the problem here?

Don't use Python 2. It's a decade old.
>>
>>53384217

Meant to say it's a decade past expiration.
>>
>>53381830
It doesn't, it's a proper all-purpose language. Now go back to your little java castle.
>>
>>53383030
kid, don't try to make fun of what you don't understand, please.
>>
>>53383030
This is a common mistake that beginners often make. Even more advanced programmers make this mistake if they don't understand Python names.
def bad_append(new_item, a_list=[]):
a_list.append(new_item)
return a_list

http://python.net/~goodger/projects/pycon/2007/idiomatic/handout.html

> you're just doing it wrong, faggot
>>
>>53384205
The equivalent C would have been
#include <stdio.h>

int main() {
int i = 42;

printf("%d\n", i);

for (int i = 0; i < 10; i++) {
printf("current i: %d\n", i);
}

printf("%d", i);

return 0;
}

retard, and would correctly error out.
>>
>>53384217
>don't use [the only python version that anyone uses], it's [still the only version of python anyone bothers with]
Fuck off, guido.
>>
>>53384299
That had literally nothing to do with what was wrong here. The missing return was a mistake that doesn't detract in any way from the point.
>>
>>53384217
why do people still use 2?
>>
>>53384357
why do people still use cobol
why do people still use windows xp
etc
>>
It's fine. There are better and there are worse. My biggest problems with it are the lack of tail call optimization, the global interpreter lock, lambda expressions being awful, and the huge mess that has come out of the clusterfuck of a transition from 2 to 3. I'm pretty sure I had some complaint about how object instantiation works at one point but I don't actually remember the details of that.
>>
>>53384379
I mean, is 2 that different?
>>
>>53384357
Because it comes pre-installed on stuff and people have no idea what they're doing so they use it.

At this point its probably safe to switch to 3
>>
>>53384353
>The problem here is that the default value of a_list, an empty list, is evaluated at function definition time. So every time you call the function, you get the same default value.

I bet you dream in code?
>>
>>53382885
>implying it's different in C, C#, JS, etc.
>>
>>53381830
There's a bunch of technical points that make me dislike Python, but the thing I hate the most about is it's cringeworthy community coming up with pretentious shit like "Zen of Python" or the word "pythonic" for what a normal human being would call "best practices" and "idiomatic", respectively.
>>
>>53384407
These complaints are valid, pityfully...especially the lambda expression mess (ignoring the 2->3 transition, that problem is not on the language itself). Still, loving the language for what it is.
>>
>>53384357
Because there is a lot of software that isn't compatible with 3 and is either not maintained or is maintained but nobody plans to make the move. Moreover, developers have to keep maintaining both the 3 and 2 branches which is an additional cost, and subversions of 3 sometimes break compatibility which is another issue.
>>
>>53384448
Works just fine in these languages actually.
>>
>>53384511
Mate, every language has such an "evangelist" movement. The key point is to understand the reasoning behind the "best practices" and ignoring the mantra around it...you're not obliged to follow these rules.
>>
>>53384407
>>53384518

What's wrong with Python's lambdas? I like lambdas in Javascript.
>>
>>53381830
python is for script kiddies
csharp is for people who want money
javascript is for people who still believe in the web
java is for incompetent android developers
golang is for hamsters
>>
>>53381878
HolyC maybe.
Or else, BASIC.
>>
>>53382028
So's Java, and it sucks too.
>>
>>53384633
sheeet that brings me back, me and my friends used to code text-based gaymen about our class in BASIC back in the late 80's early 90's

good times
>>
>>53384325

no it wouldn't. Python does what has been shown in >>53384205. On the first instance of 'i' the variable gets declared (and initialized)

why should python declare it again in the same context?
>>
>>53384571
http://math.andrej.com/2009/04/09/pythons-lambda-is-broken/comment-page-1/
>>
SHITTY LANGUAGE.
I gotta learn thisfor school course.
>x = for x in or whatver billion possible variable declaration
>whitespace(really,how the fuck it this helps?)
>bloated.

i prefer 99% any other programming language i leanred so far than this reinvent the wheel crap.
>>
>>53384416

it is. it starts with simplr stuff like the print statment and ends with new style classes.
>>
>>53384556

>C:
>printf("%.17f", 0.1+0.2)
0.30000000000000004

>Javascript:
>console.log(0.1+0.2);
0.30000000000000004

>PHP:
>ini_set('precision', 17);
>echo 0.1+0.2;
0.30000000000000004

Pretty sure C# isn't any different. That's how floating point arithmetics works.
>>
>>53384703
>#;1> (+ 0.1 0.2)
>0.3

Why is Scheme so based?
>>
>>53382164
How'd you do that?
>>
>>53384725
The number tower can't be beat.
>>
>>53384674
This is by design, you know. Lots of other languages have the same behaviour because it's actually SIMPLER to understand what's going on.
>>
>>53384763
No other language has the same behavior.
>>
>>53384556

> printf truncates decimal points
> means floating point with now error
> hurrdurr you are retarded

try:
int main() {
double a = 0.1;
double b = 0.2;
printf("%.20f\n", a+b)
return 0;
}
>>
>>53384725
I don't know about Scheme, but some languages limit the number of significant digits displayed in floating point numbers sent to stdout, which might give a false impression of "correctness". Eg. PHP's "echo 0.1+0.2" will print 0.3 by default, but that's only because its default output precision is 14.
>>
>>53384803
I can confirm actionscript has the same behavior. Found that out in the worst way.
>>
>>53384921
>actionscript
>real
Choose one. Next thing you'll decide is that html5 is a programming language, lmao.
>>
>>53384697
>SHITTY X
said every retard who was told to learn something ever
>>
unicode problems
dynamic typing
division between v2 and v3
package management
docs
"pythonism"
>>
>>53385256
>dynamic typing is bad
When will this meme die?
>>
>>53385292
When buggy code due to dynamic typing ends up killing millions of programmers every year.
>>
>>53382500
pip
>>
>>53381944
Your*
>>
>>53384697
It looks like you should have started by getting a good grasp on English first.
>>
>>53381830
Broken scoping: Python, like many other scripting languages, does not require variables to be declared, as let (x 123) in Lisp or int x = 123 in C/C++. This means that Python can't even detect a trivial typo - it will produce a program, which will continue working for hours until it reaches the typo - THEN go boom and you lost all unsaved data. Local and global scopes are unintuitive. Having variables leak after a for-loop is confusing. Worse, binding of loop indices can be very confusing; e.g. "for a in list: result.append(lambda: fcn(a))" probably won't do what you think it would. Why nonlocal/global/auto-local scope nonsense? Such shortsighted scoping design leads to Python's faulty package system, which exposes everything, so that, for example, typing time.sleep=4 instead of time.sleep(4) would break the system-wide sleep function, while accidentally assigning some method to time.sleep, and you won't even give a runtime error - just a hard to trace bug. Moreover, dynamic scoping impedes encapsulation and compilation, so everything you write will be open source: no FASLs, DLLs or EXEs, while developer may want to have control over the level of access to prevent exposure of internal implementation, as it may contain proprietary code or because strict interface/implementation decomposition is required.
>>
>>53381830
Inconvenient syntax: FIOC or Forced Indentation of Code (aka "off-side" rule) impedes using CLI, automatically generating Python code and moving around large code blocks. Editing Python code requires special editors (forget about Word/Notepad), that expand tabs into spaces, while transmitting python code through a web post or email breaks indentation. Absence of block-terminator is so utterly confusing, that you'll find yourself ending blocks with #endif anyway. It's painful to deal with other things that need indenting, such as large SQL queries, or HTML when you're using things like mod_python. And why is there ":" when code almost always has a newline after it? Python's whitespace indentation indulges messy horizontal code (> 80 chars per line), where in Lisp one would use "let" to break computaion into manageable pieces: get used to stuff like self.convertId([(name, uidutil.getId(obj)) for name, obj in container.items() if IContainer.isInstance(obj)]), while logical connectives being lost in a pile of other symbols, like "and" in "if y > 0 or new_width > width and new_height > height or x < 0". Instead of usual "fold" and "map" functions, Python uses "set comprehension" syntax, which has a large collection of underlying linguistic and notational conventions, each with it's own variable binding semantics: good luck discerning [f(z) for y in x for z in gen(y) if pred(z)] from [f(z) if pred(z) for z in gen(y) for y in x]. In addition, you will enjoy cryptic expressions like z(z(m.i())[::-1]).
>>
>>53385292
Dynamic typing has almost no advantages, is a source of a major bug category and decreases readability
>>
>>53381830
Crippled support for functional programming. Python's lambda is limited to a single expression and doesn't allow conditionals. Python makes a distinction between expressions and statements, and does not automatically return the last expressions, thus crippling lambdas even more. Assignments are not expressions. Most useful high-order functions were deprecated in Python 3.0 and have to be imported from functools. Creating an object just to call a function, like ''.join(map(str, r)), is just annoying sign of bad language design. No continuations or even tail call optimization: "I don't like reading code that was written by someone trying to use tail recursion." --Guido
>>
>>53381830
Inconsistent type system: no Numerical Tower, meaning 1/2 would produce 0, instead of 0.5, leading to subtle and dangerous errors. Arithmetics on strings is surprising at best: "2" * 3 is "222", "2"+"3" is "23", while sum(["2", "3"]), "2" * "3" and "2"+3 are type errors. Multiple false values: "", [], (), False, 0, 0.0 - all auto-coerce to false, but 0==False and 1==True, while ""!=False and ()!=False; worser, True/False auto-coerce to integers, so False/True==0 and ['no', 'yes'][False] won't give an error, although ['no', 'yes'][0.0] does give an error. Why have both dictionaries and objects? Why have both types and duck-typing? The Python language reference devotes a whole sub-chapter to "Emulating container types", "Emulating callable Objects", "Emulating numeric types", "Emulating sequences" etc. -- only because arrays, sequences etc. are "special" in Python. Subtle data types (list and tuple, bytes and bytearray) will make you wonder "Do I need the mutable type here?", while Clojure and Haskell manage to do with only immutable data.
>>
>2014
Lmao Javafags and htmlshits still not using python
>2016
Python is so shit lol!!

What happened?? I use c++ so I dont really care just curious.
>>
>>53385339
>pip
I said an actually working one.
Last time I checked pip even shat itself on cherrypy.

I may be wrong about the details but it's almost as if package manager were built in linear progression:

The timeline (maybe not by years, but im too lazy to check)

-CPAN: Complete dickwaffles, forget about the package maintenance as well
-CRAN: Works half of the times
-pip: Works half of the times
-haddock: Works half of the times
-rubys thing: mostly works
-npm: mostly works
-nigget: mostly works
-cargo: almost always works
>>
>>53381830
Python has too many confusing non-orthogonal features: references can't be used as hash keys; expressions in default arguments are calculated when the function is defined, not when itā€™s called. Patterns and anti-patterns are signs of deficiencies inherent in the language. In Python, concatenating strings in a loop is considered an anti-pattern merely because the popular implementation is incapable of producing good code in such a case. The intractability or impossibility of static analysis in Python makes such optimizations difficult or impossible. Quirky triple-quoted strings seem like a syntax-decision from a David Lynch movie, and double-underscores, like init, seem appropriate in C, but not in a language that provides list comprehensions. There are better ways to mark certain features as internal or special than just calling it feature. self everywhere shows that OOP was bolted on. Poor UTF support and unicode string handling is somewhat awkward.
Poor performance: Python's GC uses naive reference counting, which is slow and doesn't handle circular references, meaning you have to expect subtle memory leaks and can't easily use arbitrary graphs as your data. In effect Python complicates even simple tasks, like keeping directory tree with symlinks. Global Interpreter Lock (GIL) is a significant barrier to concurrency. Due to signaling with a CPU-bound thread, it can cause a slowdown even on single processor. Reason for employing GIL in Python is to easy the integration of C/C++ libraries. Additionally, CPython interpreter code is not thread-safe, so the only way other threads can do useful work is if they are in some C/C++ routine, which must be thread-safe.
>>
>>53385401
Absence of block terminators is actually better when you get used to it
>>
>>53381830
Python has no well-defined and stable API, making life easier for Guido and tough on everybody else - that's the real cause of Python's "version hell". Python has inherited the installation mentality idea that libraries should be installed, so it in fact is designed to work inside unix package management, which basically contains a fair amount of baggage (library version issues) and reduced portability. Of course it must be possible to package libraries with your application, but its not conventional and can be hard to deploy as a desktop app due to cross platform issues, language version, etc. Open Source projects generally don't care about Windows, most open source developers use Linux because "Windows sucks". Python third-party library licensing is overly complex: licenses like MIT allow you to create derived works as long as you maintain attrubution; GNU GPL, or other 'viral' licenses don't allow derived works without inheriting the same license. To inherit the benefits of an open source culture you also inherit the complexities of the licensing hell.
No outstanding feature, that makes the language, like the brevity of APL or macros of Lisp. Python doesnā€™t really give us anything that wasnā€™t there long ago in Lisp and Smalltalk. "This is a hobby project and I neede my time for other thingsā€¦" --Guido van Rossum
>>
>>53385457
No, it's not, as it's exactly one more potential source of errors for something that is a matter of taste.
>>
It just werks so autists hate it
>>
>>53385444
People started using python for large projects instead of the 2 line scripts they were used to. They finally saw all the pain and danger python at scale brings instead of glorifying it blindly.
>>
>>53385449
But opam is absolutely fantastic, works absolutely all the time, and is older than some of these.
>>
>>53385449
all these package managers are getting out of control, why can't people just use guix or something and stop remaking the same fucking thing over and over and over
>>
Dynamic typing.
>>
>>53385827
Because they don't have control over which packages are allowed or not, and they're not cross-platform to the same platforms supported by the language.
>>
I'm doing computer science next year. Should I learn C++ over the summer before classes start?
>>
>>53386055
each project would have its own repo and store, you'd want to rename things like guix to pyguix and .scm to .pyscm to avoid confusion, but now managing packages is uniform
>>
>>53385847
this
>>
Why do most people see `a tangled mess of countless bloated libraries' as a good thing?
or as something good for people just starting to learn
I realized later that this is exactly what stood in the way of learning anything valuable when I was first setting out.
With Python, you don't learn about solving problems with computers - You learn how to find and search through libraries and what keywords will most likely help you find the thing you want that's already been written.
That there is no consistency in anything keeps you from being able to hold anything big in your head as you work it out.
That it is so abstract and high level, actively hiding all inner workings from you, keeps you from internalize the actual happenings in any meaningful way.
This is why Python sucks.
especially as an introductory language
It's super powerful for small wobsite scrapers, but to use it for anything else is just retarded madness.
>>
>>53381830

EAFP

Dynamic typing means IDEs can go eat shit (which means large code bases are fucked)

2-3 split

GIL


(j/k I love Python)
>>
>>53386098
yes
>>
I'm writing python at work these days and it's quickly becoming a PITA. It's what people who think they're software developers but really aren't like to use. There's no coolness to it at all, just stupid rules and weak typing.
>>
File: 305.png (3 KB, 340x240) Image search: [Google]
305.png
3 KB, 340x240
>>53388193
Even BASIC was cooler, especially if your computer came with it in ROM.
You could use PEEK & POKE, write directly to memory, call machine language routines...
No shit with libraries, versions, packages, or other stupid crap. Just pure coding fun, making games and shit!
>>
I just started learning Python yesterday (-_-)
>>
>>53388745
>(-_-)
Also, if you want to change, one day isn't much.

(but you shouldn't change)
>>
>>53381944
Good to see /b/tards broadening their horizons
>>
Sucks for writing in a functional style, because Guido hates functional programming. This results in a laughably low recursion depth.
>>
>every language I try to learn starts getting shit on routinely on /g/

what the fuck
>>
>>53389132

Pro-tip: No matter what you use, it's going to get shit on (not just on /g/).

Just use whatever you need to get shit done, and be aware the pitfalls of the tools you use. Don't waste all your time chasing fads and perfect tools cause there aren't any.

Except Python, which is great.
>>
>>53389132
If there would be a universally acclaimed language, it would be the only one.
You will always find someone who shits on the one you are currently using.
>>
>>53381903
See: Nuitka
>>
>>53389186
OCaml is the best language in the world.
>>
>>53382315
>MY language doesn't obey IEEE floating point standards, so it's SUPERIOR
>>
>>53384674
>I don't understand Python closure rules and I'm proud of it!
>>
>>53389476
My language does, but also doesn't use IEEE 754 by default for exact values and the likes.
>>
>>53384803
Or you can use a REAL language like Lisp that lets you explicitly declare how you want your variable to be evaluated. Probably sunny side up with ketchup like the faggot you are.
>>
>the 43 year of our lord
>still not using Hindleyā€“Milner type inference
>>
>>53384725
Because Lisp is based.

sh-4.3$ python
Python 3.5.1 (default, Dec 7 2015, 12:58:09)
[GCC 5.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> 1/2
0.5
>>> 1/3
0.3333333333333333
>>>
sh-4.3$ sbcl
This is SBCL 1.3.1, an implementation of ANSI Common Lisp.
More information about SBCL is available at <http://www.sbcl.org/>.

SBCL is free software, provided as is, with absolutely no warranty.
It is mostly in the public domain; some portions are provided under
BSD-style licenses. See the CREDITS and COPYING files in the
distribution for more information.
* (/ 1 2)

1/2
* (/ 1 3)

1/3
*
>>
>>53389555
Poached or GTFO.
>>
>>53389566
HM is very limited. System-F<: is the standard even though it is underdetermined (it is a fuckload more powerful though).
>>
>>53385390
>This means that Python can't even detect a trivial typo
>Applel goto fail
If only C had significant whitespace OH WAIT
>>
>>53385421
>Python's lambda is limited to a single expression and doesn't allow conditionals.
git gud
#!/usr/bin/env python3
import sys
(lambda input:(lambda ilen:(lambda m,olen:(lambda star:(lambda f,g:None)(list(map(lambda i:(lambda b:list(map(lambda x,y: star[x].__setitem__(y,input[i]),[i,b,m,m,i,i,b,b],[m,m,i,b,i,b,i,b])))(olen-i-1),range(ilen))),print("\n".join("".join(char for char in row) for row in star))))([[" " for x in range(olen)] for x in range(olen)]))(ilen-1,2*ilen-1))(len(input)))(sys.argv[1])
>>
>>53389601
goto fail is effectively a significant whitespace issue: the code is still valid python (beside the fact that empty clauses are not allowed in python), and the clause bound to the next statement which ends at ; instead of \n. This is a critical flaw of C, too.
>>
>>53389583
> 1 / 2
> 0.5
> (/ 1 2)
> 1/2

The only difference here is a full numeric tower. Sure, Lisp/Scheme are fucking great in that they support it, but pretty much no other language does. I don't know why you would even bother making this comparison, as it doesn't really tell much.
>>
>>53385452
>references can't be used as hash keys
Python doesn't have references, so yeah, they can't be used as hash keys.
>>
>>53385452
>doesn't handle circular references
Holy fuck you're misinformed. Python GC does cycle detection.
>>
>>53381830
because other languages are better than it in every way which makes it worthless
>>
>>53389671
You don't know shit about python.
>>
>>53389539
Python doesn't either. Decimal exact values work fine. Don't be a retard and assume floating point means exact value.
>>
>>53381830
interpreted garbage.

I prototype in c# and implement in c/c++
need to try llvm so I can go directly from c# to native
>>
>>53389709
Found the inbred.
>>
>>53389725
My fucking sides!
>>
>>53382327
its nicer than java
>>
>>53384511
its called humor, levity
>>
>>53386528
>retarded madness.

retarded post
>>
File: fc,550x550,white.u1.jpg (42 KB, 550x550) Image search: [Google]
fc,550x550,white.u1.jpg
42 KB, 550x550
You don't have to make it complicated.
> bas
bas 2.4
Copyright 1999-2014 Michael Haardt.
This is free software with ABSOLUTELY NO WARRANTY.
> load "float.bas"
> list
10 print using "#.#################";0.1+0.2
> run
0.30000000000000004
> print 0.1 + 0.2
0.3
>
>>
>>53381830
garbage collection
forced indentation
>>
Are languages like python and C# required knowledge for entry level programmers these days?
I'm majoring in EE but the only language we learn is C and assembly so I want to try to branch out a bit if worse comes to worse.
>>
>>53385412
>implying that strong typing doesn't come with its own major category of pointless bugs and errors

Hey let's use an int. Oh the value doesn't fit into 8 bits? Let's just take the two most significant bits and fucking throw them away lmao.
>>
>>53381830
When you newfags are going to stop listening to /g/ memes? I bet you installed gentoo too
Python is literally the best language nothing even comes close
>>
it's heavy
use Lua instead
>>
>>53389809
It might've been an attempt at humor by Guido van Sperglord but his pretentious followers treat it with dead seriousness and it never fails to make me cringe.
>>
>>53382583
Except floating point is part of any modern CPU, and is therefore faster.
>>
>>53391512
JavaScript is better
>>
I've changed it to

pos_loc = '/home/node3'

def locate_fnames():
for root, dirs, files in os.walk(pos_loc):
for file in files:
if re.search(r'(\w+?\s\w*\.\w+)', file):
print file
else:
print 'cannot be found'

locate_fnames()


Now it acknowledges the else statement and is printing that seven times (seven files in the directory), but the regex really should pick it up. Can anyone doublecheck it's not doing something it shouldn't like checking the filenames in the directory rather than file content ?
>>
>why does x suck?
ask uriel
oh wait he killed himself
>>
>>53392278
what? what exactly are you looking for with that regex; just the filename, or file contents? do you know exactly how the files are named? because that regex is pretty strict with what it will match.
>>
File: Capture.png (32 KB, 434x526) Image search: [Google]
Capture.png
32 KB, 434x526
>>53392365
>>
>>53392278
sorry this didn't format correctly.
>>
Yeah! I code all my websites in C! I'm hardcore like OP!
>>
>>53392278
>regex really should pick it up
Pick WHAT up, nigga? Maybe try learn to express yourself in English before attempting artificial languages.

>something it shouldn't like checking the filenames in the directory
What the fuck you think `file in files` stands for?
>>
>>53392592
Wow who shat in your cornflakes this morning
>>
>>53385729
Well, aside from the fact that I don't know opam so you could be wrong as hell, OCaml doesn't have a representative number of packages.

>>53386347
>but now managing packages is uniform
Unfortunately that is not true. There is a number of things language package manager do beside installing the packages and I don't want them to be done by special snowflake bash scripts.
>>
>>53391046
why the fuck "learn" C#'
>>
>>53382583
We need rationals
>>
>>53385344
Your'are
>>
>>53381830
Because it doesn't have None-aware operator and devs are too autistic to implement it in current age. Also, kinda hard to distribute. Otherwise I am happy with it.
>>
>>53392812
Lol'd
Thread replies: 158
Thread images: 7

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.